Skip to content

Commit 2bdf87f

Browse files
committed
fix bug where original domain would not reset on variable change, breaking reset behaviour
1 parent 430c88a commit 2bdf87f

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

apps/class-solid/src/components/Analysis.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export function TimeSeriesPlot({ analysis }: { analysis: TimeseriesAnalysis }) {
193193

194194
// Define axis format
195195
const formatters: Record<string, (value: number) => string> = {
196-
t: formatSeconds,
196+
t: d3.format(".0f"),
197197
utcTime: formatUTC,
198198
default: d3.format(".4"),
199199
};

apps/class-solid/src/components/plots/Axes.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ type AxisProps = {
1313
export const AxisBottom = (props: AxisProps) => {
1414
const [chart, updateChart] = useChartContext();
1515

16-
// Store original domain on first render
17-
props.domain && updateChart("originalDomainX", props.domain());
18-
1916
// Update scale props when domain or type changes
2017
createEffect(() => {
18+
props.domain && updateChart("originalDomainX", props.domain());
2119
props.domain && updateChart("scalePropsX", { domain: props.domain() });
2220
props.type && updateChart("scalePropsX", { type: props.type });
2321
});
@@ -46,11 +44,9 @@ export const AxisBottom = (props: AxisProps) => {
4644
export const AxisLeft = (props: AxisProps) => {
4745
const [chart, updateChart] = useChartContext();
4846

49-
// Store original domain on first render
50-
props.domain && updateChart("originalDomainY", props.domain());
51-
5247
// Update scale props when domain or type changes
5348
createEffect(() => {
49+
props.domain && updateChart("originalDomainY", props.domain());
5450
props.domain && updateChart("scalePropsY", { domain: props.domain() });
5551
props.type && updateChart("scalePropsY", { type: props.type });
5652
});

0 commit comments

Comments
 (0)