Skip to content

Commit 2d03dec

Browse files
committed
fmt
1 parent 9ad6528 commit 2d03dec

File tree

3 files changed

+201
-197
lines changed

3 files changed

+201
-197
lines changed

src/components/plotter/LineChart.tsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { useRef, useEffect, useCallback } from 'react';
22
import uPlot from 'uplot';
33
import 'uplot/dist/uPlot.min.css';
4-
import { stateTimelinePlugin, calculateStateTimelineHeight, type StateRow } from './stateTimelinePlugin';
4+
import {
5+
stateTimelinePlugin,
6+
calculateStateTimelineHeight,
7+
type StateRow,
8+
} from './stateTimelinePlugin';
59
import './LineChart.css';
610

711
// Channel colors (16 max)
@@ -38,7 +42,12 @@ interface LineChartProps {
3842
// Re-export StateRow type for use by PlotterWindow
3943
export type { StateRow };
4044

41-
export default function LineChart({ data, isPaused = false, stateRows = [], onTimeRangeChange }: LineChartProps) {
45+
export default function LineChart({
46+
data,
47+
isPaused = false,
48+
stateRows = [],
49+
onTimeRangeChange,
50+
}: LineChartProps) {
4251
const containerRef = useRef<HTMLDivElement>(null);
4352
const chartRef = useRef<uPlot | null>(null);
4453
const channelsRef = useRef<string[]>([]);
@@ -265,14 +274,17 @@ export default function LineChart({ data, isPaused = false, stateRows = [], onTi
265274
},
266275
],
267276
},
268-
plugins: stateRows.length > 0 ? [
269-
stateTimelinePlugin({
270-
getRows: () => stateRowsRef.current,
271-
rowHeight: 24,
272-
rowGap: 2,
273-
showLabel: true,
274-
}),
275-
] : [],
277+
plugins:
278+
stateRows.length > 0
279+
? [
280+
stateTimelinePlugin({
281+
getRows: () => stateRowsRef.current,
282+
rowHeight: 24,
283+
rowGap: 2,
284+
showLabel: true,
285+
}),
286+
]
287+
: [],
276288
};
277289

278290
// Update stateRowsRef before chart creation (plugin uses this reference)

src/components/plotter/PlotterWindow.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,7 @@ export default function PlotterWindow() {
143143
<>
144144
{/* Line Chart (with integrated State Timeline) */}
145145
<div className="chart-area">
146-
<LineChart
147-
data={data!.line_data}
148-
isPaused={!isRunning}
149-
stateRows={stateRows}
150-
/>
146+
<LineChart data={data!.line_data} isPaused={!isRunning} stateRows={stateRows} />
151147
</div>
152148

153149
{/* Channel legend */}

0 commit comments

Comments
 (0)