Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Canvas #33

Closed
jfsiii opened this issue Aug 22, 2017 · 10 comments
Closed

Feature request: Canvas #33

jfsiii opened this issue Aug 22, 2017 · 10 comments

Comments

@jfsiii
Copy link

jfsiii commented Aug 22, 2017

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

@jfsiii
Copy link
Author

jfsiii commented Aug 22, 2017

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

@plouc
Copy link
Owner

plouc commented Aug 29, 2017

Started some tests with canvas

@jfsiii
Copy link
Author

jfsiii commented Aug 29, 2017

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.

@plouc
Copy link
Owner

plouc commented Aug 29, 2017

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.

@plouc
Copy link
Owner

plouc commented Aug 29, 2017

Now both BarCanvas and HeatMapCanvas support tooltips.

@plouc
Copy link
Owner

plouc commented Aug 29, 2017

Added property pixelRatio which fallback on window.devicePixelRatio, all those changes are available in nivo@0.23.2 and available on the demo.

@jfsiii
Copy link
Author

jfsiii commented Aug 29, 2017

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

@plouc
Copy link
Owner

plouc commented Sep 1, 2017

New chart supported:

@plouc
Copy link
Owner

plouc commented Sep 11, 2017

@plouc
Copy link
Owner

plouc commented Dec 9, 2017

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

@plouc plouc closed this as completed Dec 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants