Skip to content

Commit 0e09925

Browse files
makegallery: add Open option to open the gallery in the web browser
1 parent 9e9746a commit 0e09925

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎plotly/makegallery.m‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
% Theme - 'dark' (default), 'light' or 'auto' (follow the
3030
% browser/system preference). A toggle button in the
3131
% gallery switches between dark and light at runtime.
32+
% Open - true (default) to open the gallery in the default
33+
% web browser once it has been written.
3234
% Width,Height - maximum width and aspect ratio (Width:Height) of
3335
% the figure panels. The native PNGs and the Plotly
3436
% figures share the same size and shrink together
@@ -109,6 +111,10 @@
109111
fprintf(' %d/%d native figure exports OK, %d/%d Plotly conversions OK\n', ...
110112
gallery.summary.nativeOK, gallery.summary.total, ...
111113
gallery.summary.plotlyOK, gallery.summary.total);
114+
115+
if opts.Open
116+
web(htmlPath);
117+
end
112118
end
113119

114120
function opts = parseOptions(varargs)
@@ -121,6 +127,7 @@
121127
'SavePNGs', false, ...
122128
'PlotlyJS', 'auto', ...
123129
'Theme', 'dark', ...
130+
'Open', true, ...
124131
'Width', 640, ...
125132
'Height', 480 ...
126133
);
@@ -145,6 +152,8 @@
145152
opts.PlotlyJS = value;
146153
case 'theme'
147154
opts.Theme = value;
155+
case 'open'
156+
opts.Open = value;
148157
case 'width'
149158
opts.Width = value;
150159
case 'height'

0 commit comments

Comments
 (0)