Skip to content

Commit 226d80b

Browse files
committed
simplify christmasTree logic
1 parent 59d5bad commit 226d80b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

ui/chart/src/acpl.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,10 @@ function christmasTree(chart: AcplChart, mainline: Tree.Node[], hoverColors: str
209209
acplDataset.pointHoverBackgroundColor = hoverColors;
210210
acplDataset.pointBorderColor = hoverColors;
211211
const points = mainline
212-
.map((node, i) =>
213-
node.glyphs?.some(glyph => glyph.symbol == symbol) && (node.ply & 1) == playerColorBit
214-
? { datasetIndex: 0, index: i - 1 }
215-
: { datasetIndex: 0, index: -1 },
212+
.filter(
213+
node => node.glyphs?.some(glyph => glyph.symbol == symbol) && (node.ply & 1) == playerColorBit,
216214
)
217-
.filter(i => i.index >= 0);
215+
.map(node => ({ datasetIndex: 0, index: node.ply - mainline[0].ply - 1 }));
218216
chart.setActiveElements(points);
219217
chart.update('none');
220218
}

ui/chart/src/lag.ts

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export async function initModule() {
6161
display: true,
6262
text: '',
6363
padding: { top: 100 },
64-
6564
},
6665
tooltip: {
6766
backgroundColor: tooltipBgColor,

0 commit comments

Comments
 (0)