Skip to content

feat(plot): improve topic auto-detect, TF support, and chart UX.#15

Merged
joaner merged 1 commit into
ioai-tech:mainfrom
joaner:feat/plot-panel-ux-topic-detection
Jun 6, 2026
Merged

feat(plot): improve topic auto-detect, TF support, and chart UX.#15
joaner merged 1 commit into
ioai-tech:mainfrom
joaner:feat/plot-panel-ux-topic-detection

Conversation

@joaner
Copy link
Copy Markdown
Contributor

@joaner joaner commented Jun 6, 2026

Make Plot easier to use for multi-type ROS data by fixing path detection, supporting TFMessage, and adding zoom, reset, and inline legend controls.

Description

This PR upgrades the Plot panel for multi-type ROS data and better in-chart interaction:

  • Topic auto-detect & path selection
    • Fix incorrect jointStateFields overriding non-JointState topics (e.g. PoseStamped no longer defaults to position[:])
    • Add generic numeric field discovery (fieldDiscovery.ts) and a topic field tree in settings
    • Merge multiple recommended scalar paths in plotTopicService (comma-separated defaults)
  • TFMessage support
    • Register tf2_msgs/TFMessage with a dedicated adapter
    • Resolve transforms[:].transform.translation.x/y/z with stable keys/labels via child_frame_id
    • Keep TF defaults lower priority so they don’t override JointState and similar topics
  • Chart interaction
    • Mouse wheel zoom: default X; Shift → Y; Ctrl/Meta → X+Y
    • Drag pan: default X; modifier keys for Y / XY
    • Per-axis manual viewport state with resetViewport API
    • Show “Reset zoom” only when the viewport is manually adjusted; double-click also resets
  • Inline chart legend
    • New PlotChartLegend overlay (top-left, collapsed by default)
    • Collapsed: up to 1 entry, semi-transparent until hover/focus
    • Expanded: search, show/hide all, Only, scrollable full list
    • Fixed width (w-80) to avoid layout jump; collapsed view prefers currently visible series after Only
  • Tests & i18n
    • Add/update Plot unit tests (topic service, field discovery, legend, viewport, TF paths, etc.)
    • Update en / zh / ja panels.json strings for reset zoom, legend, and topic fields

Motivation / related issue

Plot previously struggled with non-JointState message types, showed blank charts for /tf (TFMessage), and lacked Foxglove-like zoom/pan/reset and an in-chart legend. This change makes common ROS workflows work out of the box and
improves day-to-day chart usability.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing behavior to change)
  • Documentation update
  • Refactor / internal cleanup (no behavior change)

Checklist

  • npm run lint passes with no errors
  • npm test passes (unit tests; Plot suite ~140 cases)
  • npm run build and npm run build:lib succeed
  • New behavior is covered by tests (or explain why tests aren't applicable)
  • Documentation updated (README, API.md, EMBEDDING.md) if the public API changed
  • Breaking change: all affected call sites updated and migration path described in PR description

API compatibility

N/A — changes are confined to the Plot panel and related i18n strings; no exported public API changes.

Screenshots / recordings

Recommended before merge:

  • Plot with PoseStamped / JointState auto-detected paths
  • /tf showing per-child_frame_id translation series
  • Zoom/pan + “Reset zoom” overlay
  • Collapsed vs expanded inline legend, including Only behavior

Make Plot easier to use for multi-type ROS data by fixing path detection, supporting TFMessage, and adding zoom, reset, and inline legend controls.
@joaner joaner merged commit f41401c into ioai-tech:main Jun 6, 2026
2 checks passed
@joaner joaner mentioned this pull request Jun 6, 2026
11 tasks
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