vega/react-vega

[bug] Object vs Array for "data" attributes in Vega react wrapper

hydrosquall opened this issue · 0 comments

It looks like passing an array instead of object as described in the docs doesn't currently work, and that the data attribute always needs to be an object, just as the VegaLite example required.

https://a.cl.ly/mXu10bL8

https://github.com/vega/react-vega/tree/master/packages/react-vega#approach2-use-vega-generic-class-and-pass-in-spec-for-dynamic-component

I wasn't sure if this is a bug in the Vega component, or a documentation fix.

Here's a minimal Codesandbox to reproduce: https://codesandbox.io/s/boring-gareth-4ep0t?file=/src/App.js

I came across this bug because I was trying to make multiple datasets available to the data attribute (so that different layers could reference different datasets). I was wondering if doing this is meant to be possible through the react-vega wrapper, or if this is a usecase that requires using react-vega directly.