Skip to content

Commit b5503bb

Browse files
authored
[OGUI-1819] JSROOT force redraw with key and fix stat drawing options passing (#3215)
- Fix bug in which stat drawing option was incorrectly passed - Correctly pass drawing options to draw method - Foce redraw by key due to JSROOT redraw issue
1 parent 9d0f713 commit b5503bb

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

QualityControl/public/layout/view/page.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ function subcanvasView(model) {
140140
* @returns {vnode} - virtual node element
141141
*/
142142
function chartView(model, tabObject) {
143-
const key = `key${tabObject.id}`;
143+
// Changing the key will force redraw of the whole component including jsroot
144+
// This is currently a patch workaround for ensuring a change of drawing option also
145+
// redraw the jsroot plot, because sometimes jsroot do not redraw well on option changes only.
146+
const key = `key${tabObject.id + tabObject.options.length}`;
144147

145148
// Position and size are produced by GridList in the model
146149
const style = {
@@ -194,7 +197,7 @@ function chartView(model, tabObject) {
194197
*/
195198
const drawComponent = (model, tabObject) => {
196199
const { displayTimestamp = false } = model.layout.item;
197-
const { name } = tabObject;
200+
const { name, options: drawingOptions = [] } = tabObject;
198201
const lastModified = model.object.getLastModifiedByName(name);
199202
const runNumber = model.object.getRunNumberByName(name);
200203

@@ -207,7 +210,7 @@ const drawComponent = (model, tabObject) => {
207210
display: 'flex',
208211
'flex-direction': 'column',
209212
},
210-
}, draw(model.object, tabObject.name)),
213+
}, draw(model.object, name, {}, drawingOptions)),
211214
objectInfoResizePanel(model, tabObject),
212215
displayTimestamp && minimalObjectInfo(runNumber, lastModified),
213216
]);

QualityControl/public/object/objectTreePage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const drawPlot = (model, object) => {
121121
iconCircleX(),
122122
),
123123
]),
124-
h('', { style: 'height:77%;' }, draw(model.object, name, { stat: true })),
124+
h('', { style: 'height:77%;' }, draw(model.object, name, { }, ['stat'])),
125125
h('.scroll-y', {}, [
126126
h('.w-100.flex-row', { style: 'justify-content: center' }, h('.w-80', timestampSelectForm(model))),
127127
qcObjectInfoPanel(object, { 'font-size': '.875rem;' }, defaultRowAttributes(model.notification)),

0 commit comments

Comments
 (0)