Comments (5)
Hmm thats weird. Can you try with image_read_svg()
from magick.
Thanks for the quick response, this results in the following error:
#> Error in path.expand(path): invalid 'path' argument
# install.packages(c("DiagrammeR", "DiagrammeRsvg", "magick"))
diagram <- "
digraph {
graph [layout = dot, rankdir = LR]
A -> B
B -> C
B -> D
}
"
diagram |>
DiagrammeR::grViz() |>
DiagrammeRsvg::export_svg() |>
charToRaw() |>
magick::image_read_svg()
#> Error in path.expand(path): invalid 'path' argument
Created on 2023-08-11 with reprex v2.0.2
Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.1 (2023-06-16 ucrt)
#> os Windows 11 x64 (build 22621)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate Dutch_Netherlands.utf8
#> ctype Dutch_Netherlands.utf8
#> tz Europe/Amsterdam
#> date 2023-08-11
#> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> cli 3.6.1 2023-03-23 [1] CRAN (R 4.3.1)
#> curl 5.0.1 2023-06-07 [1] CRAN (R 4.3.1)
#> DiagrammeR 1.0.10 2023-05-18 [1] CRAN (R 4.3.1)
#> DiagrammeRsvg 0.1 2016-02-04 [1] CRAN (R 4.3.1)
#> digest 0.6.33 2023-07-07 [1] CRAN (R 4.3.1)
#> evaluate 0.21 2023-05-05 [1] CRAN (R 4.3.1)
#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.1)
#> fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.1)
#> glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.1)
#> htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.3.1)
#> htmlwidgets 1.6.2 2023-03-17 [1] CRAN (R 4.3.1)
#> jsonlite 1.8.7 2023-06-29 [1] CRAN (R 4.3.1)
#> knitr 1.43 2023-05-25 [1] RSPM (R 4.3.0)
#> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.1)
#> magick 2.7.5 2023-08-07 [1] CRAN (R 4.3.1)
#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.1)
#> purrr 1.0.1 2023-01-10 [1] CRAN (R 4.3.1)
#> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.3.1)
#> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.3.0)
#> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.3.0)
#> R.utils 2.12.2 2022-11-11 [1] CRAN (R 4.3.1)
#> RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.3.0)
#> Rcpp 1.0.11 2023-07-06 [1] CRAN (R 4.3.1)
#> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.3.1)
#> rlang 1.1.1 2023-04-28 [1] CRAN (R 4.3.1)
#> rmarkdown 2.23 2023-07-01 [1] CRAN (R 4.3.1)
#> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.1)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.1)
#> styler 1.10.1 2023-06-05 [1] CRAN (R 4.3.1)
#> V8 4.3.3 2023-07-18 [1] CRAN (R 4.3.1)
#> vctrs 0.6.3 2023-06-14 [1] CRAN (R 4.3.1)
#> visNetwork 2.1.2 2022-09-29 [1] CRAN (R 4.3.1)
#> withr 2.5.0 2022-03-03 [1] CRAN (R 4.3.1)
#> xfun 0.39 2023-04-20 [1] CRAN (R 4.3.1)
#> yaml 2.3.7 2023-01-23 [1] CRAN (R 4.3.0)
#>
#> [1] C:/R/R-4.3.1/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
bitmap <- diagram |>
DiagrammeR::grViz() |>
DiagrammeRsvg::export_svg() |>
charToRaw()
class(bitmap)
#> [1] "raw"
from magick.
It works (without the charToRaw) on MacOS:
diagram |>
DiagrammeR::grViz() |>
DiagrammeRsvg::export_svg() |>
magick::image_read_svg()
from magick.
It works on Windows too, thank you.
# install.packages(c("DiagrammeR", "DiagrammeRsvg", "magick"))
diagram <- "
digraph {
graph [layout = dot, rankdir = LR]
A -> B
B -> C
B -> D
}
"
diagram |>
DiagrammeR::grViz() |>
DiagrammeRsvg::export_svg() |>
magick::image_read_svg()
Created on 2023-08-11 with reprex v2.0.2
Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.1 (2023-06-16 ucrt)
#> os Windows 11 x64 (build 22621)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate Dutch_Netherlands.utf8
#> ctype Dutch_Netherlands.utf8
#> tz Europe/Amsterdam
#> date 2023-08-11
#> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> cli 3.6.1 2023-03-23 [1] CRAN (R 4.3.1)
#> curl 5.0.1 2023-06-07 [1] CRAN (R 4.3.1)
#> DiagrammeR 1.0.10 2023-05-18 [1] CRAN (R 4.3.1)
#> DiagrammeRsvg 0.1 2016-02-04 [1] CRAN (R 4.3.1)
#> digest 0.6.33 2023-07-07 [1] CRAN (R 4.3.1)
#> evaluate 0.21 2023-05-05 [1] CRAN (R 4.3.1)
#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.1)
#> fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.1)
#> glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.1)
#> highr 0.10 2022-12-22 [1] CRAN (R 4.3.1)
#> htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.3.1)
#> htmlwidgets 1.6.2 2023-03-17 [1] CRAN (R 4.3.1)
#> jsonlite 1.8.7 2023-06-29 [1] CRAN (R 4.3.1)
#> knitr 1.43 2023-05-25 [1] RSPM (R 4.3.0)
#> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.1)
#> magick 2.7.5 2023-08-07 [1] CRAN (R 4.3.1)
#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.1)
#> png 0.1-8 2022-11-29 [1] CRAN (R 4.3.0)
#> purrr 1.0.1 2023-01-10 [1] CRAN (R 4.3.1)
#> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.3.1)
#> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.3.0)
#> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.3.0)
#> R.utils 2.12.2 2022-11-11 [1] CRAN (R 4.3.1)
#> RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.3.0)
#> Rcpp 1.0.11 2023-07-06 [1] CRAN (R 4.3.1)
#> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.3.1)
#> rlang 1.1.1 2023-04-28 [1] CRAN (R 4.3.1)
#> rmarkdown 2.23 2023-07-01 [1] CRAN (R 4.3.1)
#> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.1)
#> rsvg 2.4.0 2022-11-21 [1] CRAN (R 4.3.1)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.1)
#> styler 1.10.1 2023-06-05 [1] CRAN (R 4.3.1)
#> V8 4.3.3 2023-07-18 [1] CRAN (R 4.3.1)
#> vctrs 0.6.3 2023-06-14 [1] CRAN (R 4.3.1)
#> visNetwork 2.1.2 2022-09-29 [1] CRAN (R 4.3.1)
#> withr 2.5.0 2022-03-03 [1] CRAN (R 4.3.1)
#> xfun 0.39 2023-04-20 [1] CRAN (R 4.3.1)
#> xml2 1.3.5 2023-07-06 [1] CRAN (R 4.3.1)
#> yaml 2.3.7 2023-01-23 [1] CRAN (R 4.3.0)
#>
#> [1] C:/R/R-4.3.1/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
Although I'm still a little confused as to why the update to libmagick 6.9.12-93 breaks the use of magick::image_read()
in this case.
from magick.
Although I'm still a little confused as to why the update to libmagick 6.9.12-93 breaks the use of magick::image_read() in this case.
Yes me too, I'm opening a new issue about this: #380
from magick.
Related Issues (20)
- hexlogo.png is missing
- librsvg delegate broken on Windows HOT 13
- image_composite "reflects" image position when offset moves composite_image out of area of image HOT 2
- CRAN incoming checks fail due to magick's usage of more than 2 cores HOT 6
- image in (kable) table HOT 1
- Attempt to perform an operation not allowed by the security policy `PDF' HOT 5
- Where to find policy.xml used by magick on osx? HOT 2
- Wrappers for opencv functions
- Dplyr/tidyverse verbs do not work with magick-image tibbles. HOT 4
- Looping mutates HOT 1
- dng pitcure to jpg HOT 2
- image_annotate(): Get available fonts HOT 6
- Support listing other types of options HOT 2
- Comparison warning when compiling options.cpp
- Error: package or namespace load failed for ‘magick’ in dyn.load(file, DLLpath = DLLpath, ...):
- Error message: PDF Error: Unexpected MC Type: 7 HOT 5
- The problem of not installing in anaconda HOT 2
- image_read fails to execute `gs` on Windows for reading PDF HOT 7
- `image_splice()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magick.