You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating an output using grVizOutput and then assigning the output of renderGrViz in addition to rendering the graph, also creates input elements. This side effect is not really documented anywhere that I can see, so developers can't use it.
ui <- fluidPage(
#...
grVizOutput("graph")
#...
)
server <- function (input, output) {
output$graph <- renderGrViz({grViz("digraph ...")})
#...
}
Will, in addition to rendering the graph, create a reactive element input$graph_click. This appears to be a list with elements nodeValues and id.
Here is the relevant Javascript code from DiagrammeR.js (starting at line 135)
$("#" + id + " .node").click(function(e) {
// Build return object *obj* with node-id and node textContent
var obj = {
id: e.currentTarget.id,
nodeValues: e.currentTarget.textContent
};
// Send *obj* to Shiny's inputs (input$[id]+_click e.g.: input$vtree_click))
Shiny.setInputValue(id + "_click", obj, {priority: "event"});
});
I gather that these represent the id and label of the nodes, but this is a guess.
Really, documentation needs to be added to the renderGrViz and grVizOutput functions so that this behavior is well specified.
Creating an output using
grVizOutput
and then assigning the output ofrenderGrViz
in addition to rendering the graph, also createsinput
elements. This side effect is not really documented anywhere that I can see, so developers can't use it.Will, in addition to rendering the graph, create a reactive element
input$graph_click
. This appears to be a list with elementsnodeValues
andid
.Here is the relevant Javascript code from
DiagrammeR.js
(starting at line 135)I gather that these represent the
id
andlabel
of the nodes, but this is a guess.Really, documentation needs to be added to the
renderGrViz
andgrVizOutput
functions so that this behavior is well specified.This issue gives a functioning example.
#402
The text was updated successfully, but these errors were encountered: