Notice the bindings between the select widget and the graph.
This is what I have some difficulties to reproduce.
Bindings in both way. From select Input to the svg graph and from it to set a select Input.
Any suggestion or reading of a notebook with such a behaviour would be welcomed.
I would create a set function on the graph, that accepts a name (string), and sets the value. And then a cell which calls this function with the selectedAuthor2’s name.
graph.set(selectedAuthor2.Name)
to create the set function, I would replace yield svg.node(); with:
and update the click function like so to avoid an infinite loop:
function click(event, d) {
+ if (mutable selectedAuthor !==d) {
mutable selectedAuthor = d;
connectedNodes(d);
+ }
}
A slightly better approach is described in Synchronized Inputs / Observable | Observable — but it would require more changes to your code, to make the graph work like an Input (without using mutable).