From a8cf6dff7da121749fe32e3709443f27277fbbd2 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 31 Jul 2024 20:26:05 +0200 Subject: [PATCH] fix: Check note on DiagrammeR dependency in vignette V05 Also clean doc of plot.GRiwrm --- R/plot.GRiwrm.R | 6 +----- man/plot.GRiwrm.Rd | 8 ++------ vignettes/V05_Modelling_ungauged_nodes.Rmd | 9 +-------- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/R/plot.GRiwrm.R b/R/plot.GRiwrm.R index 8ac8eab..e0618a5 100644 --- a/R/plot.GRiwrm.R +++ b/R/plot.GRiwrm.R @@ -1,4 +1,4 @@ -#' Display of a diagram representing the network structure of a GRiwrm object +#' Plot of a diagram representing the network structure of a GRiwrm object #' #' @param x \[GRiwrm object\] data to display. See [CreateGRiwrm] for details #' @param display [logical] if `TRUE` plots the diagram, returns the mermaid code otherwise @@ -11,9 +11,6 @@ #' @param footer mermaid script to add after the generated script #' @param ... further parameters passed to [mermaid] #' -#' @details This function only works inside RStudio because the HTMLwidget produced by DiagrammeR -#' is not handled on some platforms -#' #' @return Mermaid code of the diagram if display is `FALSE`, otherwise the function returns the diagram itself. #' #' @export plot.GRiwrm @@ -261,7 +258,6 @@ mermaid_gen_link <- function(diagram, theme = "default", format = "png", server #' @source From https://stackoverflow.com/a/28729601/5300212 #' @param path Path of the file #' @param add [logical] Add the image to the existing plot -#' @param pic output of #' #' @return Nothing, used to side effect. #' @noRd diff --git a/man/plot.GRiwrm.Rd b/man/plot.GRiwrm.Rd index 365a633..84d3c40 100644 --- a/man/plot.GRiwrm.Rd +++ b/man/plot.GRiwrm.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/plot.GRiwrm.R \name{plot.GRiwrm} \alias{plot.GRiwrm} -\title{Display of a diagram representing the network structure of a GRiwrm object} +\title{Plot of a diagram representing the network structure of a GRiwrm object} \usage{ \method{plot}{GRiwrm}( x, @@ -41,11 +41,7 @@ Mermaid code of the diagram if display is \code{FALSE}, otherwise the function returns the diagram itself. } \description{ -Display of a diagram representing the network structure of a GRiwrm object -} -\details{ -This function only works inside RStudio because the HTMLwidget produced by DiagrammeR -is not handled on some platforms +Plot of a diagram representing the network structure of a GRiwrm object } \examples{ library(airGRiwrm) diff --git a/vignettes/V05_Modelling_ungauged_nodes.Rmd b/vignettes/V05_Modelling_ungauged_nodes.Rmd index 6b0cafc..bbb030b 100644 --- a/vignettes/V05_Modelling_ungauged_nodes.Rmd +++ b/vignettes/V05_Modelling_ungauged_nodes.Rmd @@ -40,14 +40,7 @@ Using the study case of the vignette #1 and #2, we considere this time that node hydrological parameters of the gauged node `54032`. ```{r network, echo = FALSE} -mmd <- function(x, ...) { - # For avoiding crash of R CMD build in console mode - if (Sys.getenv("RSTUDIO") == "1") { - DiagrammeR::mermaid(x, ...) - } -} - -mmd(" +plot.mermaid(" graph LR id95[54095] id01[54001]