Live data from Hacker News

Show HN: I created a lightweight JavaScript library to visualize JSON as a graph

github.com

31–40 of 48 posts

Re: Show HN: I created a lightweight JavaScript library to visualize JSON as a graph

#32
Very cool project and would be super useful with something like GraphQL, which tends to produce big nested JSON objects. Thanks for sharing it!

One improvement in my eyes would be to remove the "connector" boxes, like `members (2): "Array"` and `powers (3): "Array"` and have the arrow go straight to the array property. Those connector boxes take up a lot of real estate without conveying new information.

Re: Show HN: I created a lightweight JavaScript library to visualize JSON as a graph

#33
post #22

Beautiful. Single file, 187 lines of JavaScript, no dependencies, does one thing and does it well. I wish there was a way to search for libraries like this one. Almost every time I look for some piece of open source software, I end up writing it myself because all the solutions I find are overcomplicated and try to do too many things.

> Single file, 187 lines of JavaScript, no dependencies, does one thing and does it well. Even though I understood your point, a cursory glance suggests it only maps a JavaScript object to a SVG. Hardly something with more than one responsibility, or something you need anything other than plain JavaScript to do.

You clearly don’t know how much js devs love dependencies! Look up “left-pad incident”

Re: Show HN: I created a lightweight JavaScript library to visualize JSON as a graph

#35
post #22

Beautiful. Single file, 187 lines of JavaScript, no dependencies, does one thing and does it well. I wish there was a way to search for libraries like this one. Almost every time I look for some piece of open source software, I end up writing it myself because all the solutions I find are overcomplicated and try to do too many things.

> Single file, 187 lines of JavaScript, no dependencies, does one thing and does it well. Even though I understood your point, a cursory glance suggests it only maps a JavaScript object to a SVG. Hardly something with more than one responsibility, or something you need anything other than plain JavaScript to do.

That is what I mean with "does one thing". The author made the right choice to put just one feature into this repo.

If you publish a repo with many features, bells and whistles, it is lost on me.

If you publish a repo that aims to do one thing in the best way possible, I will take a look at it, might use it, might contribute if I stumble across something that can be improved.

Repos like this should stay as small and focussed as they are. New features should go into new repos that make use of repos like this one.

Re: Show HN: I created a lightweight JavaScript library to visualize JSON as a graph

#36

Cool stuff! Found a bug: Changing e.g. "Jane Wilson" to something longer like "Jane Sarah Hildegard Wilson" in your example renders the arrows to the powers incorrectly.

Thanks for letting me know this. I will fix asap

Re: Show HN: I created a lightweight JavaScript library to visualize JSON as a graph

#38

Hi HN, I’ve been working on JSONtr.ee, a web platform for visualizing and graphing JSON data. While building it, I ended up creating my own lightweight JavaScript library to help anyone convert a JSON file into a schema graph. Before creating this library, I used MermaidJS, but I ran into significant limitations, especially with large and deeply nested JSON objects. My library was built to handle these cases better a…

I like it, one piece of feedback I have is - the export to PNG button, I wasn't expecting it to be a screenshot of the JSON, I thought it would be the graph; at least to me that would make more sense... paste JSON, see graph, export image of graph. What do you think.

I agree with this. Since it's rendered as an SVG, saving it as an SVG would be great. PNG as backup perhaps.

Looks great! Thanks OP for sharing!

Re: Show HN: I created a lightweight JavaScript library to visualize JSON as a graph

#39
post #32

Very cool project and would be super useful with something like GraphQL, which tends to produce big nested JSON objects. Thanks for sharing it! One improvement in my eyes would be to remove the "connector" boxes, like `members (2): "Array"` and `powers (3): "Array"` and have the arrow go straight to the array property. Those connector boxes take up a lot of real estate without conveying new information.

Great idea! Maybe they can write "members" and "powers" above the "column" with actual data boxes.
Post reply on HN