Notebooks 2.0 is here.

Published
Edited
Jan 26, 2021
5 stars
Insert cell
md`# Interactive network with Vega`
Insert cell
embed = require('vega-embed@6')
Insert cell
vega_spec = FileAttachment("vega-spec-network.json").json()
Insert cell
viewof view = embed(vega_spec);
Insert cell
md`### Interactive network with Vega

It is not straightforward how to highlight involved nodes and edges around a hovered element (node/edge).

It can be done by maintaining a dataset of neighbors from the hovered node as well as the nodes belonging to a hovered edge.

Then just play with the logic using chains of production rules in the marks in order to control what has to be highlighted.`
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more