Question

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.

Était-ce utile?

La solution

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.

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top