anychart.onDocumentReady(function () {
{id: "Richard", url: 'https://google.com'},
{id: "Larry", url: 'https://www.wikipedia.org'},
{from: "Richard", to: "Larry"},
var chart = anychart.graph(data);
chart.title("Click nodes");
chart.container("container").draw();
chart.listen('click', function(e) {
var tag = e.domTarget.tag;
console.log(`Clicked ${tag.type} with ID ${tag.id}`);
if (tag.type === 'node') {
for (var i = 0; i < data.nodes.length; i++) {
if (data.nodes[i].id === tag.id) {
window.open(url, '_blank');