If attached as onSelect behaviour for a visNetwork graph, will allow clicking of nodes to replace the legend for the graph with metadata about that node.

Presently requires JQuery to operate, so may not work when launched from R session, but does work in pkgdown.

It looks like this:

function(props) {
  node = this.body.data.nodes.get(props.nodes[0]);
  cr = '\r\n';
  alert(
    '' + '
using mandrake::embed_event_handler() is deprecated.
please use mandrake::attach_dependencies & 
on_select = "embed_event_handler()" when rendering graph
'
    'selected ' +  node.label + ':' + cr +
    '=======' + cr +
    'COLNAMES:' + cr +
    node.on_select_col + cr +
    '=============== '
  );
}
embed_event_handler(warn_deprecated = TRUE)

See also

Other js_handlers: alert_event_handler()