Skip to content

Commit 8b02f78

Browse files
committed
Failed attempt to remove scrollbars from plots iframe
1 parent 4a148d0 commit 8b02f78

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

webapp/components/general/PlotViewer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ const PlotViewer = ({ key, id, method }) => {
1717
>
1818
<iframe
1919
title="plot"
20+
scrolling="no"
2021
name="dipole"
2122
srcDoc={data}
2223
style={{
24+
overflowX:hidden,
25+
overflowY:hidden,
2326
border: 0,
2427
width: '100%',
2528
height: '100%',

webapp/redux/middleware/plotMiddleware.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ const plotFigure = async (plotId, plotMethod, plotType = false, uri = null, them
5454
if (response.startsWith('[') && response.endsWith(']')) {
5555
response = eval(response);
5656
}
57-
}
58-
if (plotMethod.startsWith('iplot')) {
59-
let htmlText = response.replace ? response.replace(/\\n/g, '')
60-
.replace(/\\/g, '') : '';
61-
if (plotId === 'rxdConcentrationPlot') {
62-
// FIXME: How can we center the bokeh plots when sizing_mode='scale_height'
63-
htmlText = htmlText.replace('<head>', '<head><style>.bk {margin: 0 auto!important;}</style>');
57+
if (response.indexOf('<html') > -1) {
58+
let htmlText = response.replace ? response.replace(/\\n/g, '')
59+
.replace(/\\/g, '') : '';
60+
//if (plotId === 'rxdConcentrationPlot') {
61+
// FIXME: How can we center the bokeh plots when sizing_mode='scale_height'
62+
htmlText = htmlText.replace('<head>', '<head><style>.bk {margin: 0 auto!important;} div {overflow:hidden;} frame {overflow:hidden;}</style>');
63+
//}
64+
return htmlText;
6465
}
65-
return htmlText;
6666
}
6767
if ((plotMethod == 'plotDipole' || plotMethod == 'plotEEG' )) { //uri is available here
6868
const plotUri = uri.replace('{name}', response);

0 commit comments

Comments
 (0)