2 ms·
I like the idea of the whole plot being described as json. I was looking for a way to automatically generate plots from a project written in Prolog (https://git
by YeGoblynQueenne 6y ago
I like the idea of the whole plot being described as json. I was looking for a way to automatically generate plots from a project written in Prolog (https://github.com/stassa/louise https://github.com/stassa/louise). Until now I was composing some R plotting scripts with Prolog, which can get a bit clunky. Swi-Prolog has a solid library to convert from Prolog terms to json so it should be straightforward to translate between program output in Prolog and Vega-Lite json. I will definitely give this a try.
Just a question to @domoritz - I noticed that in this example plot, that shows relative numbers of different types of animal produced in the US and UK rendered as emoji:
https://vega.github.io/vega-lite/examples/isotype_bar_chart_emoji.html https://vega.github.io/vega-lite/examples/isotype_bar_chart_...
- the data is encoded as hard-coded values that tell the engine where to place each icon of a sheep, pig or cow. Isn't it possible to derive these positions from numerical data, automatically?
For instance, instead of enumerating each instance of a "pig":
"values": [
{"country": "Great Britain", "animal": "pigs"},
{"country": "Great Britain", "animal": "pigs"},
... etc.
Shouldn't it be possible to input the actual number of pigs and have the engine put it into bins as necessary?