Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for detached canvas element #4591
Conversation
Allow to create a chart on a canvas not yet attached to the DOM (detection based on CSS animations described in https://davidwalsh.name/detect-node-insertion). The resize element (IFRAME) is added only when the canvas receives a parent or when `style.display` changes from `none`. This change also allows to re-parent the canvas under a different node (the resizer element following). This is a preliminary work for the DIV based resizer.
| }); | ||
| }); | ||
|
|
||
| it('should resize the canvas if attached to the DOM after construction', function(done) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
hach-que
commented
Aug 2, 2017
|
FYI This broke our isomorphic app on line 274 of platform.dom.js. The issue is that |
This comment has been minimized.
This comment has been minimized.
|
Thanks @hach-que for reporting this issue. Not sure what the best way to fix it, ideally, the DOM platform should not be instantiated on Node.js. Are you able to share your app or a minimal use case? |
This comment has been minimized.
This comment has been minimized.
hach-que
commented
Aug 2, 2017
|
We can't share the application source code at this time. We're using The best way to check for this stuff is to see if |
This comment has been minimized.
This comment has been minimized.
|
I'm not familiar with isomorphic apps and I don't understand why Chart.js is evaluated server side. Of course checking |
This comment has been minimized.
This comment has been minimized.
hach-que
commented
Aug 2, 2017
|
Well It's probably reasonable to just not load |
This comment has been minimized.
This comment has been minimized.
hach-que
commented
Aug 2, 2017
|
(The reason we want the |
Allow to create a chart on a canvas not yet attached to the DOM (detection based on CSS animations described in https://davidwalsh.name/detect-node-insertion). The resize element (IFRAME) is added only when the canvas receives a parent or when `style.display` changes from `none`. This change also allows to re-parent the canvas under a different node (the resizer element following). This is a preliminary work for the DIV based resizer.
This comment has been minimized.
This comment has been minimized.
maria-grigorieva
commented
Apr 19, 2019
•
|
hi, I have problems with dynamically created canvases in 2.8.0 version.
As a result, I have empty canvases. |
simonbrunel commentedJul 31, 2017
•
edited
Allow to create a chart from a canvas not yet attached to the DOM (detection based on CSS animations described in https://davidwalsh.name/detect-node-insertion). The resize element (IFRAME) is added only when the canvas receives a parent or when
style.displaychanges fromnone. This change also allows to re-parent the canvas under a different node (the resizer element following). This is a preliminary work for the DIV based resizer.Fixes #3790
Fixes #4605