Skip to content

Commit 95448ec

Browse files
committed
Remove image export from plot context menu, add double-click reset view
1 parent f3ab30b commit 95448ec

2 files changed

Lines changed: 4 additions & 20 deletions

File tree

src/lib/components/contextMenuBuilders.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -469,17 +469,6 @@ function buildPlotMenu(nodeId: string, plotEl: HTMLDivElement): MenuItemType[] {
469469
const showLegend = blockSettings.showLegend;
470470

471471
return [
472-
{
473-
label: 'Download PNG',
474-
icon: 'image',
475-
action: () => downloadPlotImage(plotEl, 'png', nodeName)
476-
},
477-
{
478-
label: 'Download SVG',
479-
icon: 'image',
480-
action: () => downloadPlotImage(plotEl, 'svg', nodeName)
481-
},
482-
DIVIDER,
483472
{
484473
label: 'Export CSV',
485474
icon: 'table',
@@ -495,6 +484,7 @@ function buildPlotMenu(nodeId: string, plotEl: HTMLDivElement): MenuItemType[] {
495484
{
496485
label: 'Reset View',
497486
icon: 'maximize',
487+
shortcut: 'Dbl-click',
498488
action: async () => {
499489
const Plotly = await import('plotly.js-dist-min');
500490
Plotly.relayout(plotEl, {

src/lib/plotting/renderers/plotly.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,10 @@ export const PLOTLY_CONFIG: Partial<Plotly.Config> = {
1515
responsive: true,
1616
displaylogo: false,
1717
displayModeBar: 'hover',
18-
modeBarButtonsToRemove: ['lasso2d', 'select2d'],
18+
modeBarButtonsToRemove: ['lasso2d', 'select2d', 'toImage'],
1919
modeBarButtonsToAdd: [],
20-
toImageButtonOptions: {
21-
format: 'svg',
22-
filename: 'pathview_plot',
23-
height: 600,
24-
width: 1000,
25-
scale: 2
26-
},
27-
scrollZoom: true
20+
scrollZoom: true,
21+
doubleClick: 'reset'
2822
};
2923

3024
// ============================================================

0 commit comments

Comments
 (0)