Open panthony opened 5 years ago
Merging #2694 into master will increase coverage by
<.01%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #2694 +/- ##
==========================================
+ Coverage 81.02% 81.03% +<.01%
==========================================
Files 59 59
Lines 4633 4634 +1
==========================================
+ Hits 3754 3755 +1
Misses 879 879
Impacted Files | Coverage Δ | |
---|---|---|
src/text.js | 98.7% <100%> (+0.01%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 4163be5...0b65108. Read the comment docs.
Merging #2694 into master will increase coverage by
<.01%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #2694 +/- ##
==========================================
+ Coverage 81.02% 81.03% +<.01%
==========================================
Files 59 59
Lines 4633 4634 +1
==========================================
+ Hits 3754 3755 +1
Misses 879 879
Impacted Files | Coverage Δ | |
---|---|---|
src/text.js | 98.7% <100%> (+0.01%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 4163be5...0b65108. Read the comment docs.
@panthony Isn't it possible to make this not a breaking change? How about making v have the shape of { value: number, ratio: number }
only when stack.normalize == true, or passing ratio as 5th argument?
@kt3k I can pass it as 5th argument but it would mean that we'll have callbacks that takes:
(value, ratio, id)
And others:
(value, id, i, j, ratio)
Passing an object would still be a breaking change
@panthony
we'll have callbacks that takes: (value, ratio, id) And others: (value, id, i, j, ratio)
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.
@panthony
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.
Sounds nice 👍 I prefer to switch to that API in some future.
To ease the upgrade we could introduce a boolean in the config to toggle the previous/new behavior.
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.