feat : add click on engine lines

This commit is contained in:
GuillaumeSD
2025-05-11 18:21:45 +02:00
parent 74a2adbb7d
commit 6535fce2f4
22 changed files with 285 additions and 156 deletions

View File

@@ -1,6 +1,6 @@
import { DotProps } from "recharts";
import { ChartItemData } from "./types";
import { moveClassificationColors } from "@/lib/chess";
import { CLASSIFICATION_COLORS } from "@/constants";
export default function CustomDot({
cx,
@@ -9,7 +9,7 @@ export default function CustomDot({
payload,
}: DotProps & { payload?: ChartItemData }) {
const moveColor = payload?.moveClassification
? moveClassificationColors[payload.moveClassification]
? CLASSIFICATION_COLORS[payload.moveClassification]
: "grey";
return (

View File

@@ -21,7 +21,7 @@ import type { ReactElement } from "react";
import CustomTooltip from "./tooltip";
import { ChartItemData } from "./types";
import { PositionEval } from "@/types/eval";
import { moveClassificationColors } from "@/lib/chess";
import { CLASSIFICATION_COLORS } from "@/constants";
import CustomDot from "./dot";
import { MoveClassification } from "@/types/enums";
import { useChessActions } from "@/hooks/useChessActions";
@@ -51,7 +51,7 @@ export default function GraphTab(props: GridProps) {
}, [chartData]);
const boardMoveColor = currentPosition.eval?.moveClassification
? moveClassificationColors[currentPosition.eval.moveClassification]
? CLASSIFICATION_COLORS[currentPosition.eval.moveClassification]
: "grey";
// Render a dot only on selected classifications (always returns an element)