Due to the new data validation for nodes, edges and combos, someexisting code might break if the data provided to g6R functions is notvalid. See the correspondingdocumentationsection. If you had to pass custom data you can do it in thedata slot.
g6_options(renderer =JS("() => new SVGRenderer()"))options("g6R.layout_on_data_change" = TRUE). In thelater case, the layout is recomputed after drawing.g6R.preserve_elements_position. If TRUE, andonly ifg6_options(animation = FALSE), the elements (nodesand combos) coordinates are preserved when updating the layout to avoidelements from jumping to new positions. Default is FALSE. A warning israised if this option is TRUE and animation is TRUE to tell the userthat the option will be ignored.g6_update_layout() proxy function to order thelayout re-execution and optionally update its parameters.input[["<graph_ID>-mouse_position"]]: anyclick/right click or drag release event captures the mouse position.input[["<graph_ID>-mouse_position"]] contains the xand y coordinates of the mouse relative to the canvas. This is useful toadd a node where the mouse was clicked, a context menu was triggered orthe create edge was released on the canvas without a specifictarget.brush_select() orlasso_select() have a custom input handler. This maygive:input[["<graph_ID>-selected_combo"]][1]"1""2"attr(,"eventType")[1]"brush_select"Notice the extra attribute, which allows to make a difference betweenclick_select() andbrush_select() events.
input$<graph_ID>-selected_node instead ofinput$<graph_ID>-selected_combo.create_edge() behavior improved: when creating an edgeand it is release on the canvas, the edge isn’t cancelled and data areavailable. We added atargetType property which allows toknow where the edge was dropped.g6_node(),g6_edge(),g6_combo() to create nodes, edgesand combos respectively. We suggest to use them instead of passing listsor dataframes to g6 as they provide safety checks. We also addedg6_nodes(),g6_edges() andg6_combos() which are internally used by some proxyfunctions likeg6_add_nodes() to provide moreflexibility.options("g6R.mode) that can bedev orprod (default). Indev mode, Shinynotifications are displayed in the UI whenever a JavaScript errorhappens (they are still available in the JS console).g6_focus_elements(),g6_hide_elements()andg6_show_elements() gain more specific siblings:g6_focus_nodes(),g6_focus_edges(),g6_focus_combos(),g6_hide_nodes(),g6_hide_edges(),g6_hide_combos(),g6_show_nodes(),g6_show_edges(),g6_show_combos().brush_select(),lasso_select() andcreate_edge() gain anoutputId parameter whichallows to manually pass the Shiny output ID of the graph instance. Thisis useful when the graph is initialised outside the shiny renderfunction and the ID cannot be automatically inferred withshiny::getCurrentOutputInfo(). This allows to set inputvalues from the callback function with the right namespace and graph ID.You must typically passsession$ns("graphid") to ensurethis also works in modules.brush_select(): now it correctlyreturns the list of selected nodes, edges and combos, available viainput$<graph_ID>-selected_node,input$<graph_ID>-selected_edge andinput$<graph_ID>-selected_combo, thanks to theinternal IDs refactoring. After a brush select operation, you can nowshift click (depending on theclick_select() multipleselection trigger settings you set, it might be another key) toadd/remove elements to/from the current selection.lasso_select() also gets the same quality of lifeimprovements.hull are drawn.input$<graph_ID>-contextmenu to extract thetype and id of element which was clicked in the context menu. This canbe listened to from the Shiny server function.drag_element_force only works whenanimationis TRUE. Also addedautoFit = TRUE wherever required(manual layout vignette).