Skip to content

Commit 6758a53

Browse files
committed
Make EEG and dipole charts root dymanic
1 parent b9e29a8 commit 6758a53

3 files changed

Lines changed: 154 additions & 151 deletions

File tree

webapp/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export const PLOT_WIDGETS = {
404404
config: {
405405
id: 'plotDipole',
406406
name: 'Dipole plot',
407-
uri: 'downloads?uri=workspace/model_output_dipole.png',
407+
uri: 'downloads?uri=workspace/{name}',
408408
method: {
409409
plotKey: 'plotDipole',
410410
plotMethod: 'plotDipole',
@@ -432,7 +432,7 @@ export const PLOT_WIDGETS = {
432432
config: {
433433
id: 'plotEEG',
434434
name: 'EEG plot',
435-
uri: 'downloads?uri=workspace/model_output_EEG.png',
435+
uri: 'downloads?uri=workspace/{name}',
436436
method: {
437437
plotKey: 'plotEEG',
438438
plotMethod: 'plotEEG',

webapp/redux/middleware/plotMiddleware.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ const plotFigure = async (plotId, plotMethod, plotType = false, uri = null, them
6565
return htmlText;
6666
}
6767
if ((plotMethod == 'plotDipole' || plotMethod == 'plotEEG' )) { //uri is available here
68-
return (`<img src="${uri}"></img>`) ;
68+
const plotUri = uri.replace('{name}', response);
69+
return (`<img src="${plotUri}"></img>`) ;
6970
}
7071
if (response?.length !== undefined) {
7172
return response[0];

0 commit comments

Comments
 (0)