react-vega
react-vega copied to clipboard
[question] how to use array data in VegaLite
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!