TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

62 pointsby lou_alcala6 months ago

16 comments

lou_alcala6 months ago
Hi HN,<p>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.<p>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 and to offer more flexibility for customization. After solving my own problem, I decided to make it available for free to anyone who might find it useful.<p>Key features: Transforms JSON into schema graphs. Handles large and complex JSON objects seamlessly. Built with simplicity in mind – dependency-free and easy to integrate.<p>Why I made this: While working with APIs and large webhook payloads, I struggled to understand nested structures using standard tools. This library makes it easier to visualize the data as a graph and explore it interactively.<p>I’d love to hear your feedback, suggestions, or any ideas for improvement.<p>Thanks for taking a look!
评论 #42252691 未加载
评论 #42253523 未加载
评论 #42251087 未加载
评论 #42253512 未加载
评论 #42252008 未加载
评论 #42253474 未加载
tie_6 months ago
Very cool project and would be super useful with something like GraphQL, which tends to produce big nested JSON objects. Thanks for sharing it!<p>One improvement in my eyes would be to remove the &quot;connector&quot; boxes, like `members (2): &quot;Array&quot;` and `powers (3): &quot;Array&quot;` and have the arrow go straight to the array property. Those connector boxes take up a lot of real estate without conveying new information.
评论 #42254139 未加载
mg6 months ago
Beautiful.<p>Single file, 187 lines of JavaScript, no dependencies, does one thing and does it well.<p>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.
评论 #42255053 未加载
评论 #42253625 未加载
评论 #42254319 未加载
dchuk6 months ago
Am I missing something or does this just completely not do anything on iOS&#x2F;mobile? I see in the json editor a single object with two keys, and then no visual tree rendering whatsoever
评论 #42252470 未加载
rendaw6 months ago
This seems a lot like jless, which I&#x27;ve used a _lot_ for exploring complex json files. <a href="https:&#x2F;&#x2F;jless.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jless.io&#x2F;</a>
评论 #42253678 未加载
WA6 months ago
Perfect candidate for a nice, simple, self-contained web component &#x2F; custom element. Instead of:<p><pre><code> &lt;div id=&quot;json-tree&quot;&gt;&lt;&#x2F;div&gt; ... const container = document.getElementById(&#x27;json-tree&#x27;); container.innerHTML = generateJSONTree(jsonData); </code></pre> You&#x27;d have this:<p><pre><code> &lt;json-tree id=&quot;json-tree&quot;&gt;&lt;&#x2F;json-tree&gt; ... const container = document.getElementById(&#x27;json-tree&#x27;); container.jsonTree = jsonData; </code></pre> Attributes not necessary, simply pass the json data as a prop. Granted, the difference isn&#x27;t that big, but this is where web components shine.
dankwizard6 months ago
Really clean design. I generated a bunch of complex deeply strucutred dummy JSON data and the resulting visual wasn&#x27;t bad!<p>I like the name too! A small suggestion is don&#x27;t force yourself to call it Jsontr.ee because of the cool domain. Getting to the line &quot;Render the Tree Diagram: Use the jsontr.ee function to visualize the JSON data.&quot; -- Just use jsontree :-)
评论 #42252000 未加载
pcthrowaway6 months ago
Note that HTML tags contained in the json will be injected into the DOM.<p>Other than that, looks beautiful
scho30006 months ago
Cool stuff! Found a bug: Changing e.g. &quot;Jane Wilson&quot; to something longer like &quot;Jane Sarah Hildegard Wilson&quot; in your example renders the arrows to the powers incorrectly.
评论 #42254017 未加载
thisgoodlife6 months ago
Cool project! If the input is an array of objects, the output graph is just a single block. Is this the expected output?
评论 #42252477 未加载
n0id346 months ago
Very nice, what&#x27;s the main use case? vs just looking at the formatted JSON?
评论 #42253618 未加载
nirav726 months ago
This is an amazing project.<p>One suggestion - Make the JSON editor panel collapsible or resizable.
subhashp6 months ago
Looks gorgeous! It looks like a MindMap!!
dcreater6 months ago
How is this different to jsoncrack.com?
评论 #42253514 未加载
byyoung36 months ago
A VSCode extension would be cool
kanishkdan986 months ago
pretty cool! there&#x27;s a limit to how much you can zoom out, I&#x27;d have liked that. Also the ability to hide the json input area.