-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Add 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.
test/specs/core.controller.tests.js
Outdated
}); | ||
}); | ||
|
||
it('should resize the canvas if attached to the DOM after construction', function(done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] it looks like this test has the same name as the one before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!
FYI This broke our isomorphic app on line 274 of platform.dom.js. The issue is that |
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? |
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 |
I'm not familiar with isomorphic apps and I don't understand why Chart.js is evaluated server side. Of course checking |
Well It's probably reasonable to just not load |
(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.
hi, I have problems with dynamically created canvases in 2.8.0 version.
As a result, I have empty canvases. |
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.
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.display
changes 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