-
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
Allow switching platforms #6964
Allow switching platforms #6964
Conversation
Move the Chart.platform to Chart.platform.current instead, and add ways to see available platforms and set the current platform. This is necessary for adding tests that use the "basic" platform.
You'll want to mention these changes in the migration guide: https://github.com/chartjs/Chart.js/blob/master/docs/getting-started/v3-migration.md |
@benmccann I've looked over the next steps and I think I might want to rework this a bit. What do you think about storing a platform on each chart instance? That way users can create charts using the dom platform and basic platform separately.
|
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.
Looks good. I think allowing switching on chart create is a good idea. It will allow more flexibility
@benmccann @etimberg thanks for the feedback! I updated this with the switch to a per-chart platform. |
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.
Not much to say, looks good to me!
e3b4185
to
c005cad
Compare
this looks pretty good to me. the build is failing, so you'll need to get the tests passing |
Got them working! Thanks for the feedback and quick responses everyone. |
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.
Cool! I'm very curious to learn more about possible web worker support :-)
1c297ab
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.
thanks for the patience on the reviews
@@ -48,7 +47,7 @@ window.addEventListener('load', function() { | |||
return (size / 24) * base; | |||
} | |||
} | |||
} | |||
}, |
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.
nit: trailing comma
b2561d7
@benmccann fixed that last issue. Looks like there's some codeclimate issues but none of them include code I touched - I think they're just there because of the merge commit I included. |
Move the Chart.platform to live as an instance on the chart instead, and add ways to override the current platform. This is necessary for adding tests that use the "basic" platform - which will be needed to test Chart.js in a web worker.