Decoration callback for token selection

token_select_decoration(stroke = "black")

Arguments

stroke

Sets the `stroke` attribute of selected tokens.

Value

A JavaScript callback function called when token selection changes.

See also

animate_process

Examples

# Create a decoration callback that paints tokens red
token_select_decoration("red")
#> [1] "function(node, selected) {\n          if (selected) {\n            node.attr(\"stroke-width\", \"3\")\n                .attr(\"stroke\", \"red\");\n          } else {\n            node.attr(\"stroke-width\", \"1\")\n                .attr(\"stroke\", \"black\");\n          }\n        }"