diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 8b241847..94e37519 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -9,9 +9,9 @@ using Base.Iterators # need to import some functions because methods are meta-generated import PlotlyBase: - restyle!, relayout!, addtraces!, deletetraces!, movetraces!, redraw!, - extendtraces!, prependtraces!, purge!, to_image, download_image, - restyle, relayout, addtraces, deletetraces, movetraces, redraw, + restyle!, relayout!, update!, addtraces!, deletetraces!, movetraces!, + redraw!, extendtraces!, prependtraces!, purge!, to_image, download_image, + restyle, relayout, update, addtraces, deletetraces, movetraces, redraw, extendtraces, prependtraces, prep_kwargs, sizes, savefig using Blink diff --git a/src/displays/ijulia.jl b/src/displays/ijulia.jl index 47624fec..193f6d54 100644 --- a/src/displays/ijulia.jl +++ b/src/displays/ijulia.jl @@ -122,6 +122,27 @@ end restyle!(jd::JupyterDisplay, update::Associative=Dict(); kwargs...) = _call_plotlyjs(jd, "restyle", merge(update, prep_kwargs(kwargs))) +function update!( + jd::JupyterDisplay, ind::Int, update::Associative=Dict(); + layout::Layout=Layout(), kwargs... + ) + _call_plotlyjs(jd, "update", merge(update, prep_kwargs(kwargs)), layout, ind-1) +end + +function update!( + jd::JupyterDisplay, inds::AbstractVector{Int}, + update::Associative=Dict(); layout::Layout=Layout(), kwargs... + ) + _call_plotlyjs(jd, "update", merge(update, prep_kwargs(kwargs)), layout, inds-1) +end + +function update!( + jd::JupyterDisplay, update::Associative=Dict(); + layout::Layout=Layout(), kwargs... + ) + _call_plotlyjs(jd, "update", merge(update, prep_kwargs(kwargs)), layout) +end + addtraces!(jd::JupyterDisplay, traces::AbstractTrace...) = _call_plotlyjs(jd, "addTraces", traces)