How would I add a text block showing the details of a node that has been clicked?
Similar to the Org Chart Editor example. But that idea applied to the Graph Distances and Paths example. I know an incredibly basic question, but I’m just getting started…thanks!
When you say TextBlock, do you really mean how to show some information in HTML, about a node that’s been clicked?
I suggest modifying the HTML that you want to change. Look at how we do it in the Production Process sample:
var $ = go.GraphObject.make; // for conciseness in defining templates
myDiagram = $(go.Diagram, "myDiagramDiv", // create a Diagram for the DIV HTML element
{
...
"ChangedSelection": onSelectionChanged, // view additional information
});
function onSelectionChanged(e) {
var node = e.diagram.selection.first();
if (!(node instanceof go.Node)) return;
var data = node.data;
var image = document.getElementById('Image');
var title = document.getElementById('Title');
var description = document.getElementById('Description');
if (data.imgsrc) {
image.src = data.imgsrc;
image.alt = data.caption;
} else {
image.src = "";
image.alt = "";
}
title.textContent = data.text;
description.textContent = data.description;
}