Interactive figures#

Interactive figures (plotly) and network pages (pyvis).

Both libraries are optional (pip install "spmviz[interactive]"). Plotly figures render in notebooks and in the documentation; fig.write_html saves a standalone page. to_pyvis reproduces the physics-based, draggable view of the original NbVFS implementation.

Plotly sunbursts, icicles, treemaps, Sankey diagrams and maps; pyvis networks.

Functions#

embedding_figure(ps[, similarity, method, title])

Interactive 2-D map of the patterns from a similarity.

icicle_figure(db[, max_depth, min_count, ...])

Zoomable icicle of the sequence prefixes.

nbvfs_figure(model[, title])

Interactive version of a fitted NBVFS map (hover shows the measures).

network_figure(G[, color, size, hover, ...])

Plotly drawing of any networkx graph (coordinates from x/y or a spring layout).

sankey_figure(db[, max_steps, top, title])

Interactive Sankey diagram of the first steps ("$" = the sequence ended).

sunburst_figure(db[, max_depth, min_count, ...])

Zoomable sunburst of the sequence prefixes (click a wedge to zoom in).

to_pyvis(G[, height, width, physics, color, ...])

A pyvis network (vis.js) of a graph: drag nodes, zoom, hover tooltips.

treemap_figure(db[, max_depth, min_count, ...])

Treemap of the sequence prefixes.