Skip to content

Conversation

@abrahamwolk
Copy link
Collaborator

This pull request implements the setting of the blue border when Display Editor is focused directly using CSS instead of using an event handler to manually add and remove a style class.

The background for this pull request is that I am currently developing a new widget for Phoebus that displays a Waterfall Plot. When selecting an instance of the new Waterfall Plot Widget and then clicks on the background of the OPI (so that model_root is selected), the CPU usage goes constantly to over 100%. Through debugging, I have concluded that the cause is the event handler on model_root that adds and removes the CSS style class that sets the border of model_root in order to indicate that it is selected.

This pull request removes the event handler and replaces it with a CSS implementation of widget_pane:focused. I think this is an improvement over the implementation using an event handler, while it at the same time solves the performance issue I encounter.

… handler to manually add and remove a style class.
@kasemir
Copy link
Collaborator

kasemir commented Aug 6, 2025

Looks good!

@kasemir
Copy link
Collaborator

kasemir commented Aug 6, 2025

How complex is your waterfall plot widget? In the scene graph, is it one image, or is it a node tree with lines, labels, rectangles, ...?

@abrahamwolk
Copy link
Collaborator Author

How complex is your waterfall plot widget? In the scene graph, is it one image, or is it a node tree with lines, labels, rectangles, ...?

I think it's quite complex. It's based on the https://github.com/fair-acc/chart-fx/ library, which provides a waterfall plot. E.g., it contains axes, which contain labels, etc.

@jacomago
Copy link
Contributor

jacomago commented Aug 6, 2025

How complex is your waterfall plot widget? In the scene graph, is it one image, or is it a node tree with lines, labels, rectangles, ...?

I think it's quite complex. It's based on the https://github.com/fair-acc/chart-fx/ library, which provides a waterfall plot. E.g., it contains axes, which contain labels, etc.

Maybe it overlaps partially with #3462 ?

@abrahamwolk
Copy link
Collaborator Author

Maybe it overlaps partially with #3462 ?

No, it doesn't overlap.

@kasemir
Copy link
Collaborator

kasemir commented Aug 6, 2025

A complex the scene graph will always be less performant, which is why the key plots are just images within the scene graph. But that's a separate issue, this focus border handling update is a good idea since it lessens the pain of a large scene graph.

@kasemir
Copy link
Collaborator

kasemir commented Aug 6, 2025

As for overlap, you can of course open the two issues in separate web browser windows and then have them overlap, but I don't see how that's relevant. And the other issue having ".. overlap .." in the title shouldn't matter either.

Screenshot 2025-08-06 at 9 33 10 AM

@abrahamwolk abrahamwolk merged commit d6812f5 into master Aug 12, 2025
3 checks passed
@abrahamwolk abrahamwolk deleted the CSSTUDIO-3374 branch August 12, 2025 11:45
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.

5 participants