3

I want to display JavaScript objects (JSON), or more generally associative arrays (hash, map). There is no problem with flat ones, these are simple tables. But it becomes problematic with arrays, and deeply nested objects.

Are there good libraries to visualize this? There are two options I see here

  1. Visualize as a nested table

    This here is good example, I like it a lot, but apparently no library structure

  2. An associative array is a tree, so maybe reduce the problem to visualizing a tree.

1

2 Answers 2

2

I know theJIT - JavaScript InfoVis Toolkit - is a js library which can display tree (spacetree layout) graph structures from JSON data.

D3.js is another, it has tree layout js which can handle JSON data. There's this StackOverflow Question.

I've never tried any of them.

Sign up to request clarification or add additional context in comments.

Comments

-1

If this is for debugging from the backend I would highly recommend:

JSON View Chrome Extension

If however this is for Javascript debugging:

console.dir(myJSONObj);

console.dir works better for objs than console.log.

1 Comment

Sorry, I meant to visualize on a website, not for development purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.