Live data from Hacker News

JSON Crack – Visualize JSON data into graphs

jsoncrack.com

81–90 of 100 posts

Re: JSON Crack – Visualize JSON data into graphs

#83
post #36

If you indent your code manually then you can achieve something that I feel looks quite similar. So the example they give would be written as: {"squadName": "Super hero squad", "homeTown": "Metro City", "formed": 2016, "secretBase": "Super tower", "active": true, "members": [{"name": "Molecule Man", "age": 29, "secretIdentity": "Dan Jukes", "powers": ["Radiation resistance", "Turning tiny", "Radiation blast"]}, {"nam…

This is how Lisp code (and S-expressions in general) is conventionally indented.

Re: JSON Crack – Visualize JSON data into graphs

#87
post #62

For working with JSON from terminal recommend: https://fx.wtf

There's also https://jless.io

I use jq and jless and find that to be more practical than tools like these (not just because of being available in terminal).

When I have large blob of json, I am usually interested in first getting a high level idea of how it is structured (first few levels) then I either need to drill down or filter to find what I need. The combination of jless for interactive exploration and jq to make it easily scriptable/repeatable is quite nice.

I find it natural to reduce the json I start with to a subtree I can make sense of, and thus don't find myself lacking a tool which can provide a visual representation of the complete dataset.

Re: JSON Crack – Visualize JSON data into graphs

#89
post #36

If you indent your code manually then you can achieve something that I feel looks quite similar. So the example they give would be written as: {"squadName": "Super hero squad", "homeTown": "Metro City", "formed": 2016, "secretBase": "Super tower", "active": true, "members": [{"name": "Molecule Man", "age": 29, "secretIdentity": "Dan Jukes", "powers": ["Radiation resistance", "Turning tiny", "Radiation blast"]}, {"nam…

Python formats it almost exactly like you did:

  $ python3 -m json.tool
  {
    "squadName": "Super hero squad",
    "homeTown": "Metro City",
    "formed": 2016,
    "secretBase": "Super tower",
    "active": true,
    "members": [
        {
            "name": "Molecule Man",
            "age": 29,
            "secretIdentity": "Dan Jukes",
            "powers": [
                "Radiation resistance",
                "Turning tiny",
                "Radiation blast"
            ]
        },
        {
            "name": "Madame Uppercut",
            "age": 39,
            "secretIdentity": "Jane Wilson",
            "powers": [
                "Million tonne punch",
                "Damage resistance",
                "Superhuman reflexes"
            ]
        },
        {
            "name": "Eternal Flame",
            "age": 1000000,
            "secretIdentity": "Unknown",
            "powers": [
                "Immortality",
                "Heat Immunity",
                "Inferno",
                "Teleportation",
                "Interdimensional travel"
            ]
        }
    ]
  }

Re: JSON Crack – Visualize JSON data into graphs

#90
post #36

If you indent your code manually then you can achieve something that I feel looks quite similar. So the example they give would be written as: {"squadName": "Super hero squad", "homeTown": "Metro City", "formed": 2016, "secretBase": "Super tower", "active": true, "members": [{"name": "Molecule Man", "age": 29, "secretIdentity": "Dan Jukes", "powers": ["Radiation resistance", "Turning tiny", "Radiation blast"]}, {"nam…

Python formats it almost exactly like you did: $ python3 -m json.tool { "squadName": "Super hero squad", "homeTown": "Metro City", "formed": 2016, "secretBase": "Super tower", "active": true, "members": [ { "name": "Molecule Man", "age": 29, "secretIdentity": "Dan Jukes", "powers": [ "Radiation resistance", "Turning tiny", "Radiation blast" ] }, { "name": "Madame Uppercut", "age": 39, "secretIdentity": "Jane Wilson",…

I don't python, but this scheme missed the point. Keys are vertically aligned, but values are not. Some brackets are vertically aligned, other are not (you have to hunt for the starting square brackets). Bracket take up a whole line each wasting vertical space.
Post reply on HN