This commit is contained in:
parent
077bb6d73b
commit
173703664d
@ -17,14 +17,15 @@ type Props = {
|
|||||||
|
|
||||||
export default function LeaderboardPpChart({ leaderboard }: Props) {
|
export default function LeaderboardPpChart({ leaderboard }: Props) {
|
||||||
const [values, setValues] = useState([60, 100]);
|
const [values, setValues] = useState([60, 100]);
|
||||||
const debouncedMin = useDebounce(values[0], 100);
|
const debouncedValues = useDebounce(values, 100);
|
||||||
|
|
||||||
const histories: Record<string, (number | null)[]> = {};
|
const histories: Record<string, (number | null)[]> = {};
|
||||||
const labels: string[] = [];
|
const labels: string[] = [];
|
||||||
const min = debouncedMin;
|
|
||||||
const precision = min >= 60 ? 0.1 : 0.2;
|
|
||||||
|
|
||||||
for (let accuracy = min; accuracy <= 100; accuracy += precision) {
|
const min = debouncedValues[0];
|
||||||
|
const max = debouncedValues[1];
|
||||||
|
const precision = min >= 60 ? 0.1 : 0.2;
|
||||||
|
for (let accuracy = min; accuracy <= max; accuracy += precision) {
|
||||||
const label = accuracy.toFixed(2) + "%";
|
const label = accuracy.toFixed(2) + "%";
|
||||||
labels.push(label);
|
labels.push(label);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user