This example shows how to set the the node image based on adding SVG elements. The expanded nodes are shown with a green circle. If the node is collapsed, it changes to a red circle.
Acknowledgements: