Skip to content

Curve readability: automatic styles by position, user styles kept, reset action - #454

Merged
PierreRaybaut merged 2 commits into
developfrom
feature/453-curve-readability
Oct 29, 2026
Merged

PierreRaybaut merged 2 commits into
developfrom
feature/453-curve-readability

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

Closes #453.

Depends on PlotPyStack/PlotPy#81 (cosmetic pen, merged into PlotPy develop) and DataLab-Platform/SigimaX#29 (palette, grid, automatic styles), which close PlotPyStack/PlotPy#80 and DataLab-Platform/SigimaX#28.

Changes

Style assignment by position

  • SignalPlotHandler.update_automatic_styles() runs at the end of each plot refresh.
  • It gives the visible curves the automatic style of their position, in the order of the signals in the panel.
  • Curves whose color or line style was chosen by the user are left unchanged, but still count as a position.

Global style cycle

  • Creating a plot item for the panel no longer uses the global style cycle (CURVESTYLES.suspend()).
  • Thanks to SigimaX, the ROI editor and View in a new window no longer shift it either.

Reset curve styles

  • View > Reset curve styles now removes the colors and line styles stored for the selected signals and gives their curves automatic styles again.
  • The action is enabled when at least one signal or group is selected.

Exports

  • datalab.adapters_plotpy now exports CurveStyles and LINE_STYLE_KEYS.

Documentation and translations

  • Updated View menu documentation (Reset curve styles) and settings documentation (line width on high-DPI screens).
  • Release notes for 1.4.0.
  • French translations (UI and documentation).

Before / after

With 15 noisy signals, light and dark themes:

  • the first 10 curves are drawn with solid lines and the next 5 with dashed lines;
  • no curve uses dotted styles anymore;
  • the grid is discreet.

Tests

  • New datalab/tests/features/signal/curve_styles_unit_test.py, covering:
    • styles following curve positions;
    • the style cycle not used by the panel and dialogs;
    • user-defined styles kept across a workspace round trip;
    • styles of earlier versions handled as automatic;
    • Reset curve styles.
  • Local runs:
    • datalab/tests/features/signal, features/common, features/hdf5 and backbone: 890 passed, 1 skipped;
    • features/image, features/plugins and features/control: 186 passed, 2 skipped.

- Visible curves are given the automatic style of their position among
  the curves shown, in the order of the signals in the panel; curves
  whose color or line style was chosen by the user keep it
- Creating plot items for the panel no longer uses the global style
  cycle, so that the first curves shown always get the first styles
- View > Reset curve styles now removes the colors and line styles
  stored for the selected signals, which get automatic styles again
- Export `CurveStyles` and `LINE_STYLE_KEYS` from datalab.adapters_plotpy
- Requires SigimaX changes of DataLab-Platform/SigimaX#28

Refs #453

Assisted-by: Claude Opus 5.5
- View menu: automatic curve styles by position, user styles, and the
  new behavior of Reset curve styles
- Settings: thin curves drawn one screen pixel wide on HiDPI screens
- Release notes 1.4.0: Curve readability
- French translations

Refs #453

Assisted-by: Claude Opus 5.5
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