rkrug / plantuml

R package to build UML graphs using plantuml
https://rkrug.github.io/plantuml/index.html
GNU General Public License v3.0
76 stars 8 forks source link

Cannot reproduce the example #18

Closed moodymudskipper closed 1 year ago

moodymudskipper commented 4 years ago

Hi and thanks for the promising package. Unfortunately I can't reproduce the example from the README :

library(plantuml)
x <- '
(*) --> "Initialization"

if "Some Test" then
  -->[true] "Some Activity"
  --> "Another activity"
  -right-> (*)
else
  ->[false] "Something else"
  -->[Ending process] (*)
endif
'
x <- plantuml( 
  x
)

plot( 
  x = x
)
#> Warning in system2(command = java_bin, args = paste(java_opt, cmd,
#> plantuml_opt), : '"java"' not found
#> Warning in system(cmd, invisible = TRUE): 'gswin32c.exe' not found
#> Error in grImport::PostScriptTrace(file = fn, outfilename = fnrgl): status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -dNOSAFER -sDEVICE=ps2write -sOutputFile=C:\Users\Antoine\AppData\Local\Temp\RtmpgRKa9l\file56b0783ccda -sstdout=C:\Users\Antoine\AppData\Local\Temp\RtmpgRKa9l\file56b0363566d2.rgml C:\Users\Antoine\AppData\Local\Temp\RtmpgRKa9l\file56b0558746b6.ps'

plot( 
  x = x,
  vector = FALSE
)
#> Warning in system2(command = java_bin, args = paste(java_opt, cmd,
#> plantuml_opt), : '"java"' not found
#> Error in png::readPNG(fn, info = TRUE): file is not in PNG format

plot( 
  x, 
  file = "./README_files/test.svg" 
)
#> [1] 1

Created on 2020-08-29 by the reprex package (v0.3.0)

I see it might be due to java, and ghostscript, but I thought I'd describe the issue as I encountered it before changing anything on my system.


After installing java it still doesn't work but the output is a bit different :

library(plantuml)
x <- '
(*) --> "Initialization"

if "Some Test" then
  -->[true] "Some Activity"
  --> "Another activity"
  -right-> (*)
else
  ->[false] "Something else"
  -->[Ending process] (*)
endif
'
x <- plantuml( 
  x
)

plot( 
  x = x
)
#> Warning in system(cmd, invisible = TRUE): 'gswin32c.exe' not found
#> Error in grImport::PostScriptTrace(file = fn, outfilename = fnrgl): status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -dNOSAFER -sDEVICE=ps2write -sOutputFile=C:\Users\Antoine\AppData\Local\Temp\Rtmpq8f6kF\file19dc7d865ff8 -sstdout=C:\Users\Antoine\AppData\Local\Temp\Rtmpq8f6kF\file19dc5e1273aa.rgml C:\Users\Antoine\AppData\Local\Temp\Rtmpq8f6kF\file19dc2bb0440e.ps'

plot( 
  x = x,
  vector = FALSE
)

#> [1] 0

plot( 
  x, 
  file = "./README_files/test.svg" 
)
#> [1] 1

Created on 2020-08-29 by the reprex package (v0.3.0)


If I follow the suggestion in the image :

library(plantuml)
x <- "testdot"

x <- plantuml( 
  x
)
plot( 
  x = x,
  vector = FALSE
)

#> [1] 0

Created on 2020-08-29 by the reprex package (v0.3.0)

rkrug commented 4 years ago

This is likely a missing Ghostscript installation. Please check out the PlantUML site for hours to install all the dependencies under Windows.

If that does not help, please report back here.

Thanks.

Von meinem iPhone gesendet

Am 29.08.2020 um 16:50 schrieb Antoine Fabri notifications@github.com:

 Hi and thanks for the promising package. Unfortunately I can't reproduce the example from the README :

library(plantuml) x <- ' (*) --> "Initialization"

if "Some Test" then -->[true] "Some Activity" --> "Another activity" -right-> () else ->[false] "Something else" -->[Ending process] () endif ' x <- plantuml( x )

plot( x = x )

> Warning in system2(command = java_bin, args = paste(java_opt, cmd,

> plantuml_opt), : '"java"' not found

> Warning in system(cmd, invisible = TRUE): 'gswin32c.exe' not found

> Error in grImport::PostScriptTrace(file = fn, outfilename = fnrgl): status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -dNOSAFER -sDEVICE=ps2write -sOutputFile=C:\Users\Antoine\AppData\Local\Temp\RtmpgRKa9l\file56b0783ccda -sstdout=C:\Users\Antoine\AppData\Local\Temp\RtmpgRKa9l\file56b0363566d2.rgml C:\Users\Antoine\AppData\Local\Temp\RtmpgRKa9l\file56b0558746b6.ps'

plot( x = x, vector = FALSE )

> Warning in system2(command = java_bin, args = paste(java_opt, cmd,

> plantuml_opt), : '"java"' not found

> Error in png::readPNG(fn, info = TRUE): file is not in PNG format

plot( x, file = "./README_files/test.svg" )

> [1] 1

Created on 2020-08-29 by the reprex package (v0.3.0)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

moodymudskipper commented 4 years ago

I installed ghostscript, and also installed graphViz after seeing this :

https://github.com/de-jcup/eclipse-asciidoctor-editor/issues/47

After restarting computer :

library(plantuml)
x <- '
(*) --> "Initialization"

if "Some Test" then
  -->[true] "Some Activity"
  --> "Another activity"
  -right-> (*)
else
  ->[false] "Something else"
  -->[Ending process] (*)
endif
'
x <- plantuml( 
  x
)

plot( 
  x = x
)
#> Warning in system(cmd, invisible = TRUE): 'gswin32c.exe' not found
#> Error in grImport::PostScriptTrace(file = fn, outfilename = fnrgl): status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -dNOSAFER -sDEVICE=ps2write -sOutputFile=C:\Users\Antoine\AppData\Local\Temp\RtmpGG2AUZ\file3f2813897a0c -sstdout=C:\Users\Antoine\AppData\Local\Temp\RtmpGG2AUZ\file3f283d0d58.rgml C:\Users\Antoine\AppData\Local\Temp\RtmpGG2AUZ\file3f2848ab1674.ps'

plot( 
  x = x,
  vector = FALSE
)

image

#> [1] 0

Created on 2020-08-29 by the reprex package (v0.3.0)

If I do simplify it as suggested :

library(plantuml)
x <- 'Bob -> Alice: Hello!'
x <- plantuml( 
  x
)

plot( 
  x = x
)
#> Warning in system(cmd, invisible = TRUE): 'gswin32c.exe' not found
#> Error in grImport::PostScriptTrace(file = fn, outfilename = fnrgl): status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -dNOSAFER -sDEVICE=ps2write -sOutputFile=C:\Users\Antoine\AppData\Local\Temp\Rtmpagks4A\file330c220b1cc2 -sstdout=C:\Users\Antoine\AppData\Local\Temp\Rtmpagks4A\file330c32601078.rgml C:\Users\Antoine\AppData\Local\Temp\Rtmpagks4A\file330c76ac25d3.ps'

plot( 
  x = x,
  vector = FALSE
)

#> [1] 0

Created on 2020-08-29 by the reprex package (v0.3.0)

I don't know what to more to install from plantUML's website to solve this.

rkrug commented 4 years ago

Have you seen this: https://stackoverflow.com/questions/35256501/windows-rgrimport-ghostscript-error-status-127 ?

I do not have a windows computer at the moment, so I can't try.

Does it work, when you use plantuml from the command line (outside R)?

moodymudskipper commented 4 years ago

I've tried to do : Sys.setenv(R_GSCMD = normalizePath("C:/Program Files/gs/gs9.52/bin/gswin64c.exe")) (that's where my binaries are), and it changes the error for both your first example and my simplified example into :

plot( 
  x = x
)
#> ERROR
#> 3
#> Syntax Error?
#> Some diagram description contains errors
#> invalid character in attribute value
#> attributes construct error
#> Couldn't find end of Start Tag picture line 3
#> Extra content at the end of the document
#> Erreur : 1: invalid character in attribute value
#> 2: attributes construct error
#> 3: Couldn't find end of Start Tag picture line 3
#> 4: Extra content at the end of the document

I've yet to tried through command line

robozor commented 3 years ago

I have this ERROR too. Any help?

invalid character in attribute value attributes construct error Couldn't find end of Start Tag picture line 3 Extra content at the end of the document Error: 1: invalid character in attribute value 2: attributes construct error 3: Couldn't find end of Start Tag picture line 3 4: Extra content at the end of the document

rkrug commented 3 years ago

Can you produce the graph from the command line using plantuml? I do not have a windows computer at hand and I do not see the error on a Mac.

Please check

  1. to produce a plantuml graph from the command line, as described on the plantuml website.

If this works, try again fron R. If not, get in contact with the plantuml mailing list for help.

Could you please report back?

Thanks.

robozor commented 3 years ago

C:\Users\jsz\Documents>java -jar C:\Users\jsz\AppData\Local\R\cache\R\plantuml\jar\plantuml.jar -verbose sequenceDiagram.txt (0.000 - 123 Mo) 118 Mo - SecurityProfile LEGACY (0.014 - 123 Mo) 118 Mo - PlantUML Version 1.2020.19 (0.014 - 123 Mo) 118 Mo - GraphicsEnvironment.isHeadless() false (0.024 - 123 Mo) 118 Mo - Found 1 files (0.025 - 123 Mo) 118 Mo - Working on sequenceDiagram.txt (0.036 - 123 Mo) 117 Mo - Setting current dir: C:\Users\jsz\Documents. (0.037 - 123 Mo) 117 Mo - Setting current dir: C:\Users\jsz\Documents (0.037 - 123 Mo) 117 Mo - Using default charset (0.041 - 123 Mo) 117 Mo - Reading from sequenceDiagram.txt (0.077 - 123 Mo) 116 Mo - Reading file: sequenceDiagram.txt (0.213 - 123 Mo) 109 Mo - Compilation duration 132 (0.214 - 123 Mo) 109 Mo - Regex total/invoked/compiled 66/35/17 (0.214 - 123 Mo) 109 Mo - Matches created 6 (0.380 - 123 Mo) 103 Mo - Creating file: C:\Users\jsz\Documents\sequenceDiagram.png (0.411 - 123 Mo) 100 Mo - Creating image 115x135 (0.454 - 123 Mo) 99 Mo - Ok for com.sun.imageio.plugins.png.PNGMetadata (1.194 - 123 Mo) 98 Mo - File size : 2145 (1.195 - 123 Mo) 98 Mo - Number of image(s): 1

And image is OK sequenceDiagram

robozor commented 3 years ago

I try:

x <- datasets::mtcars umlvystup <- as.plantuml(x) plot(umlvystup) # I get error

extract plantuml code:

fileConn<-file("plantuml_vystup.txt") writeLines(c(umlvystup$code), fileConn) close(fileConn)

plantuml_vystup.txt

robozor commented 3 years ago

Test plantuml in "Confluence" software with extracted plantuml code "plantuml_vystup.txt"

image

robozor commented 3 years ago

And command line: C:\Users\jsz\Documents>java -jar C:\Users\jsz\AppData\Local\R\cache\R\plantuml\jar\plantuml.jar -verbose plantuml_vystup.txt (0.000 - 123 Mo) 118 Mo - SecurityProfile LEGACY (0.014 - 123 Mo) 118 Mo - PlantUML Version 1.2020.19 (0.015 - 123 Mo) 118 Mo - GraphicsEnvironment.isHeadless() false (0.022 - 123 Mo) 118 Mo - Found 1 files (0.022 - 123 Mo) 118 Mo - Working on plantuml_vystup.txt (0.035 - 123 Mo) 117 Mo - Setting current dir: C:\Users\jsz\Documents. (0.035 - 123 Mo) 117 Mo - Setting current dir: C:\Users\jsz\Documents (0.035 - 123 Mo) 117 Mo - Using default charset (0.040 - 123 Mo) 117 Mo - Reading from plantuml_vystup.txt (0.053 - 123 Mo) 117 Mo - Reading file: plantuml_vystup.txt (0.054 - 123 Mo) 117 Mo - Number of image(s): 0 Warning: no image in plantuml_vystup.txt No diagram found

robozor commented 3 years ago

Example from package (same error message) > x <- list(a = 1:10, b = letters[1:4], c = data.frame( x = 1:10, y = c(TRUE, FALSE) ) ) > x <- plantuml(x) > plot( x )

ERROR 2 Syntax Error? Some diagram description contains errors invalid character in attribute value attributes construct error Couldn't find end of Start Tag picture line 3 Extra content at the end of the document Error: 1: invalid character in attribute value 2: attributes construct error 3: Couldn't find end of Start Tag picture line 3 4: Extra content at the end of the document

ambica-aas commented 3 years ago

I try your "beta" :-)

C:\Program Files (x86)\Java\jre1.8.0_271\bin>java.exe -jar C:\Users\jsz.AMBICA\AppData\Local\R\cache\R\plantuml\beta\plantuml.jar -verbose C:\Users\jsz.AMBICA\Documents\GITHUBProjekty\R\namety\plantuml_vystup.txt (0.000 - 15 Mo) 12 Mo - SecurityProfile LEGACY (0.016 - 15 Mo) 12 Mo - PlantUML Version 1.2020.27beta5 (0.016 - 15 Mo) 12 Mo - GraphicsEnvironment.isHeadless() false (0.016 - 15 Mo) 11 Mo - Found 1 files (0.016 - 15 Mo) 11 Mo - Working on C:\Users\jsz.AMBICA\Documents\GITHUBProjekty\R\namety\plantuml_vystup.txt (0.047 - 15 Mo) 11 Mo - Setting current dir: C:\Program Files (x86)\Java\jre1.8.0_271\bin. (0.047 - 15 Mo) 11 Mo - Setting current dir: C:\Users\jsz.AMBICA\Documents\GITHUBProjekty\R\namety (0.047 - 15 Mo) 11 Mo - Using default charset (0.047 - 15 Mo) 11 Mo - Reading from plantuml_vystup.txt (0.062 - 15 Mo) 13 Mo - Reading file: C:\Users\jsz.AMBICA\Documents\GITHUBProjekty\R\namety\plantuml_vystup.txt (0.062 - 15 Mo) 13 Mo - Number of image(s): 0 Warning: no image in C:\Users\jsz.AMBICA\Documents\GITHUBProjekty\R\namety\plantuml_vystup.txt No diagram found

