Add a complete example to README #201
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello. I came across this library last week and it looked like a great way of porting charts created with Altair to a React app but getting started was a challenge.
tl;dr
tooltip
instead ofhover
ashover
doesn't seem to work. Possibly related issue.My experience trying to use
react-vega
BarChart.js
, copy and paste the example.... // See the rest in packages/react-vega demo/stories/vega/spec1.js
. Go there.$schema
property? Do I need to add that to the example I copy/pasted? It also hasdata
, should I copy that as well? I guess I'll just try to copy everything that was missing.main.js
. Ohconst barData
, I guess I don't need the data fromspec1.js
after all? But whytable: [...]
? Maybe I need to include elements in this array? But what kind of elements? Scrolls down the page. Oh approach 3 has an example I can copy, nice.main.js
and add<BarChart data={barData} signalListeners={signalListeners} />
.Ok, well at least my project isn't screwed up. Maybe I can find some clues in the issue tracker? Fix example bugs + typing wonkiness? This looks promising. Sounds like a different issue, but hey, aaron-fuleki included a code sandbox link! And it works!
Why does his sandbox work while mine doesn't? His spec is defined as a variable instead of being passed directly into
createClassFromSpec()
. I don't see why that would make any difference, but worth a shot...and theusermeta
error is gone! Also some axes appeared:Progress!
What else is different? The data.
I'll copy that over to my sandbox. Now a chart appeared!
No idea what those errors are but something is rendering, so I'll take this as a win. The final
(working)sandbox. Edit: CodeSandboxreact-vega
examples appear to be broken (see comments below).