-
Notifications
You must be signed in to change notification settings - Fork 21
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
Make plugin no longer self registering #24
Make plugin no longer self registering #24
Conversation
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.
Awesome! Strange that you didn't have to change the plugin integration in the docs. Not sure why it was already integrated that way.
Can you also add a migration page, similar to this one? (mostly a copy/paste and remove parts that doesn't apply to this plugin).
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 a lot @LeeLenaleee!
Hello,
as in the read me. Do I have to change anything here? The docs now mention this:
|
@gregh3269 do you have a reproducible sample because when I tested this it worked fine: https://codepen.io/leelenaleee/pen/ExwBJgK |
Ok, I can see we now must have a Chart.register(ChartDeferred); first, which makes a global, guess we now cannot do it inline ? from the getting started what does this mean/do then? OR only to specific charts
..I can see from here Might be worth updating the README.md also for this change for the tldr's. ;-) Thanks. |
@gregh3269 mb, seems I forgot to save the pen, updated it with inline register and it seems to work fine so if it is not working please share a sample of it: https://codepen.io/leelenaleee/pen/ExwBJgK |
ok thanks, makes sense now! new Chart(...
plugins: [ChartDeferred],
...
options: {
...
plugins: {
deferred: {
xOffset: 150, ## defer until 150px of the canvas width are inside the viewport
yOffset: '50%', ## defer until 50% of the canvas height are inside the viewport
delay: 500 ## delay of 500 ms after the canvas is considered inside the viewport
}
}
}
}); |
Working example: https://codepen.io/leelenaleee/pen/ExwBJgK