react-vega icon indicating copy to clipboard operation
react-vega copied to clipboard

[question] how to use array data in VegaLite

Open HaveF opened this issue 3 years ago • 0 comments

Thanks for this repo.

About the import { VegaLite } from 'react-vega', it says, data attribute is a plain object instead of an array.

const spec = {
  width: 400,
  height: 200,
  mark: 'bar',
  encoding: {
    x: { field: 'a', type: 'ordinal' },
    y: { field: 'b', type: 'quantitative' },
  },
  data: { name: 'table' }, // note: vega-lite data attribute is a plain object instead of an array
}

But how can I deal with array data?

[{ "name": "table1"... }, { "name": "table2"... }]

I searched a lot, but without luck. Thanks in advanced!

HaveF avatar Jul 29 '20 10:07 HaveF