d3fc
d3fc copied to clipboard
How to use annotations in a webGL environment ?
How to use annotations in a webGL environment ?
I find the best way to approach this is to use SVG for the annotations, giving you a more flexible API (DOM interactions, styling, mouse movements etc), and WebGL for plotting the series data, allowing you to capitalise on the performance.
For an example, take a look at this visualisation:
https://colineberhardt.github.io/d3fc-webgl-hathi-explorer/
You can see how the series and annotation are rendered on different layers in the code here:
https://github.com/ColinEberhardt/d3fc-webgl-hathi-explorer/blob/master/index.js#L129-L142