Skip to content

Live 1D Data Plotting (Motor vs. Detector) #392

Open

Description

@Relm-Arrowny

Part of #373 Live Data & Image Plotting

Live 1d plotting on UI showing live scan.

Currently avaiable: Non-web base ui: #406

Goals

Acceptance criteria : What journeys should the user be able to complete to consider your feature done
Be as specific as you can, check them off once they work. Add more if you find more requirements during development. Issue should only be considered done after all of them are checked

  • Real-Time 1D Streaming (PUSH From Blueapi): The UI dynamically streams and renders 1D line/scatter graphs of detector scalar readbacks (e.g., photodiodes, counters, integrated intensities) against device/motor positions as BlueSky line scans execute .
  • Flexible Axis & Channel Selection: Users can select any recorded independent variable (motors) for the X-axis and any detectors/device for the Y-axis on the fly, with single-click axis swapping.
  • Multi-Channel Overlay & Dual Y-Axis: Supports selecting and rendering multiple Y-detector channels simultaneously, with dual Y-axis (left vs. right scale) for channels with different physical units or intensity ranges.
  • Historical Comparison (Overlay vs. Replace): Users can query past scans via Tiled and overlay historical 1D curves onto active live scans for direct comparison, or switch to single-run inspection mode.
  • Interactive Plot Controls: Supports auto-scaling, zoom/pan bounds, hover displaying exact coordinates/counts, and basic peak identification markers.

Tasks

base on the goals, deduce the tasks required. check them off once they're done

  • WebSocket Data Ingestion: Integrate the BlueAPI WebSocket client (BlueAPI -> WebSockets -> UI) to listen to live 1D scan event documents.
  • Buffer: Buffer to store the incoming point streams without UI lag.
  • Channel & Axis Selector Panel: Build dropdown controls for selecting X and Y variables, multi-select checkboxes for Y channels..
  • Dual Y-Axis Toggle: Implement dual Y-axis scaling logic for multi-channel overlays with differing dynamic ranges or physical units.
  • 1D Chart Component Integration: Integrate a lightweight, 1D line/scatter chart component (e.g., Davidia 1D or Canvas 2D) supporting dynamic dataset.
  • Scatter / Point Mode: Add rendering toggles to switch between continuous line plots and scatter for adaptive-step scans.
  • Tiled Data Fetcher: Implement a client to query Tiled scan data to pull historical run datasets.
  • Overlay: Build overlay to render old data as secondary lines alongside active live scan data.

Related Resources

BlueAPI Websockets: websockets.
With web socket client, we should be able to get data push into out UI and proved live Live STXM / 1D Scan Updates.
Davidia: It seem to provides us all the 1d plot needs, the question will be are we going inbed the service in the UI service or have a davida Plot running in an other service.
Possible data flow.

flowchart LR
   subgraph Live Stream - PUSH
       blueAPI[blueAPI / RE] -->|Python API| DavidiaServer[Davidia Plot Server]
       DavidiaServer -->|WebSockets PUSH| UI["React Web UI - DavidiaPlotComponent"]
   end

   subgraph Historical Overlay - PULL
       Tiled[Tiled Data API] -->|REST API PULL| UI
   end



Loading

Additional context

Activity

  1. NatLeung96 commented on Sep 15, 2026

    @NatLeung96
    Collaborator

    I have a branch on atlas, nl/add-visualiser-to-p99, which can query Tiled and plot motor position data v point, but it does not plot live data.

  2. Relm-Arrowny commented on Sep 15, 2026

    @Relm-Arrowny
    CollaboratorAuthor

    I have a branch on atlas, nl/add-visualiser-to-p99, which can query and plot motor position data v point, but it does not plot live data.

    BlueAPI Websockets will push the data back at you so we could fish it there, I think.

  3. DanPorter commented on Sep 15, 2026

    @DanPorter
    Collaborator

    This epic broadly overlaps with milestones 1 and 2 of Victoria's data visulization milestones:
    https://dlsltd-my.sharepoint.com/:w:/g/personal/victoria_beilsten-edmands_diamond_ac_uk/IQBDH1mgJk5WToh-4uYn26ySAfq2R3IHNjqxCH35PgBgqZU?e=hlh8uL

    Davidia has a plot-server capability but from what I recall you push numeric arrays to it, so we would still need to get the data from somewhere

  4. NKatti2011 commented on Sep 16, 2026

    @NKatti2011
    Collaborator

    Below include notes from meeting with @EmsArnold.

    Transport

    • Likely options are Davidia directly, or Tiled websockets consumed through Davidia.
      Bluesky websockets may become available in future but we should not plan around them (probably shouldnt use them).
    • Preference is to treat Davidia (or an equivalent) as an abstraction layer over
      whichever websocket we end up on
      (BlueAPI or Tiled).

    Axis handling

    • We want stacked multiple y-axes, in the style of CS-Studio.
    • The y-axis picker should offer every device on the beamline: Bluesky treats
      everything as a device, so there is no meaningful distinction to filter on.

    Action

  5. Relm-Arrowny commented on Nov 2, 2026

    @Relm-Arrowny
    CollaboratorAuthor

    This is now available as client side application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions