juttle / juttle-viz

Juttle Visualization Library
Apache License 2.0
11 stars 4 forks source link

json output of `view text` should be dense by default #5

Closed dmehra closed 8 years ago

dmehra commented 8 years ago

The CLI outputs dense JSON by default, but if you supply -display.indent it not only indents the points, but switches to blown-up pretty JSON. The juttle-viz version of view text should do the same, but does not: the default in the browser is the blown-up JSON.

Let's update juttle-viz to conform:

Default = dense JSON

juttle> emit -limit 3 | put name='foo', value=123 | view text
[
{"time":"2015-12-23T18:45:45.544Z","name":"foo","value":123},
{"time":"2015-12-23T18:45:46.544Z","name":"foo","value":123},
{"time":"2015-12-23T18:45:47.544Z","name":"foo","value":123}
]

With -indent option = pretty-print JSON

juttle> emit -limit 3 | put name='foo', value=123 | view text -style 'json' -indent 4 
[
    {
        "time": "2015-12-23T18:46:48.057Z",
        "name": "foo",
        "value": 123
    },
    {
        "time": "2015-12-23T18:46:49.057Z",
        "name": "foo",
        "value": 123
    },
    {
        "time": "2015-12-23T18:46:50.057Z",
        "name": "foo",
        "value": 123
    }
]
dmehra commented 8 years ago

Since our debugging doc currently advises to (pass; view text) this would be good to fix in the viewer.