Skip to content

feat(signals): non-time plot widget, multi-axis normalization, export modal#205

Open
jacobjurek wants to merge 1 commit into
mainfrom
jake/signals
Open

feat(signals): non-time plot widget, multi-axis normalization, export modal#205
jacobjurek wants to merge 1 commit into
mainfrom
jake/signals

Conversation

@jacobjurek

Copy link
Copy Markdown
Contributor

Summary

Three enhancements to the Signals page, built as independent workstreams.

1. Multi-axis normalization fix (QueryChart.tsx)

When traces span multiple axis groups, only the first group's y-axis was drawn. Now every group renders: group 1 on the left (pixel-identical for single-group queries), additional groups on the right with stepped offsets, each axis color-matched to its traces. The grid margin grows dynamically so labels never clip. The hidden normalized [0,1] axis and tooltip true-value recovery are unchanged.

2. Export modal (ExportDialog.tsx, export.ts, SignalWidget.tsx)

The two bare CSV/PNG icon-buttons are replaced by a single Export dialog offering:

  • PNG — background (light / dark / transparent) + scale (1x–4x) + filename
  • Data — CSV and JSON, with an include hidden traces toggle
  • Copy image to clipboard (with toast)

Export logic stays as pure functions in lib/export.ts.

3. Custom non-time plot widget (PlotWidget/PlotChart, lib/pairs.ts, backend /query/pairs)

A new plot widget sits alongside the time-series widget ("Add plot"), supporting:

  • XY scatter and connected-line/path (e.g. GPS lat vs lng track), with optional color-by
  • bar / pie of grouped aggregates (reuse existing /query/run)
  • 3D scatter (adds echarts-gl)

New POST /query/pairs endpoint returns timestamp-aligned paired samples via the query_signals() + merge_signals() (merge_asof) helpers. Response is the bare {columns, rows} body (gateway adds the {data:...} envelope).

Notes

  • This PR includes the previously-untracked backend helpers query/query/service/query.py and query/query/model/query.py because the new /query/pairs route imports them; and SignalTree.tsx, used by PlotWidget.
  • echarts-gl registered via its tree-shakeable install modules (its ESM entrypoints are broken upstream); ambient types in echarts-gl.d.ts.

Verification

  • Dashboard tsc --noEmit clean; npm run build succeeds.
  • Backend route verified end-to-end: POST /query/pairs → 200 with {columns, rows} real merge-aligned ClickHouse data, reachable through the kerbecs gateway.
  • Full Docker stack rebuilt and confirmed: all 11 containers running, dashboard serving, echarts-gl present in the container.

🤖 Generated with Claude Code

… modal

Three enhancements to the Signals page:

- Multi-axis normalization: every axis group now renders. Group 1 stays on the
  left (unchanged for single-group queries); additional groups render on the
  right with stepped offsets, color-matched to their traces, and the grid margin
  grows so labels never clip.

- Export modal: replaces the two bare CSV/PNG icon-buttons with an Export dialog
  offering PNG (light/dark/transparent background + 1x-4x scale), CSV + JSON data
  (with include-hidden toggle), and copy-image-to-clipboard. Export helpers stay
  pure in lib/export.ts.

- Custom plot widget: a new non-time PlotWidget alongside the time-series widget
  ("Add plot") supporting XY scatter, connected-line/path (GPS lat-lng), bar,
  pie, and 3D scatter (echarts-gl). New POST /query/pairs endpoint returns
  timestamp-aligned paired samples (merge_asof) via the query_signals/
  merge_signals helpers; bar/pie reuse the existing /query/run aggregation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jacobjurek jacobjurek requested a review from BK1031 June 16, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant