Skip to content

Commit 6b58e39

Browse files
committed
docs: support Plotly animation embeds
1 parent eae656a commit 6b58e39

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

docs/EmbeddPlotlyJSSyncPlotLiterate.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ function Base.show(io::IO, ::MIME"text/html", fig::PlotlyJS.SyncPlot)
2121
# Copy is required because we pop layout width/height for Plotly's inner JSON.
2222
# Mutating fig.plot directly would change size(fig) and user-visible behavior.
2323
plot = copy(fig.plot)
24+
plot.frames = fig.plot.frames
25+
plot.config = deepcopy(fig.plot.config)
26+
plot.config.displayModeBar = false
2427
default_width = layout_to_html_default_size!(plot.layout.fields, :width, get(plot.layout.fields, :width, nothing))
2528
default_height = layout_to_html_default_size!(plot.layout.fields, :height, get(plot.layout.fields, :height, nothing))
2629

2730
html_buffer = IOBuffer()
2831
PlotlyJS.PlotlyBase.to_html(
2932
html_buffer,
3033
plot;
34+
autoplay=false,
3135
full_html=true,
3236
include_plotlyjs="cdn",
3337
default_width=default_width,

0 commit comments

Comments
 (0)