Repository navigation
Description
Part #373 Live plotting:
Connect the Web plotting interface to the live scan event stream to display STXM data in real-time. This replaces the manual Jupyter Notebook and BlueSky plotting workaround here. Making it available in p99.diamond.ac.uk webUI.
Note
These will be stream data, e.g. (data that are small and ready available to the webUI.), These will be in the format of json/dictionary.
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
- Live Visual Population: The user can view the 2D STXM scan data populating the central canvas in real-time during an active acquisition
- Dynamic Plot Updating: The UI updates the scan grid continuously without requiring page refreshes or halting the client interface
Tasks
base on the goals, deduce the tasks required. check them off once they're done
Caution
Decision needed
- Blueapi CLI callback, RabbitMQ, title or NEXS file.
- Davidia Integration Evaluation: Assess if Davidia should be utilized as the core plotting library for streaming 2D arrays
- Data Ingestion: Connect the UI canvas component to a data brokers.
- Live Heatmap Rendering: Implement high-performance rendering logic to map incoming 2D spatial coordinates
$(x, y)$ and intensity values onto a dynamic heatmap grid.
Related Resources
any images/gifs, mockups/wireframes that would aid the development should be listed here
MockUp : link to mockup
Coda doc: link to coda
Additional context
Add any other context or screenshots about the feature request here.
Activity
[-]Implement live 2D STXM data streaming to display scanning updates in real time. (Mapping ?)[/-][+] Live 2D STXM Data Streaming[/+]DanPorter commentedon Sep 15, 2026
Am I right in thinking that each "pixel" on the STXM image will be the sum of a detector image?
So then the specific question is - where does that sum (or other processing) happen?
Tiled/ Nexus file etc will only provide the data array from the detector, but supposedly there will be another service from the data analysis platform team to perform small operations like this.
The other option is to have a BlueSky device that reads the last detector image and returns the sum, but I don't know if that is possible.
Relm-Arrowny commentedon Sep 15, 2026
Image statistic can be made to be emitted per point, as EPIC can provides them directly (NDPluginStats). Not 100% if we can do the same if we are hardware triggering. Epic is probably the best place to do it, as the data is already in buffer as it need to do the file writing anyway, so there should not be any I/O issue.
I would definitely not do it in Bluesky, you are pushing the image data to bluesky which will generate a very high demand on the network and the bluesky memory/cpu.
DanPorter commentedon Sep 16, 2026
OK great, Getting the data directly the the image statistics from the detector device in EPICS sounds like the best way to go then.
Whilst we are waiting on the decision of where detector data will come from, we should still be able to create this component with a mock API call and ensure we tell the core team how we are expecting the call to look.
NKatti2011 commentedon Sep 16, 2026
Below contains notes from meeting with @EmsArnold and others.
Rendering
it has not yet been assessed specifically for plotting scan data or for layers, so
those should be included in the evaluation before we commit.
Where the data comes from
The available path depends on how the plan is set up:
So whether something like an intensity value is available at all depends on the plan and
on how much processing is needed before it can be displayed. Recommendation: all data
comes through Tiled as the single point of truth (see #389), rather than the UI picking
a different transport per data type.
Maths and reshaping
there. It belongs in the standalone transformation package described in Reference Frame Coordinate Transformations #379, sitting
alongside or just below the Davidia server, the exact placement still needs a decision.
Tiled transport
to. Websockets have recently been made available on tiled-staging, which should remove
that problem: