Comments (1)
Hey!
Thanks for your effort writing all the up!
I think the main obstacle here is that, for Elisp, an empty array and nil
are essentially the same thing, so it does make sense for json-encode to turn it into null
.
Now, for us JS devs it's not what we want or even expect.
Looking at the code, it feels to me like there's no elegant solution for that on the Elisp side. At the same time, I'm intuitively inclined towards some blatant in-your-face condition so that the behavior is very visible. But it's hard to come up with any.
Maybe we should encode "nodes", "links", and "tags" separately with some new stupid function (e.g. json-encode-or-empty-array) that would produce []
when the input is nil
-ish, otherwise, just call json-encode. And then we manually join them to produce a valid JSON string before sending it to the browser.
It's ugly AF but at least it's stupid in a good kind of way. :)
Or maybe there's a simpler solution which I don't know because I actually suck at Elisp.
from org-roam-ui.
Related Issues (20)
- [BUG] Highlighting doesn't return after hovering over other node
- [BUG] Invalid function (simple httpd ?) HOT 8
- [BUG] Only one tag showing in interface. HOT 12
- [BUG] - TypeError: a[qt(...)][s.backgroundColor] is not a function HOT 1
- [MINOR] Scale node size based on freshness/modification recency
- [BUG] EmacSQL had an unhandled condition: no such column
- Question: How to set it from `localhost` to machine name / IP address? HOT 4
- [ENH] Static export of org-roam-ui HOT 13
- [MINOR] Images/icons inside of nodes instead of plain colors
- How do I set custom CSS?
- [BUG] Sub-headings with IDs wreak havoc on UI HOT 2
- [MINOR] Color nodes by directory
- Org-roam android and search [MINOR]
- [BUG] Navigating to a deleted node causes websocket error
- [ENH] Respect `:exports none` on source blocks HOT 1
- [BUG] "Link children to ..." in "Filter" don't work when the file has ":ROAM_EXCLUDE: t"
- [MINOR] Add support to AsciiDoc
- [BUG] Delete Node. No effect
- [MINOR] Add support for ebdb links
- [ENH] Support render/display of Org Macros in `org-roam-ui`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-roam-ui.