I was playing with your repo and wanted to add some interactive functionality, as the variable trees can get quite big, which makes them unreadable. So Zooming in/out + panning would be nice.
I found this JS lib which offers this functionality for svg objects.
First off, I created some shiny functions: renderVtree and vtreeOutput.
And there is a small example that you can run with:
If you're up for that kind of interactivity, I would try to extend the function use_svgzoom (_its stored right now in /inst/examples/shiny_app.R_), so thats its the only function that has to be included if someone wants to make the tree more interactive. Somewhat similar to shinyjs::useShinyjs().
Additionally, I was also looking at the DiagrammeRcode for shiny widgets, because I would like to have the variable-tree clickable or brushable. That's why in the example there is an observeEvent for input$vtree_click, which works just locally on my computer for now. Since its still buggy, I wanted to rewrite the JS part and then upload a PR to DiagrammeR.
I was playing with your repo and wanted to add some interactive functionality, as the variable trees can get quite big, which makes them unreadable. So Zooming in/out + panning would be nice.
I found this JS lib which offers this functionality for svg objects.
First off, I created some shiny functions:
renderVtree
andvtreeOutput
. And there is a small example that you can run with:If you're up for that kind of interactivity, I would try to extend the function
use_svgzoom
(_its stored right now in/inst/examples/shiny_app.R
_), so thats its the only function that has to be included if someone wants to make the tree more interactive. Somewhat similar toshinyjs::useShinyjs()
.Additionally, I was also looking at the
DiagrammeR
code for shiny widgets, because I would like to have the variable-tree clickable or brushable. That's why in the example there is anobserveEvent
forinput$vtree_click
, which works just locally on my computer for now. Since its still buggy, I wanted to rewrite the JS part and then upload a PR toDiagrammeR
.