rkrug commented 3 years ago

@ambica-aas It seems you have a plantuml problem and not a problem with platuml in R?

If it is actually a problem with the R package plantuml, could you please open a new issue and post some reproducible code?

At the moment, I have no way of knowing what you did and therefore no way of even guessing what the problem is.

Just be aware, this is NOT the plantuml support - that one you can find at PlantUML Forum.

ambica-aas commented 3 years ago

OK, sorry.

ambica-aas commented 3 years ago

I've tried to do : Sys.setenv(R_GSCMD = normalizePath("C:/Program Files/gs/gs9.52/bin/gswin64c.exe")) (that's where my binaries are), and it changes the error for both your first example and my simplified example into :

plot( 
  x = x
)
#> ERROR
#> 3
#> Syntax Error?
#> Some diagram description contains errors
#> invalid character in attribute value
#> attributes construct error
#> Couldn't find end of Start Tag picture line 3
#> Extra content at the end of the document
#> Erreur : 1: invalid character in attribute value
#> 2: attributes construct error
#> 3: Couldn't find end of Start Tag picture line 3
#> 4: Extra content at the end of the document

I've yet to tried through command line

Try parameter "vector = FALSE") plot(x=x, vector = FALSE)

consultantleon commented 2 years ago

I found this issue and using the setting vector = FALSE seemed to solve the issue as @ambica-aas suggested. However I get a code box displayed under the picture with text "## [1] 0" , see picture :

image

Slowly getting to the point to give up on the idea to use inline plantuml code in R blocks now as I can't get it to display nicely. When I paste the uml on the plantuml site (//www.plantuml.com/plantuml) it displays cleanly without the extra text box...

rkrug commented 2 years ago

Thanks for your patience. I will see if I find some time to look into this next week.

Rainer

Sent from my iPhone

On 6 Jan 2022, at 18:16, consultantleon @.***> wrote:

 I found this issue and using the setting vector = FALSE seemed to solve the issue as @ambica-aas suggested. However I get a code box displayed under the picture with text "## [1] 0" , see picture :

Slowly getting to the point to give up on the idea to use inline plantuml code in R blocks now as I can't get it to display nicely. When I paste the uml on the plantuml site (//www.plantuml.com/plantuml) it displays cleanly without the extra text box...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

rkrug commented 1 year ago

