svg dynamically builds red black tree