-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
pass ratio to the data_labels_format callback when appropriate #2694
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2694 +/- ##
==========================================
+ Coverage 81.02% 81.03% +<.01%
==========================================
Files 59 59
Lines 4633 4634 +1
==========================================
+ Hits 3754 3755 +1
Misses 879 879
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #2694 +/- ##
==========================================
+ Coverage 81.02% 81.03% +<.01%
==========================================
Files 59 59
Lines 4633 4634 +1
==========================================
+ Hits 3754 3755 +1
Misses 879 879
Continue to review full report at Codecov.
|
@panthony Isn't it possible to make this not a breaking change? How about making v have the shape of |
@kt3k I can pass it as 5th argument but it would mean that we'll have callbacks that takes:
And others:
Passing an object would still be a breaking change |
Ah, that's bad... Another option could be introducing new option data_labels_formatter (or something) which takes 5 arguments and keep data_labels_format take 4 arguments, though it looks a little tricky to implement and document... |
Anyway we haven't introduced such explicit breaking changes recently except d3 v5 update, I'm going to talk with @masayuki0812 about the policy and how we update the version number if we do breaking changes. |
@kt3k Not sure if always possible but maybe we could pass directly the data point in all callbacks. This way we have everything (id, index, value, ratio, any other attributes that may be added) and new attributes could be added in the future without API break. To ease the upgrade we could introduce a boolean in the config to toggle the previous/new behavior. Config that would eventually be dropped. |
Sounds nice 👍 I prefer to switch to that API in some future.
That's sounds reasonable. It would make the upgrade flow more graceful. |
That one is a breaking change.
The
data_labels_format
callback now takes theratio
alongs withvalue
andindex
.The
ratio
is undefined if the chart is not normalized.I also passed
$$.api
as this for the format callback in case it can be useful.