Points: starts on the Emulator source, its main use (Selector start)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f21fcebeae
commit
2be232b91d
3 files changed
+7
-6
No files matched your search
@@ -20,10 +20,11 @@ export async function call(path, method = "GET", body) {
|
||||
// The station and the range (UTC, To excluded; empty: the whole period), shared by the pages through the address. Source:
|
||||
// Cloud, the stations of data/; Emulator, the runs of data_diff/, <SERIAL>@<run> for the server
|
||||
const SOURCES = [{ value: "cloud", label: "Cloud" }, { value: "emulator", label: "Emulator" }];
|
||||
const sourceOf = station => (station || "").includes("@") ? "emulator" : "cloud";
|
||||
// without a station, the page's own default (Points: the emulator, its main use)
|
||||
const sourceOf = (station, start = "cloud") => !station ? start : station.includes("@") ? "emulator" : "cloud";
|
||||
|
||||
export function Selector({ selection, choose }) {
|
||||
const [stations, setStations] = useState([]), [s, setS] = useState(selection), [source, setSource] = useState(sourceOf(selection.station));
|
||||
export function Selector({ selection, choose, start = "cloud" }) {
|
||||
const [stations, setStations] = useState([]), [s, setS] = useState(selection), [source, setSource] = useState(sourceOf(selection.station, start));
|
||||
useEffect(() => { call("/api/stations").then(l => l && setStations(l)); }, []);
|
||||
useEffect(() => { setS(selection); if (selection.station) setSource(sourceOf(selection.station)); }, [selection]); // a new object at each change of the address
|
||||
const [serial, run] = (s.station || "").split("@");
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Badge, Button, Card, Group, Loader, SegmentedControl, Select, Stack, Te
|
||||
import { call, Selector } from "../common.jsx";
|
||||
|
||||
// Points: the point labels (labeling/points/, labeling/scripts/points.py), one boolean per measurement of a range, valid or
|
||||
// not, set by hand: the ground truth of the benchmarks. A dataset per station and range, created with every point valid;
|
||||
// not, set by hand: the ground truth of the benchmarks. Mainly on the runs of the emulator: the page starts on that source. A dataset per station and range, created with every point valid;
|
||||
// one target at a time, corr_x above corr_y; a click on a point switches it, a box sets every point inside it (mode).
|
||||
// Each change is saved at once.
|
||||
const VALID = "#2a78d6", INVALID = "#e03131";
|
||||
@@ -43,7 +43,7 @@ export default function Points({ selection, choose }) {
|
||||
<Text c="dimmed">Each measurement of a range, valid or not, set by hand: the ground truth of the benchmarks
|
||||
(labeling/points/). A click on a point switches it; a box sets every point inside it.</Text>
|
||||
</div>
|
||||
<Selector selection={selection} choose={choose} />
|
||||
<Selector selection={selection} choose={choose} start="emulator" />
|
||||
{list.length > 0 && <Group gap="xs">
|
||||
<Text size="sm" c="dimmed">Datasets of {station}:</Text>
|
||||
{list.map(x => <Button key={x.name} size="compact-sm" variant={x.name === name ? "filled" : "light"}
|
||||
|
||||
Reference in new issue
Block a user