Open g3o2 opened 5 years ago
Thanks for the suggestion, I will look into it to see if it easy to do so when I have time
BTW I am not even sure that you need to write your own renderer, there is already a svg, canvas and webgl renderer. Maybe some CSS or other middle solution is already sufficient...
Edit: According to feedback from one of the vega core developers, implementing xkcd kind of style while preserving the benefits from the vega ecosystem would probably require to:
write a post-processor on the vega-scenegraph to implement the sketchy effect on the marks (e.g. lines, axes, gridlines, bars, etc.). For completeness, here is an article on how vega works internally;
create a customised tooltip. For this purpose, one can tap into the vega-tooltip API for inserting a custom tooltip handler. There is also the possibility of theming the already existing tooltip via CSS;
the rest (e.g. font, font-size, etc.) can be implemented by a vega config specification, which sets the visualization’s theme. The guide to vega guides may be useful for experimenting.
Long-term matplotlib user here. Used mpl's xkcd style quite a bit, too. I'm digging into https://github.com/altair-viz/altair right now which is based on Vega. Would love to be able to use an xkcd style in that eco system, too!
Thanks for expressing all these thoughts @g3o2.
Interesting project! The syntax of your library strongly reminds me of vega-lite, which itself is based on vega and the latter being itself based on d3.
I can see at least three advantages for your library, in particular the rendering part, if you built a renderer for vega: