diff --git a/apps/class-solid/src/components/Analysis.tsx b/apps/class-solid/src/components/Analysis.tsx index 42aeff6..130b8e8 100644 --- a/apps/class-solid/src/components/Analysis.tsx +++ b/apps/class-solid/src/components/Analysis.tsx @@ -171,13 +171,12 @@ export function TimeSeriesPlot({ analysis }: { analysis: TimeseriesAnalysis }) { const [toggles, setToggles] = createStore>({}); // Initialize all lines as visible - createEffect(() => { - for (const d of chartData()) { - setToggles(d.label, true); - } - }); + for (const d of chartData()) { + setToggles(d.label, true); + } function toggleLine(label: string, value: boolean) { + console.log("toggleLine called"); setToggles(label, value); } @@ -334,11 +333,9 @@ export function VerticalProfilePlot({ const [toggles, setToggles] = createStore>({}); // Initialize all lines as visible - createEffect(() => { - for (const d of chartData()) { - setToggles(d.label, true); - } - }); + for (const d of chartData()) { + setToggles(d.label, true); + } function toggleLine(label: string, value: boolean) { setToggles(label, value); diff --git a/apps/class-solid/src/components/plots/skewTlogP.tsx b/apps/class-solid/src/components/plots/skewTlogP.tsx index 07210e0..757f57d 100644 --- a/apps/class-solid/src/components/plots/skewTlogP.tsx +++ b/apps/class-solid/src/components/plots/skewTlogP.tsx @@ -1,6 +1,6 @@ // Code modified from https://github.com/rsobash/d3-skewt/ (MIT license) import * as d3 from "d3"; -import { For, Show, createEffect, createSignal } from "solid-js"; +import { For, Show, createSignal } from "solid-js"; import { createStore } from "solid-js/store"; import { AxisBottom, AxisLeft } from "./Axes"; import type { ChartData, SupportedScaleTypes } from "./ChartContainer"; @@ -180,11 +180,9 @@ export function SkewTPlot(props: { props.data().filter((d) => !d.label.includes("- fire plume")); // Initialize all lines as visible - createEffect(() => { - for (const d of dataForLegend()) { - setToggles(d.label, true); - } - }); + for (const d of dataForLegend()) { + setToggles(d.label, true); + } function toggleLine(label: string, value: boolean) { setToggles(label, value);