Published
Edited
Oct 15, 2021
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
selected_edge = observe_chart_data(force_directed_chart, "edge_click")
Insert cell
function observe_chart_data(chart, signal_name) {
return Generators.observe(function(notify) {
// change is a function; calling change triggers the resolution of the current promise with the passed value.

// Yield the element’s initial value.
const signaled = (name, value) => notify(chart.signal(signal_name));
chart.addSignalListener(signal_name, signaled);
notify(chart.signal(signal_name));

return () => chart.removeSignalListener(signal_name, signaled);
});
}
Insert cell
selected_node = observe_chart_data(force_directed_chart, "node_click")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// splink_vis_utils = require(`${localUrl}?${refresh}${Date.now()}`)
Insert cell
// localUrl = "http://127.0.0.1:8080/dist/splink_vis_utils.js"
Insert cell
// vegaEmbed = require("vega-embed@6")
Insert cell
// raw_clusters_data = d3.json("https://gist.githubusercontent.com/RobinL/1101d5c919de39d9435983d0edce5aa2/raw/5feca1c47d9c10e396dde8e06588f57634650a9a/raw_cluster_data.json")
Insert cell
// raw_nodes_data = d3.json(
// "https://gist.githubusercontent.com/RobinL/1101d5c919de39d9435983d0edce5aa2/raw/65f0263c7ac3f663fbd947c0682315e4f72a21ce/raw_nodes_data.json"
// )
Insert cell
// raw_edges_data = d3.json(
// "https://gist.githubusercontent.com/RobinL/1101d5c919de39d9435983d0edce5aa2/raw/65f0263c7ac3f663fbd947c0682315e4f72a21ce/raw_edges_data.json"
// )
Insert cell
// splink_settings = d3.json(
// "https://gist.githubusercontent.com/RobinL/1101d5c919de39d9435983d0edce5aa2/raw/d1428393a9a161317f693cd277aaae60b66d0d4f/splink_settings.json"
// )
Insert cell
// svu_options = ({
// cluster_colname: 'cluster_medium',
// prob_colname: 'tf_adjusted_match_prob'
// })
Insert cell
// named_clusters = null
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