Sorry for they slow responses. Could you please check if the errors still occurs using a release >= v.0.6.5 (from R-Universe at https://rkrug.r-universe.dev/plantuml or github)?

I made major changes in the use of plantuml an the handling of the plantuml graphs.

Thanks.

moodymudskipper commented 1 year ago

Thanks, I am now from a Mac but these work and a plot is displayed :

plot( 
  x = x
)

plot( 
  x = x,
  vector = FALSE
)

They return a path visibly though, should it be invisible ?

The last call fails however:

plot( 
  x, 
  file = "./README_files/test.svg" 
)
#> Warning in file.create(to[okay]): cannot create file './README_files/test.svg',
#> reason 'No such file or directory'
#> Error in read_data(svg): Argument 'svg' or 'css' must be a file path, url, or raw vector.

This also works as intended, I think :

suppressPackageStartupMessages(library(plantuml))
x <- "testdot"

x <- plantuml( 
  x
)
plot( 
  x = x,
  vector = FALSE
)

#> [1] "/var/folders/mp/qvg2y_jx63bgk_s0xxh2zr140000gp/T//RtmpptD7no/plantuml.e73c3ec6ceb8.svg"

Created on 2023-01-27 with reprex v2.0.2

And the Bob/Alice example works with and without vector = FALSE

rkrug commented 1 year ago

Could you please give me a reproducible example, so that we talk about the same "x"?

rkrug commented 1 year ago

Also: the argument vector is not used anymore. I should put in a warning.

moodymudskipper commented 1 year ago

Sure, it was the example from the top post, see below:

suppressPackageStartupMessages(library(plantuml))
x <- '
(*) --> "Initialization"

if "Some Test" then
  -->[true] "Some Activity"
  --> "Another activity"
  -right-> (*)
else
  ->[false] "Something else"
  -->[Ending process] (*)
endif
'
x <- plantuml( 
  x
)

plot( 
  x = x
)

#> [1] "/var/folders/mp/qvg2y_jx63bgk_s0xxh2zr140000gp/T//RtmpYmZxc2/plantuml.ec83443022cc.svg"

plot( 
  x, 
  file = "./README_files/test.svg" 
)
#> Warning in file.create(to[okay]): cannot create file './README_files/test.svg',
#> reason 'No such file or directory'
#> Error in read_data(svg): Argument 'svg' or 'css' must be a file path, url, or raw vector.

Created on 2023-01-27 with reprex v2.0.2

rkrug commented 1 year ago

Works for me without warnings. Could you try installing the dev version from GitHub and then try it again?

> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plantuml_0.6.6

loaded via a namespace (and not attached):
[1] compiler_4.2.2  tools_4.2.2     rstudioapi_0.14 rsvg_2.4.0      knitr_1.41      xfun_0.36      
[7] jsonlite_1.8.4 
> 
moodymudskipper commented 1 year ago

Just retried it, I still get the warning, with session info this time:

devtools::install_github("https://github.com/rkrug/plantuml")
#> Using github PAT from envvar GITHUB_PAT
#> Downloading GitHub repo rkrug/plantuml@HEAD
#> 
#> * checking for file ‘/private/var/folders/mp/qvg2y_jx63bgk_s0xxh2zr140000gp/T/RtmpBDfInD/remotes165f22a933df4/rkrug-plantuml-27ba548/DESCRIPTION’ ... OK
#> * preparing ‘plantuml’:
#> * checking DESCRIPTION meta-information ... OK
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * building ‘plantuml_0.6.7.tar.gz’
#> Installing package into '/Users/Antoine/Library/R/arm64/4.2/library'
#> (as 'lib' is unspecified)
suppressPackageStartupMessages(library(plantuml))
x <- '
(*) --> "Initialization"

if "Some Test" then
  -->[true] "Some Activity"
  --> "Another activity"
  -right-> (*)
else
  ->[false] "Something else"
  -->[Ending process] (*)
endif
'
x <- plantuml( 
  x
)

plot( 
  x, 
  file = "./README_files/test.svg" 
)
#> Warning in file.create(to[okay]): cannot create file './README_files/test.svg',
#> reason 'No such file or directory'
#> Error in read_data(svg): Argument 'svg' or 'css' must be a file path, url, or raw vector.

Created on 2023-02-01 with reprex v2.0.2

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.2.1 (2022-06-23) #> os macOS Monterey 12.0.1 #> system aarch64, darwin20 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Europe/Zurich #> date 2023-02-01 #> pandoc 2.19.2 @ /Applications/RStudio.app/Contents/MacOS/quarto/bin/tools/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> cachem 1.0.6 2021-08-19 [1] CRAN (R 4.2.0) #> callr 3.7.2 2022-08-22 [1] CRAN (R 4.2.0) #> cli 3.4.1 2022-09-23 [1] CRAN (R 4.2.0) #> crayon 1.5.2 2022-09-29 [1] CRAN (R 4.1.1) #> curl 4.3.3 2022-10-06 [1] CRAN (R 4.2.0) #> devtools 2.4.4 2022-07-20 [1] CRAN (R 4.2.0) #> digest 0.6.29 2021-12-01 [1] CRAN (R 4.2.0) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.2.0) #> evaluate 0.17 2022-10-07 [1] CRAN (R 4.2.0) #> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.2.0) #> fs 1.5.2 2021-12-08 [1] CRAN (R 4.2.0) #> glue 1.6.2 2022-02-24 [1] CRAN (R 4.2.0) #> highr 0.9 2021-04-16 [1] CRAN (R 4.2.0) #> htmltools 0.5.4 2022-12-07 [1] CRAN (R 4.2.0) #> htmlwidgets 1.6.1 2023-01-07 [1] CRAN (R 4.2.0) #> httpuv 1.6.6 2022-09-08 [1] CRAN (R 4.2.0) #> jsonlite 1.8.4 2022-12-06 [1] CRAN (R 4.2.0) #> knitr 1.40 2022-08-24 [1] CRAN (R 4.2.0) #> later 1.3.0 2021-08-18 [1] CRAN (R 4.2.0) #> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.2.0) #> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.0) #> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.2.0) #> mime 0.12 2021-09-28 [1] CRAN (R 4.2.0) #> miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.2.0) #> pkgbuild 1.3.1 2021-12-20 [1] CRAN (R 4.2.0) #> pkgload 1.3.0 2022-06-27 [1] CRAN (R 4.1.1) #> plantuml * 0.6.7 2023-02-01 [1] Github (rkrug/plantuml@27ba548) #> png 0.1-8 2022-11-29 [1] CRAN (R 4.2.0) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.2.0) #> processx 3.7.0 2022-07-07 [1] CRAN (R 4.2.0) #> profvis 0.3.7 2020-11-02 [1] CRAN (R 4.2.0) #> promises 1.2.0.1 2021-02-11 [1] CRAN (R 4.2.0) #> ps 1.7.1 2022-06-18 [1] CRAN (R 4.2.0) #> purrr 0.3.5 2022-10-06 [1] CRAN (R 4.2.0) #> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.1.1) #> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.1.1) #> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.1.1) #> R.utils 2.12.0 2022-06-28 [1] CRAN (R 4.1.1) #> R6 2.5.1 2021-08-19 [1] CRAN (R 4.2.0) #> Rcpp 1.0.9 2022-07-08 [1] CRAN (R 4.2.0) #> remotes 2.4.2 2021-11-30 [1] CRAN (R 4.2.0) #> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.2.0) #> rlang 1.0.6.9000 2022-11-22 [1] Github (r-lib/rlang@7ab31df) #> rmarkdown 2.20 2023-01-19 [1] CRAN (R 4.2.0) #> rprojroot 2.0.3 2022-04-02 [1] CRAN (R 4.2.0) #> rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.2.0) #> rsvg 2.4.0 2022-11-21 [1] CRAN (R 4.2.0) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.2.0) #> shiny 1.7.2 2022-07-19 [1] CRAN (R 4.2.0) #> stringi 1.7.8 2022-07-11 [1] CRAN (R 4.2.0) #> stringr 1.4.1.9000 2022-11-07 [1] Github (tidyverse/stringr@f482fb0) #> styler 1.8.0 2022-10-22 [1] CRAN (R 4.2.0) #> urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.2.0) #> usethis 2.1.6 2022-05-25 [1] CRAN (R 4.2.0) #> vctrs 0.5.1 2022-11-16 [1] CRAN (R 4.2.0) #> withr 2.5.0 2022-03-03 [1] CRAN (R 4.2.0) #> xfun 0.36 2022-12-21 [1] CRAN (R 4.2.0) #> xtable 1.8-4 2019-04-21 [1] CRAN (R 4.2.0) #> yaml 2.3.5 2022-02-21 [1] CRAN (R 4.2.0) #> #> [1] /Users/Antoine/Library/R/arm64/4.2/library #> [2] /opt/R/4.2.1-arm64/Resources/library #> #> ────────────────────────────────────────────────────────────────────────────── ```
rkrug commented 1 year ago

could you try running dir.create("./README_files") before running the example?

rkrug commented 1 year ago

And also:

server_status()
server_info()

So that we see which server is used (should be the web server)

> server_status()
http://www.plantuml.com/plantuml/ 
                                2 
> server_info()
$version
[1] "1.2023.1beta4"

$PicoWebServer
[1] FALSE

$formats
[1] "png" "svg" "txt"

> 
moodymudskipper commented 1 year ago

This does indeed remove the warning :

suppressPackageStartupMessages(library(plantuml))
x <- '
(*) --> "Initialization"

if "Some Test" then
  -->[true] "Some Activity"
  --> "Another activity"
  -right-> (*)
else
  ->[false] "Something else"
  -->[Ending process] (*)
endif
'
x <- plantuml( 
  x
)

dir.create("./README_files")

plot( 
  x, 
  file = "./README_files/test.svg" 
)

#> [1] "./README_files/test.svg"

plantuml::server_status()
#> http://www.plantuml.com/plantuml/ 
#>                                 2
plantuml::server_info()
#> $version
#> [1] "1.2023.1beta4"
#> 
#> $PicoWebServer
#> [1] FALSE
#> 
#> $formats
#> [1] "png" "svg" "txt"

Created on 2023-02-01 with reprex v2.0.2

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.2.1 (2022-06-23) #> os macOS Monterey 12.0.1 #> system aarch64, darwin20 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Europe/Zurich #> date 2023-02-01 #> pandoc 2.19.2 @ /Applications/RStudio.app/Contents/MacOS/quarto/bin/tools/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> cli 3.4.1 2022-09-23 [1] CRAN (R 4.2.0) #> curl 4.3.3 2022-10-06 [1] CRAN (R 4.2.0) #> digest 0.6.29 2021-12-01 [1] CRAN (R 4.2.0) #> evaluate 0.17 2022-10-07 [1] CRAN (R 4.2.0) #> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.2.0) #> fs 1.5.2 2021-12-08 [1] CRAN (R 4.2.0) #> glue 1.6.2 2022-02-24 [1] CRAN (R 4.2.0) #> highr 0.9 2021-04-16 [1] CRAN (R 4.2.0) #> htmltools 0.5.4 2022-12-07 [1] CRAN (R 4.2.0) #> httr 1.4.4 2022-08-17 [1] CRAN (R 4.2.0) #> jsonlite 1.8.4 2022-12-06 [1] CRAN (R 4.2.0) #> knitr 1.40 2022-08-24 [1] CRAN (R 4.2.0) #> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.2.0) #> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.0) #> mime 0.12 2021-09-28 [1] CRAN (R 4.2.0) #> plantuml * 0.6.7 2023-02-01 [1] Github (rkrug/plantuml@27ba548) #> png 0.1-8 2022-11-29 [1] CRAN (R 4.2.0) #> purrr 0.3.5 2022-10-06 [1] CRAN (R 4.2.0) #> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.1.1) #> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.1.1) #> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.1.1) #> R.utils 2.12.0 2022-06-28 [1] CRAN (R 4.1.1) #> R6 2.5.1 2021-08-19 [1] CRAN (R 4.2.0) #> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.2.0) #> rlang 1.0.6.9000 2022-11-22 [1] Github (r-lib/rlang@7ab31df) #> rmarkdown 2.20 2023-01-19 [1] CRAN (R 4.2.0) #> rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.2.0) #> rsvg 2.4.0 2022-11-21 [1] CRAN (R 4.2.0) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.2.0) #> stringi 1.7.8 2022-07-11 [1] CRAN (R 4.2.0) #> stringr 1.4.1.9000 2022-11-07 [1] Github (tidyverse/stringr@f482fb0) #> styler 1.8.0 2022-10-22 [1] CRAN (R 4.2.0) #> vctrs 0.5.1 2022-11-16 [1] CRAN (R 4.2.0) #> withr 2.5.0 2022-03-03 [1] CRAN (R 4.2.0) #> xfun 0.36 2022-12-21 [1] CRAN (R 4.2.0) #> xml2 1.3.3 2021-11-30 [1] CRAN (R 4.2.0) #> yaml 2.3.5 2022-02-21 [1] CRAN (R 4.2.0) #> #> [1] /Users/Antoine/Library/R/arm64/4.2/library #> [2] /opt/R/4.2.1-arm64/Resources/library #> #> ────────────────────────────────────────────────────────────────────────────── ```
rkrug commented 1 year ago

OK - I thought that I put in a dir.create() to create the directory - thanks for your help, I will fix this in the next release.