Skip to content

Beginning of the plotting refactor integration. - #4151

Open
jamescrake-merani wants to merge 130 commits into
refactor_24from
refactor24-plot-manager
Open

jamescrake-merani wants to merge 130 commits into
refactor_24from
refactor24-plot-manager

Conversation

@jamescrake-merani

Copy link
Copy Markdown
Contributor

Description

This PR has started the work for integrating the plotting refactor into the refactoring project. In this branch, it is now possible to load in data, and plot it data straight to the MDIArea on the new refactored data explorer. There is still lots more to do, but this current stage is ready for review.

Progress made in this PR:

  • 1D data can be plotted
  • These plots are added to the data manager, and can be interacted with on the data explorer like any other tracked item.
  • Modifiers can be added by right clicking the plot in the data explorer, and adding them.

Progress still to be made:

  • Fits, and other subplots aren't currently supported. My plan is to be complete this work alongside the integration of the inversion perspective as discussed at the last fortnightly meeting.
  • The plots don't interact with any perspectives.

Known issues (that will probably be fixed in a different branch)

  • Deleting a plot also deletes the data. This is a pre-existing issue in (Deleting trends, and perspectives should not cascade to deleting the data in them #4106).
  • The colour modifier doesn't do anything. I'm not actually sure what the original behaviour was supposed to be.
  • The dialog I made for creating modifiers is quite restrictive. For example, there's only a few selection of colours. It might be better to implement a colour picker for that purpose.

Please note that this branch contains a lot of work from Julius, but I have only modified 'SubTabs.py`

Fixes #4113

How Has This Been Tested?

This has been tested both on Windows, and Linux. Feel free to follow the below steps:

  • Load in some 1D data into the data explorer
  • Right click on that data, and click 'Plot'. Alternatively, you can select that data, and click the 'Plot' button at the bottom of the explorer
  • You show now see a plot of the data
  • You can add a modifier to the plot by right clicking it on the data explorer, and clicking 'add modifier'
  • You should see a dialog box with the different modifiers you can add.

Review Checklist:

[if using the editor, use [x] in place of [ ] to check a box]

Documentation (check at least one)

Installers

  • There is a chance this will affect the installers, if so
    • Windows installer (GH artifact) has been tested (installed and worked)
    • MacOSX installer (GH artifact) has been tested (installed and worked)
    • Wheels installer (GH artifact) has been tested (installed and worked)

Licensing (untick if necessary)

  • The introduced changes comply with SasView license (BSD 3-Clause)

@jamescrake-merani jamescrake-merani added the Big Refactoring Project Refactoring project. These live in the sasview repo to have them all in the same place. label Oct 2, 2026
codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@jamescrake-merani
jamescrake-merani added this pull request to stack #4167 October 23, 2026 13:37
codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

…t has to be modified afterwards beyond the if statements, because 2d plotting is different from 1d plotting, as a 2d plot cannot show multiple curves, cannot accept linestyles
… accept the modifier or the data will indicate a drop action
…ots are presented on the side. side plots are clickable for exchanging position and scaling with the big one.
… for-loops in favor of for-each loops and other styling stuff
…_fitpage_by_id, respectively, to avoid confusion
…p creation of the main window in a designated main method instead.
jamescrake-merani and others added 28 commits October 26, 2026 11:35
As the options available does not depend on a particular instance of one
of these classes.
Imo it makes sense for the plot modifier to be under the plot, not vice versa.
Hopefully, when fits are integrated, it should mean that the second tab
will draw both plots. Although some extras might need to be implemented
for that to work.

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No quality gates enabled for this code.

See analysis details in CodeScene

Quality Gate Profile: Custom Configuration
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

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

Labels

Big Refactoring Project Refactoring project. These live in the sasview repo to have them all in the same place.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants