Nivo: Feature request: Canvas

Created on 23 Aug 2017  路  10Comments  路  Source: plouc/nivo

Opening this so there's a way to track the "I'm also considering canvas support" comment from the README

enhancement

Most helpful comment

Now both BarCanvas and HeatMapCanvas support tooltips.

All 10 comments

Rendering to <canvas> becomes very important as the data points and SVG/DOM nodes increase.

These look great. Will they also, eventually, be interactive and supported by the API? I know this is still _really_ early. I'm just curious how you see them progressing.

Let me know if you'd like some help with canvas in nivo-api. I did some work a few years ago using node-canvas to return JPEGs, PNGs and data URIs.

Also, I noticed the images are a blurry on my retina display. I suspect the code needs to scale based on window.devicePixelRatio. This article gives more info about the required changes.

I think for basic shapes, interactivity will not be a problem but for things like line charts, stream graphs or sankey (links), that's another story :/

I though of something like node-canvas for the API, even considered headless chrome (the tooling around it seems quite active), but the problem with both is it requires a more complex setup (cario or chrome install), but it could be an opt-in. If you want to try something, you're more than welcome :)

On my retina display it's also blurry, thank you for the link, already used it when playing with pixi.js.

Now both BarCanvas and HeatMapCanvas support tooltips.

Added property pixelRatio which fallback on window.devicePixelRatio, all those changes are available in [email protected] and available on the demo.

@plouc Awesome! This looks great. Nice, _quick_, work

New chart supported:

I'm closing this issue as there is now canvas support for few charts => http://nivo/rocks/#/components?filter=Canvas

Was this page helpful?
0 / 5 - 0 ratings