discoveryjs / discovery

A framework for rapid data (JSON) analysis, shareable serverless reports and dashboards
https://discoveryjs.github.io/discovery/
MIT License
336 stars 6 forks source link

Allow multiple Jora requests in one edit box #35

Closed rualark closed 4 years ago

rualark commented 4 years ago

On separate lines.

lahmatiy commented 4 years ago

Could you please explain a use case?

rualark commented 4 years ago

Example: working with large JSON, need to select from different lists and objects, compare results or create a screenshot which shows how data compares.

E.g. I work with 1-5 Mbyte json every day.

lahmatiy commented 4 years ago

But why it should be on separate lines? I guess it should be different query editors with their own outputs, isn't it? If so, I'm working on new report page where that's will be possible, unfortunately can't say ETA for this feature. One of solutions is to build an object with various computations, and you also may use variables, e.g.

$foo: foo + bar.({ ... });
$bar: a.b.c.d;
{
  $foo,
  $bar,
  baz: something.cool().[...]
}
rualark commented 4 years ago

Are there examples to understand it better? How can I query two different objects inside json in one report?

lahmatiy commented 4 years ago

Can you provide more details about the problem? You can make an object with necessary computations like so:

{
  foo: some.path.(map).[filter].etc,
  bar: another.query
}

And then use it for views

[
  'table:foo', // the same as { view: 'table', data: 'foo' }
  'struct:bar'
]

Or use queries right in view configuration:

[
  'table:some.path.(map).[filter].etc', // the same as { view: 'table', data: 'some.path.(map).[filter].etc' }
  'struct:another.query'
]
rualark commented 4 years ago

Thanks. In this case multiple jora requests are not needed. But it would be cool to save report templates.