Fix parameter-plot style picker: Apply button, wider layout, real style resolution
The marker style popover was too narrow (210px against a ~240px swatch row), had no explicit commit action, and its edits never reached the traces: parameterOverlayEntries yields entries with a field while the overlay builder read entry.dataSetKey, so the style-registry lookup used an undefined key and silently dropped every recorded style. Entries now carry dataSetKey too and the builder tolerates both shapes. The popover widens to 288px, lays Symbol/Size side by side with a full-width Opacity row, and stages edits until an explicit Apply (plus Close and Reset). Regression tests cover the key/dataSetKey path and the parameters-plots docs + CHANGELOG describe the Apply button. Also point package.json repository/issues/homepage at the renamed muSRFlow repository.
This commit is contained in:
1 parent
03e875160e
commit
d58f45c33d
10 files changed
+116
-35
No files matched your search
+10
-4
@@ -8,10 +8,13 @@ release path documented in [`TODO.md`](TODO.md).
|
||||
### Interactive parameter plots
|
||||
- Clicking a plotted marker in the parameter-plot window now opens a style
|
||||
editor at the pointer: colour, marker symbol, size, and opacity, applied
|
||||
either to the clicked (data set, parameter) trace or to the whole data set
|
||||
across every panel. Trace-level edits survive panel re-layouts; data-set
|
||||
edits are shared by all panels showing that file. `Esc`/`Q` closes the
|
||||
popover.
|
||||
with an explicit **Apply** button either to the clicked (data set,
|
||||
parameter) trace or to the whole data set across every panel. Trace-level
|
||||
edits survive panel re-layouts; data-set edits are shared by all panels
|
||||
showing that file. `Esc`/`Q` or **Close** dismisses the editor.
|
||||
- Parameter-plot style edits now reach the traces: overlay entries carry the
|
||||
same identity the style registry keys on, so a recorded colour/symbol/size/
|
||||
opacity is redrawn on exactly the intended panel or data set.
|
||||
- Parameter-plot panels can overlay several `*.dat` files at once: "Add
|
||||
file..." in **Plot options > Overlay data sets** opens a native multi-file
|
||||
dialog (Electron) or the browser multi-file picker (web). Files are
|
||||
@@ -33,6 +36,9 @@ release path documented in [`TODO.md`](TODO.md).
|
||||
`__MUSRFLOW_VERSION__` token that renders as "development build").
|
||||
- Generated MSRs no longer credit the legacy `musrfit-gui` repository; the
|
||||
header now names muSRFlow, the author, the licence, and the muSRFlow site.
|
||||
- `package.json` metadata and the bundled help no longer point at the old
|
||||
`musrfit-gui` project: the repository, issues, and homepage URLs moved to
|
||||
the `muSRFlow` repository.
|
||||
|
||||
## [1.0.0-rc.1] - 2026-09-10
|
||||
|
||||
|
||||
@@ -2895,8 +2895,8 @@ body.electron-parameter-plot-page {
|
||||
.parameter-style-popover {
|
||||
position: fixed;
|
||||
z-index: 1200;
|
||||
width: 210px;
|
||||
padding: 0.6rem 0.7rem;
|
||||
width: 288px;
|
||||
padding: 0.7rem 0.8rem;
|
||||
background: #fff;
|
||||
border: 1px solid var(--mu-border);
|
||||
border-radius: 4px;
|
||||
@@ -2947,23 +2947,37 @@ body.electron-parameter-plot-page {
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
.parameter-style-controls {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.4rem 0.8rem;
|
||||
margin: 0.5rem 0 0.6rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.parameter-style-control {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
margin: 0.3rem 0;
|
||||
gap: 0.35rem;
|
||||
font-size: 0.85rem;
|
||||
white-space: nowrap;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.parameter-style-control select,
|
||||
.parameter-style-control input[type="number"] {
|
||||
margin-left: auto;
|
||||
width: 9.5rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.parameter-style-control input[type="range"] {
|
||||
margin-left: auto;
|
||||
width: 10.5rem;
|
||||
.parameter-style-opacity {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.parameter-style-opacity input[type="range"] {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.parameter-style-opacity-value {
|
||||
@@ -2975,11 +2989,20 @@ body.electron-parameter-plot-page {
|
||||
.parameter-style-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 0.5rem;
|
||||
gap: 0.45rem;
|
||||
margin-top: 0.35rem;
|
||||
}
|
||||
|
||||
.parameter-style-actions button {
|
||||
font-size: 0.8rem;
|
||||
padding: 0.18rem 0.7rem;
|
||||
}
|
||||
|
||||
.parameter-style-actions .parameter-style-apply {
|
||||
background: var(--mu-green);
|
||||
color: #fff;
|
||||
border-color: var(--mu-green);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Rarely changed initialisation policy belongs with other application preferences. */
|
||||
|
||||
@@ -138,6 +138,8 @@ the pointer:
|
||||
(file, parameter) series only, or to every trace of that data set (all
|
||||
panels showing it);
|
||||
* colour swatches, marker **symbol**, **size**, and **opacity**;
|
||||
* **Apply** -- commit the staged choices and redraw the affected panels;
|
||||
**Close** hides the editor, and ESC (or ``Q``) dismisses it;
|
||||
* **Reset** -- restore the file's default colouring for that scope.
|
||||
|
||||
Trace-level edits are keyed by (data set, panel, parameter), so they survive
|
||||
|
||||
+2
@@ -230,6 +230,8 @@ the pointer:</p>
|
||||
(file, parameter) series only, or to every trace of that data set (all
|
||||
panels showing it);</p></li>
|
||||
<li><p>colour swatches, marker <strong>symbol</strong>, <strong>size</strong>, and <strong>opacity</strong>;</p></li>
|
||||
<li><p><strong>Apply</strong> – commit the staged choices and redraw the affected panels;
|
||||
<strong>Close</strong> hides the editor, and ESC (or <code class="docutils literal notranslate"><span class="pre">Q</span></code>) dismisses it;</p></li>
|
||||
<li><p><strong>Reset</strong> – restore the file’s default colouring for that scope.</p></li>
|
||||
</ul>
|
||||
<p>Trace-level edits are keyed by (data set, panel, parameter), so they survive
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
Search.setIndex({"alltitles":{"A first fit":[[7,"a-first-fit"]],"Command log":[[11,"command-log"]],"Configuration sharing":[[0,null]],"Constraints":[[1,null],[1,"id1"]],"Contents":[[4,null]],"Custom parameters":[[1,"custom-parameters"]],"Desktop installation":[[2,"desktop-installation"]],"Editing trace styles":[[8,"editing-trace-styles"]],"Example: couple the magnetic field to the Larmor frequency":[[1,"example-couple-the-magnetic-field-to-the-larmor-frequency"]],"Execution details":[[11,"execution-details"]],"File handling":[[6,"file-handling"]],"Fit and Plot":[[12,"fit-and-plot"]],"Fit model":[[12,"fit-model"]],"Fit options":[[12,"fit-options"]],"Fit or plot will not start":[[14,"fit-or-plot-will-not-start"]],"Fit range":[[12,"fit-range"]],"Fitted parameters look wrong or unchanged":[[14,"fitted-parameters-look-wrong-or-unchanged"]],"General notes":[[5,"general-notes"]],"Getting started":[[2,null]],"Glossary":[[3,null]],"Keyboard shortcuts":[[5,null],[8,"keyboard-shortcuts"]],"MSR editor":[[5,"msr-editor"],[6,null]],"Notes":[[0,"notes"]],"On the desktop":[[0,"on-the-desktop"]],"On the web":[[0,"on-the-web"]],"Opening the web edition":[[2,"opening-the-web-edition"]],"Outcome dialog":[[11,"outcome-dialog"]],"Overlay data sets (multiple files in one panel)":[[8,"overlay-data-sets-multiple-files-in-one-panel"]],"Overview":[[7,null]],"Ownership: GUI or editor":[[6,"ownership-gui-or-editor"]],"Parameter plot hangs on \u201cPreparing plot files\u201d":[[14,"parameter-plot-hangs-on-preparing-plot-files"]],"Parameter plot is empty or missing data":[[14,"parameter-plot-is-empty-or-missing-data"]],"Parameter selection (Parameters tab)":[[5,"parameter-selection-parameters-tab"]],"Parameter-plot window":[[5,"parameter-plot-window"]],"Parameters and parameter plots":[[8,null]],"Per-run statistics":[[12,"per-run-statistics"]],"Plot options":[[8,"plot-options"]],"Preferences":[[10,null]],"Prerequisites":[[2,"prerequisites"]],"Preview":[[1,"preview"]],"Reporting problems":[[14,"reporting-problems"]],"Restored configuration differs from the original machine":[[14,"restored-configuration-differs-from-the-original-machine"]],"Result files":[[11,"result-files"]],"Results and diagnostics":[[11,null]],"Run log window":[[11,"run-log-window"]],"Run selection":[[12,"run-selection"]],"Running the desktop app":[[2,"running-the-desktop-app"]],"Runs and fitting":[[12,null]],"Selecting parameters for plotting":[[8,"selecting-parameters-for-plotting"]],"Series fit actions":[[12,"series-fit-actions"]],"Some links start with a different prefix":[[14,"some-links-start-with-a-different-prefix"]],"Support":[[2,"support"]],"Template and series presets":[[8,"template-and-series-presets"]],"The Choose X axis dialog":[[8,"the-choose-x-axis-dialog"]],"The Quick Start guide":[[2,"the-quick-start-guide"]],"The Shared column":[[8,"the-shared-column"]],"The parameter table":[[8,"the-parameter-table"]],"The parameter-plot window":[[8,"the-parameter-plot-window"]],"The status bar":[[11,"the-status-bar"]],"Troubleshooting":[[14,null]],"Two editions":[[7,"two-editions"]],"Under the hood":[[7,"under-the-hood"]],"View settings":[[12,"view-settings"]],"Web and desktop editions":[[9,null]],"Web page cannot load data":[[14,"web-page-cannot-load-data"]],"What is shared":[[0,"what-is-shared"]],"What you get":[[7,"what-you-get"]],"Workflow":[[6,"workflow"]],"muSRFlow User Manual":[[4,null]],"t0 / background":[[13,null]],"\u201cNothing to fit\u201d":[[14,"nothing-to-fit"]]},"docnames":["configuration-sharing","constraints","getting-started","glossary","index","keyboard-shortcuts","msr-editor","overview","parameters-plots","platforms","preferences","results-diagnostics","runs-fitting","t0-background","troubleshooting"],"envversion":{"sphinx":65,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2},"filenames":["configuration-sharing.rst","constraints.rst","getting-started.rst","glossary.rst","index.rst","keyboard-shortcuts.rst","msr-editor.rst","overview.rst","parameters-plots.rst","platforms.rst","preferences.rst","results-diagnostics.rst","runs-fitting.rst","t0-background.rst","troubleshooting.rst"],"indexentries":{},"objects":{},"objnames":{},"objtypes":{},"terms":{"":[3,5,6,8,10,12,14],"0":12,"01":12,"012":11,"1":[8,11,12],"100":12,"12":12,"16":12,"1998":12,"2":[8,12],"24":12,"3":8,"5":12,"514":[3,12],"515":[3,12],"516":12,"520":12,"525":12,"540":12,"7":12,"8":12,"A":[0,1,3,4,10,11,12,14],"For":[2,6,8,11,12],"If":[4,8,11,12,14],"In":[5,7,8,14],"It":[0,1,4,6,7,11],"Its":[5,7],"On":[2,3,4,6,7,9,11,12,14],"One":[3,12],"The":[0,1,3,4,5,6,7,9,10,12,13,14],"Then":8,"There":2,"These":4,"To":[1,12],"With":[5,8],"_asi":10,"_singlehist":10,"abov":8,"abragamco":12,"accept":14,"access":9,"accumul":12,"across":[7,8],"action":[3,4,5,7,8,10,11,14],"activ":[2,5,6,7,8,14],"actor":Line truncated
|
||||
Search.setIndex({"alltitles":{"A first fit":[[7,"a-first-fit"]],"Command log":[[11,"command-log"]],"Configuration sharing":[[0,null]],"Constraints":[[1,null],[1,"id1"]],"Contents":[[4,null]],"Custom parameters":[[1,"custom-parameters"]],"Desktop installation":[[2,"desktop-installation"]],"Editing trace styles":[[8,"editing-trace-styles"]],"Example: couple the magnetic field to the Larmor frequency":[[1,"example-couple-the-magnetic-field-to-the-larmor-frequency"]],"Execution details":[[11,"execution-details"]],"File handling":[[6,"file-handling"]],"Fit and Plot":[[12,"fit-and-plot"]],"Fit model":[[12,"fit-model"]],"Fit options":[[12,"fit-options"]],"Fit or plot will not start":[[14,"fit-or-plot-will-not-start"]],"Fit range":[[12,"fit-range"]],"Fitted parameters look wrong or unchanged":[[14,"fitted-parameters-look-wrong-or-unchanged"]],"General notes":[[5,"general-notes"]],"Getting started":[[2,null]],"Glossary":[[3,null]],"Keyboard shortcuts":[[5,null],[8,"keyboard-shortcuts"]],"MSR editor":[[5,"msr-editor"],[6,null]],"Notes":[[0,"notes"]],"On the desktop":[[0,"on-the-desktop"]],"On the web":[[0,"on-the-web"]],"Opening the web edition":[[2,"opening-the-web-edition"]],"Outcome dialog":[[11,"outcome-dialog"]],"Overlay data sets (multiple files in one panel)":[[8,"overlay-data-sets-multiple-files-in-one-panel"]],"Overview":[[7,null]],"Ownership: GUI or editor":[[6,"ownership-gui-or-editor"]],"Parameter plot hangs on \u201cPreparing plot files\u201d":[[14,"parameter-plot-hangs-on-preparing-plot-files"]],"Parameter plot is empty or missing data":[[14,"parameter-plot-is-empty-or-missing-data"]],"Parameter selection (Parameters tab)":[[5,"parameter-selection-parameters-tab"]],"Parameter-plot window":[[5,"parameter-plot-window"]],"Parameters and parameter plots":[[8,null]],"Per-run statistics":[[12,"per-run-statistics"]],"Plot options":[[8,"plot-options"]],"Preferences":[[10,null]],"Prerequisites":[[2,"prerequisites"]],"Preview":[[1,"preview"]],"Reporting problems":[[14,"reporting-problems"]],"Restored configuration differs from the original machine":[[14,"restored-configuration-differs-from-the-original-machine"]],"Result files":[[11,"result-files"]],"Results and diagnostics":[[11,null]],"Run log window":[[11,"run-log-window"]],"Run selection":[[12,"run-selection"]],"Running the desktop app":[[2,"running-the-desktop-app"]],"Runs and fitting":[[12,null]],"Selecting parameters for plotting":[[8,"selecting-parameters-for-plotting"]],"Series fit actions":[[12,"series-fit-actions"]],"Some links start with a different prefix":[[14,"some-links-start-with-a-different-prefix"]],"Support":[[2,"support"]],"Template and series presets":[[8,"template-and-series-presets"]],"The Choose X axis dialog":[[8,"the-choose-x-axis-dialog"]],"The Quick Start guide":[[2,"the-quick-start-guide"]],"The Shared column":[[8,"the-shared-column"]],"The parameter table":[[8,"the-parameter-table"]],"The parameter-plot window":[[8,"the-parameter-plot-window"]],"The status bar":[[11,"the-status-bar"]],"Troubleshooting":[[14,null]],"Two editions":[[7,"two-editions"]],"Under the hood":[[7,"under-the-hood"]],"View settings":[[12,"view-settings"]],"Web and desktop editions":[[9,null]],"Web page cannot load data":[[14,"web-page-cannot-load-data"]],"What is shared":[[0,"what-is-shared"]],"What you get":[[7,"what-you-get"]],"Workflow":[[6,"workflow"]],"muSRFlow User Manual":[[4,null]],"t0 / background":[[13,null]],"\u201cNothing to fit\u201d":[[14,"nothing-to-fit"]]},"docnames":["configuration-sharing","constraints","getting-started","glossary","index","keyboard-shortcuts","msr-editor","overview","parameters-plots","platforms","preferences","results-diagnostics","runs-fitting","t0-background","troubleshooting"],"envversion":{"sphinx":65,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2},"filenames":["configuration-sharing.rst","constraints.rst","getting-started.rst","glossary.rst","index.rst","keyboard-shortcuts.rst","msr-editor.rst","overview.rst","parameters-plots.rst","platforms.rst","preferences.rst","results-diagnostics.rst","runs-fitting.rst","t0-background.rst","troubleshooting.rst"],"indexentries":{},"objects":{},"objnames":{},"objtypes":{},"terms":{"":[3,5,6,8,10,12,14],"0":12,"01":12,"012":11,"1":[8,11,12],"100":12,"12":12,"16":12,"1998":12,"2":[8,12],"24":12,"3":8,"5":12,"514":[3,12],"515":[3,12],"516":12,"520":12,"525":12,"540":12,"7":12,"8":12,"A":[0,1,3,4,10,11,12,14],"For":[2,6,8,11,12],"If":[4,8,11,12,14],"In":[5,7,8,14],"It":[0,1,4,6,7,11],"Its":[5,7],"On":[2,3,4,6,7,9,11,12,14],"One":[3,12],"The":[0,1,3,4,5,6,7,9,10,12,13,14],"Then":8,"There":2,"These":4,"To":[1,12],"With":[5,8],"_asi":10,"_singlehist":10,"abov":8,"abragamco":12,"accept":14,"access":9,"accumul":12,"across":[7,8],"action":[3,4,5,7,8,10,11,14],"activ":[2,5,6,7,8,14],"actor":Line truncated
|
||||
@@ -138,6 +138,8 @@ the pointer:
|
||||
(file, parameter) series only, or to every trace of that data set (all
|
||||
panels showing it);
|
||||
* colour swatches, marker **symbol**, **size**, and **opacity**;
|
||||
* **Apply** -- commit the staged choices and redraw the affected panels;
|
||||
**Close** hides the editor, and ESC (or ``Q``) dismisses it;
|
||||
* **Reset** -- restore the file's default colouring for that scope.
|
||||
|
||||
Trace-level edits are keyed by (data set, panel, parameter), so they survive
|
||||
|
||||
+39
-16
@@ -695,6 +695,7 @@ function parameterOverlayEntries(panel, registry) {
|
||||
if (panel.dataset) {
|
||||
entries.push({
|
||||
key: panel.dataSetKey,
|
||||
dataSetKey: panel.dataSetKey,
|
||||
label: (panel.source && panel.source.label) || "Parameter data",
|
||||
dataset: panel.dataset,
|
||||
colorIndex: 0
|
||||
@@ -706,6 +707,7 @@ function parameterOverlayEntries(panel, registry) {
|
||||
if (!entry) continue;
|
||||
entries.push({
|
||||
key: entry.key,
|
||||
dataSetKey: entry.key,
|
||||
label: entry.label,
|
||||
dataset: entry.dataset || null,
|
||||
colorIndex: entry.colorIndex
|
||||
@@ -740,6 +742,7 @@ function buildMusrfitParameterOverlayTraces(dataSets, xName, yNames, mode, optio
|
||||
continue;
|
||||
}
|
||||
let entryColorIndex = Number.isFinite(entry.colorIndex) ? entry.colorIndex : i;
|
||||
let dataSetKey = entry.dataSetKey || entry.key || "";
|
||||
let nameOffset = 0;
|
||||
for (let name of yNames) {
|
||||
let yIndex = musrfitParameterColumnIndex(dataset, name);
|
||||
@@ -747,9 +750,9 @@ function buildMusrfitParameterOverlayTraces(dataSets, xName, yNames, mode, optio
|
||||
let colorIndex = overlayMode ? entryColorIndex : nameOffset;
|
||||
let fallbackColor = entry.color || musrfitParameterPaletteColor(paletteId, colorIndex);
|
||||
let style = { color: fallbackColor };
|
||||
if (options.styleRegistry && entry.dataSetKey) {
|
||||
if (options.styleRegistry && dataSetKey) {
|
||||
style = musrfitParameterTraceStyle(
|
||||
options.styleRegistry, options.styleKeyOf && options.styleKeyOf(entry.dataSetKey, name) || "", entry.dataSetKey, style);
|
||||
options.styleRegistry, options.styleKeyOf && options.styleKeyOf(dataSetKey, name) || "", dataSetKey, style);
|
||||
}
|
||||
let trace = buildMusrfitParameterTrace(dataset, xIndex, yIndex, mode, style);
|
||||
if (overlayMode) trace.name = (entry.label ? entry.label + ": " : "") + trace.name;
|
||||
@@ -1619,13 +1622,15 @@ function showMusrfitParameterPlotWindow(parameterPath, jobName = "", preferredPa
|
||||
for (let other of swatches.querySelectorAll(".parameter-style-swatch")) {
|
||||
other.classList.toggle("selected", other === swatch);
|
||||
}
|
||||
applyParameterStyleAndRedraw(panel, yName);
|
||||
});
|
||||
swatches.appendChild(swatch);
|
||||
}
|
||||
}
|
||||
picker.appendChild(swatches);
|
||||
|
||||
let controls = document.createElement("div");
|
||||
controls.className = "parameter-style-controls";
|
||||
|
||||
let symbolLabel = document.createElement("label");
|
||||
symbolLabel.className = "parameter-style-control";
|
||||
symbolLabel.appendChild(document.createTextNode("Symbol "));
|
||||
@@ -1639,10 +1644,9 @@ function showMusrfitParameterPlotWindow(parameterPath, jobName = "", preferredPa
|
||||
symbolSelect.value = current.symbol || "";
|
||||
symbolSelect.addEventListener("change", function() {
|
||||
picker.dataset.symbol = symbolSelect.value;
|
||||
applyParameterStyleAndRedraw(panel, yName);
|
||||
});
|
||||
symbolLabel.appendChild(symbolSelect);
|
||||
picker.appendChild(symbolLabel);
|
||||
controls.appendChild(symbolLabel);
|
||||
|
||||
let sizeLabel = document.createElement("label");
|
||||
sizeLabel.className = "parameter-style-control";
|
||||
@@ -1655,13 +1659,12 @@ function showMusrfitParameterPlotWindow(parameterPath, jobName = "", preferredPa
|
||||
sizeInput.value = String(current.size);
|
||||
sizeInput.addEventListener("input", function() {
|
||||
picker.dataset.size = sizeInput.value;
|
||||
applyParameterStyleAndRedraw(panel, yName);
|
||||
});
|
||||
sizeLabel.appendChild(sizeInput);
|
||||
picker.appendChild(sizeLabel);
|
||||
controls.appendChild(sizeLabel);
|
||||
|
||||
let opacityLabel = document.createElement("label");
|
||||
opacityLabel.className = "parameter-style-control";
|
||||
opacityLabel.className = "parameter-style-control parameter-style-opacity";
|
||||
opacityLabel.appendChild(document.createTextNode("Opacity "));
|
||||
let opacityInput = document.createElement("input");
|
||||
opacityInput.type = "range";
|
||||
@@ -1675,14 +1678,22 @@ function showMusrfitParameterPlotWindow(parameterPath, jobName = "", preferredPa
|
||||
opacityInput.addEventListener("input", function() {
|
||||
opacityValue.textContent = opacityInput.value;
|
||||
picker.dataset.opacity = opacityInput.value;
|
||||
applyParameterStyleAndRedraw(panel, yName);
|
||||
});
|
||||
opacityLabel.appendChild(opacityInput);
|
||||
opacityLabel.appendChild(opacityValue);
|
||||
picker.appendChild(opacityLabel);
|
||||
controls.appendChild(opacityLabel);
|
||||
|
||||
picker.appendChild(controls);
|
||||
|
||||
let actions = document.createElement("div");
|
||||
actions.className = "parameter-style-actions";
|
||||
|
||||
let closeButton = document.createElement("button");
|
||||
closeButton.type = "button";
|
||||
closeButton.textContent = "Close";
|
||||
closeButton.addEventListener("click", closeParameterStylePicker);
|
||||
actions.appendChild(closeButton);
|
||||
|
||||
let resetButton = document.createElement("button");
|
||||
resetButton.type = "button";
|
||||
resetButton.textContent = "Reset";
|
||||
@@ -1695,6 +1706,16 @@ function showMusrfitParameterPlotWindow(parameterPath, jobName = "", preferredPa
|
||||
closeParameterStylePicker();
|
||||
});
|
||||
actions.appendChild(resetButton);
|
||||
|
||||
let applyButton = document.createElement("button");
|
||||
applyButton.type = "button";
|
||||
applyButton.className = "parameter-style-apply";
|
||||
applyButton.textContent = "Apply";
|
||||
applyButton.addEventListener("click", function() {
|
||||
applyParameterStyleAndRedraw(panel, yName);
|
||||
});
|
||||
actions.appendChild(applyButton);
|
||||
|
||||
picker.appendChild(actions);
|
||||
|
||||
let scopeRadios = picker.querySelectorAll('input[type="radio"]');
|
||||
@@ -1715,8 +1736,8 @@ function showMusrfitParameterPlotWindow(parameterPath, jobName = "", preferredPa
|
||||
});
|
||||
}
|
||||
|
||||
// Hold uncommitted edits in the dataset attribute; each change commits
|
||||
// immediately so the plot reflects the choice without an extra button.
|
||||
// The popover stages edits in its dataset attributes; Apply commits the
|
||||
// staged choices to the style registry and redraws the affected panels.
|
||||
applyParameterStyleAndRedraw = function(panel, yName) {
|
||||
let scope = picker.querySelector('input[type="radio"]:checked');
|
||||
let scopeValue = scope && scope.value === "dataset" ? "dataset" : "trace";
|
||||
@@ -1725,8 +1746,10 @@ function showMusrfitParameterPlotWindow(parameterPath, jobName = "", preferredPa
|
||||
if (picker.dataset.symbol) override.symbol = picker.dataset.symbol;
|
||||
if (picker.dataset.size !== undefined && picker.dataset.size !== "") override.size = picker.dataset.size;
|
||||
if (picker.dataset.opacity !== undefined && picker.dataset.opacity !== "") override.opacity = picker.dataset.opacity;
|
||||
recordParameterStyle(styleRegistry, parameterStyleScopeKeys(panel, yName, scopeValue), override, false);
|
||||
redrawParameterStyleTargets(panel, scopeValue);
|
||||
if (Object.keys(override).length) {
|
||||
recordParameterStyle(styleRegistry, parameterStyleScopeKeys(panel, yName, scopeValue), override, false);
|
||||
redrawParameterStyleTargets(panel, scopeValue);
|
||||
}
|
||||
};
|
||||
|
||||
content.appendChild(picker);
|
||||
@@ -1734,8 +1757,8 @@ function showMusrfitParameterPlotWindow(parameterPath, jobName = "", preferredPa
|
||||
let sizeY = pointerEvent && Number.isFinite(pointerEvent.clientY) ? pointerEvent.clientY : 40;
|
||||
let maxX = typeof window.innerWidth === "number" ? window.innerWidth : 800;
|
||||
let maxY = typeof window.innerHeight === "number" ? window.innerHeight : 600;
|
||||
picker.style.left = Math.max(8, Math.min(sizeX, maxX - 230)) + "px";
|
||||
picker.style.top = Math.max(8, Math.min(sizeY, maxY - 240)) + "px";
|
||||
picker.style.left = Math.max(8, Math.min(sizeX, maxX - 320)) + "px";
|
||||
picker.style.top = Math.max(8, Math.min(sizeY, maxY - 320)) + "px";
|
||||
stylePicker = picker;
|
||||
|
||||
// One-shot outside click / focus elsewhere closes the picker.
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@bitbucket.org/zaher-salman/musrfit-gui.git"
|
||||
"url": "git+ssh://git@bitbucket.org/zaher-salman/muSRFlow.git"
|
||||
},
|
||||
"keywords": [
|
||||
"musrfit",
|
||||
@@ -23,9 +23,9 @@
|
||||
"author": "Zaher Salman",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://bitbucket.org/zaher-salman/musrfit-gui/issues"
|
||||
"url": "https://bitbucket.org/zaher-salman/muSRFlow/issues"
|
||||
},
|
||||
"homepage": "https://bitbucket.org/zaher-salman/musrfit-gui#readme",
|
||||
"homepage": "https://bitbucket.org/zaher-salman/muSRFlow#readme",
|
||||
"devDependencies": {
|
||||
"electron": "^44.0.0"
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@ function testSharedHelpWindowInfrastructure() {
|
||||
assert.match(deploy, /quick-start\.html/);
|
||||
assert.match(deploy, /__MUSRFLOW_VERSION__/);
|
||||
assert.match(deploy, /node -p 'require\(process\.argv\[1\]\)\.version'/);
|
||||
assert.doesNotMatch(lib, /musrfit-gui|bitbucket\.org\/zaher-salman/);
|
||||
assert.doesNotMatch(lib, /musrfit-gui|bitbucket\.org\/zaher-salman\/musrfit-gui/);
|
||||
}
|
||||
|
||||
testSharedHelpWindowInfrastructure();
|
||||
|
||||
@@ -760,8 +760,10 @@ function testDataSetRegistryFoundation() {
|
||||
const entries = lib.parameterOverlayEntries(panel, registry);
|
||||
assert.strictEqual(entries.length, 2);
|
||||
assert.strictEqual(entries[0].key, entryA.key);
|
||||
assert.strictEqual(entries[0].dataSetKey, entryA.key);
|
||||
assert.strictEqual(entries[0].colorIndex, 0);
|
||||
assert.strictEqual(entries[1].key, entryB.key);
|
||||
assert.strictEqual(entries[1].dataSetKey, entryB.key);
|
||||
assert.strictEqual(entries[1].dataset, null);
|
||||
|
||||
// A panel without a dataset resolves to no entries.
|
||||
@@ -784,6 +786,27 @@ function testDataSetRegistryFoundation() {
|
||||
assert.strictEqual(overlay.traces[0].marker.color, "#1f77b4");
|
||||
assert.strictEqual(overlay.traces[1].marker.color, "#ff7f0e");
|
||||
|
||||
// Styles the user records must reach traces whose overlay entries carry only
|
||||
// a `key` (the exact shape parameterOverlayEntries produces). Looking for
|
||||
// entry.dataSetKey there silently ignored every user edit.
|
||||
const styles = {};
|
||||
styles[lib.parameterDataSetStyleKey(entryB.key)] = { color: "#008837", symbol: "star", size: 14, opacity: 0.6 };
|
||||
const styled = lib.buildMusrfitParameterOverlayTraces(
|
||||
[{ key: entryA.key, label: "Scan A", dataset: scanA, colorIndex: 0 },
|
||||
{ key: entryB.key, label: "Scan B", dataset: scanB, colorIndex: 4 }],
|
||||
"dataT", ["Alpha"], "markers", {
|
||||
paletteId: "default",
|
||||
styleRegistry: styles,
|
||||
styleKeyOf: function(key, name) {
|
||||
return lib.parameterTraceStyleKey(key, "pp1", name);
|
||||
}
|
||||
});
|
||||
assert.strictEqual(styled.traces[1].marker.color, "#008837");
|
||||
assert.strictEqual(styled.traces[1].marker.symbol, "star");
|
||||
assert.strictEqual(styled.traces[1].marker.size, 14);
|
||||
assert.strictEqual(styled.traces[1].marker.opacity, 0.6);
|
||||
assert.strictEqual(styled.traces[0].marker.color, "#1f77b4");
|
||||
|
||||
// A single data set keeps per-parameter color cycling (original look).
|
||||
const solo = lib.buildMusrfitParameterOverlayTraces(
|
||||
[{ key: entryA.key, label: "Scan A", dataset: scanA, colorIndex: 0 }],
|
||||
|
||||
Reference in new issue
Block a user