layerchart 0.43.5 → 0.43.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/scales.js +1 -2
- package/package.json +1 -1
package/dist/utils/scales.js
CHANGED
|
@@ -18,8 +18,7 @@ export function scaleBandInvert(scale) {
|
|
|
18
18
|
const eachBand = scale.step();
|
|
19
19
|
const paddingOuter = eachBand * (scale.paddingOuter?.() ?? scale.padding()); // `scaleBand` uses paddingOuter(), while `scalePoint` uses padding() for outer paddding - https://github.com/d3/d3-scale#point_padding
|
|
20
20
|
return function (value) {
|
|
21
|
-
|
|
22
|
-
const index = Math.floor((value - paddingOuter) / eachBand);
|
|
21
|
+
const index = Math.floor((value - paddingOuter / 2) / eachBand);
|
|
23
22
|
return domain[Math.max(0, Math.min(index, domain.length - 1))];
|
|
24
23
|
};
|
|
25
24
|
}
|