mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-02 15:30:37 +01:00
remove granuality
This commit is contained in:
1 parent
4a6a5b3d34
commit
b65229dc80
1 file changed
+3
-4
+3
-4
@@ -1,6 +1,5 @@
|
|||||||
import { memo, useMemo } from "react";
|
import { memo, useMemo } from "react";
|
||||||
|
|
||||||
const RESOLUTION = 1000;
|
|
||||||
const HEIGHT = 9;
|
const HEIGHT = 9;
|
||||||
const DENSE_TICKS = 100;
|
const DENSE_TICKS = 100;
|
||||||
|
|
||||||
@@ -20,9 +19,9 @@ export const StatScale = memo<StatScaleProps>(
|
|||||||
|
|
||||||
for (const other of values) {
|
for (const other of values) {
|
||||||
const raw = range === 0 ? 0.5 : (other - min) / range;
|
const raw = range === 0 ? 0.5 : (other - min) / range;
|
||||||
const x = Math.round((lowerIsBetter ? 1 - raw : raw) * RESOLUTION);
|
const x = lowerIsBetter ? 1 - raw : raw;
|
||||||
|
|
||||||
if (x === 0 || x === RESOLUTION) continue;
|
if (x === 0 || x === 1) continue;
|
||||||
|
|
||||||
counts.set(x, (counts.get(x) ?? 0) + 1);
|
counts.set(x, (counts.get(x) ?? 0) + 1);
|
||||||
}
|
}
|
||||||
@@ -58,7 +57,7 @@ export const StatScale = memo<StatScaleProps>(
|
|||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top: 0,
|
top: 0,
|
||||||
left: `${(x / RESOLUTION) * 100}%`,
|
left: `${x * 100}%`,
|
||||||
width: 1,
|
width: 1,
|
||||||
height: "100%",
|
height: "100%",
|
||||||
backgroundColor: color,
|
backgroundColor: color,
|
||||||
|
|||||||
Reference in new issue
Block a user