Closed moodymudskipper closed 1 year 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.
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
)
#> [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.
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)?
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
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
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
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.
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
x <- datasets::mtcars umlvystup <- as.plantuml(x) plot(umlvystup) # I get error
fileConn<-file("plantuml_vystup.txt") writeLines(c(umlvystup$code), fileConn) close(fileConn)
Test plantuml in "Confluence" software with extracted plantuml code "plantuml_vystup.txt"
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
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
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
@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.
OK, sorry.
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)
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...
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.
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.
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
Could you please give me a reproducible example, so that we talk about the same "x"?
Also: the argument vector
is not used anymore. I should put in a warning.
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
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
>
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
could you try running dir.create("./README_files")
before running the example?
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"
>
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
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.
Hi and thanks for the promising package. Unfortunately I can't reproduce the example from the README :
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 :
Created on 2020-08-29 by the reprex package (v0.3.0)
If I follow the suggestion in the image :
Created on 2020-08-29 by the reprex package (v0.3.0)