svelteplot 0.4.2-pr-186.0 → 0.4.2-pr-186.1
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.
|
@@ -99,7 +99,7 @@ function invertScale(scale, position) {
|
|
|
99
99
|
const domain = scale.fn.domain();
|
|
100
100
|
const eachBand = scale.fn.step();
|
|
101
101
|
const extent = range[1] - range[0];
|
|
102
|
-
const posInRange = (
|
|
102
|
+
const posInRange = (position - range[0]) * Math.sign(extent);
|
|
103
103
|
const index = Math.floor(posInRange / eachBand);
|
|
104
104
|
return domain[index];
|
|
105
105
|
}
|