Skip to main content

ListLinePlotly

WLJS
Execution environment
Supports dynamics
ListLinePlotly[{data1_, data2_, ...}]
ListLinePlotly[{{x1,y1}, ... {xn,yn}}]
ListLinePlotly[{y1, y2, y3 ...}]

mimics the native function ListLinePlot using Plotly library (see Plotly). It is limited, there is no options supported.

An alternative plotting function to ListLinePlot, that supports dynamic updates, panning, zoom out of the box

Dynamics

It fully supports dynamic updates. This is the first ever high order function, that does this unlike ListLinePlot.

tip

To use full features of Plotly, please, use Plotly and PlotlyAnimate or PlotlyAddTraces

Example

ListLinePlotly[Accumulate[RandomReal[{-1, 1}, {250, 2}]]]
danger

No styling possible for now

Examples with dynamics

As an advantage of it, you can directly feed it with offloaded variables

dirs = {{0,0}, {0,0}};
ListLinePlotly[dirs // Offload]
task = SetInterval[dirs = Append[dirs, Last[dirs] + RandomChoice[{{1,0}, {-1,0}, {0,1}, {0,-1}}]], 300];
SetTimeout[TaskRemove[task], 6000];