Closed rrag closed 8 years ago
+1 for performance and faster development
Server-side can be a bummer however SVG performance is definitely not created equal among the browsers especially mobile, so I actually like the idea of Canvas only. For drawback 1, it is still easy enough to do off-screen canvas render for a given size and canvas save to image is trivial compared to passing svg to the server to get an image. Plus for my Ng2 port currently composing components inside the svg namespace is not possible because of Shadow DOM and workaround is not forthcoming anytime soon, so Canvas makes it much easier.
Right now I use SVG because over canvas because it's doesn't render well on retina screens
How about seperating into two repo, one using canvas
, and one using SVG
( or react-native-svg
for react-native
support)
just attached my demos FYI https://github.com/WaiSiuKei/nila https://github.com/WaiSiuKei/react-native-nila
Developing on 4k monitor, canvas render is not very sharp compared to SVG, as @trevorbernard also experienced with retina display.
Thank you all for your input, SVG output may be sharp on high res monitors, but the responsiveness will not match canvas. There were some anti aliasing issues with canvas earlier which I think I have rectified in the work in progress 0.6 version. @trevorbernard @psunderr Can you please check this on a 4k monitor, retina screen please. Is this any better?
I'm not sure I see a difference on 4k, it seems to render the same (though the stroke around bars/candles may give a slight impression of increased crispness)
I will try to check on Retina shortly as well.
EDIT: The example you linked also looks fuzzy on iPhone 5 Retina display (1136-by-640-pixel resolution at 326 ppi)
RE: https://github.com/rrag/react-stockcharts/issues/119
@trevorbernard @psunderr can you test this?
http://rrag.github.io/react-stockcharts-next/documentation.html#/macd
I am going to keep svg support for now. it is so easy to debug with svg
https://github.com/Flipboard/react-canvas Just thought I throw this out there.. I believe https://cryptowat.ch is built with react-canvas
I am thinking of removing
svg
support completely in a future version,Benefits:
Drawbacks:
The main motivation behind this thought is that, in order to improve the performance on pan actions, there are some hacks in place for canvas, and these hacks are getting bigger and complex to deal with to support both svg and canvas. I think most users don't really care if it is svg or canvas, they care about performance and usability.
Thoughts?