-
Notifications
You must be signed in to change notification settings - Fork 319
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
Enable initial animation on annotations #755
Conversation
@kurkle @LeeLenaleee off topic from this PR. Milestone 2.0.0 is growing but I don't know if there is any community best practice to release new major version. Maybe some PRs in queue could be moved to new milestone, 2.1.0 in order to release 2.0.0 to the users. |
I don't know about best practices, but I'd prefer fast releases. That means trying to include all the breaking changes we think is needed and bug fixes. Non-breaking features can be postponed to next "feature"/minor release. |
Great! At the moment I don't see any other breaking change to add. Hopefully I'm right but of course not sure 100%. Therefore some other days are needed, to think about. |
About CC issue. I can reduce the amount of lines (to recover 2 lines needed) but I think it could be better to split some files of types in some specific files to manage specific topic (label, callout, arrowHeads).
This could be addressed by a specific PR. |
Sure we can :) |
I think we should switch over to sonar or something else (I don't know anything better), because some of the CC "issues" are nonsense IMO. |
I'm not sure we should be providing a bunch of builtin initial named animations. I think it would be better to stick what Chart.js does (one default animation), and extend the animation configuration if needed. |
Let me recap in order to understand better.
Have I understood well? |
Hmm, no, I don't really have any objection for annotation level animation configuration. Though it should be doable at plugin level with scriptable options too.
This is what I'm suggesting. I'd rather have samples for some custom animations instead of built-in modes. |
Clear!!! Let me code a little bit, going to this direction. I have to think a clever way to provide a customization method to the users. |
I have experience on Sonar but for JAVA code (my project is there). But I don't have enough experience to say if Sonar is better than CC for JS. Maybe there some good things in CC comparing with Sonar that I don't know |
@kurkle I think I have completed the "first" imp, following your hints. I don't release this PR because it needs to be changed when other PRs will be merged (mainly the label on ellipse). Anyway, feel free to comment and review it, I'll change the impl accordingly. |
done! |
Correct me if I'm wrong, but does |
Yes , it does.
OK, I'll do. I have named it adding Animations because I wanted to highlight we are talking about init of animation. |
Renamed in |
Conflicts: docs/guide/configuration.md src/helpers/helpers.options.js src/types/line.js types/options.d.ts
Conflicts: src/helpers/helpers.options.js
Conflicts: src/helpers/helpers.canvas.js src/types/label.js
Needs a rebase |
Conflicts: docs/.vuepress/config.js src/helpers/helpers.chart.js
Merging, helpers.canvas has got 254 rows, more than 250 set by CC... :( |
This PR is enabling the possibility to the user to set the animation to the annotations when they are drawing at chart initialization.
It adds an options to all annotations:
init
.webm.mp4
init
boolean
|(chart, properties, options) => void | boolean | AnnotationBoxModel
false
The callback is not invoked passing the element context (because element is not build in that phase) but receives chart, annotation options and the properties of the element (x, y, x2, y2, centerX, centerY, width, height), calculated before callback invocation.
The callback can return a boolean or an object, with the initial values of the element properties (x, y, x2, y2, centerX, centerY, width, height), needed to perform the animation.
TODO