DiagrammeR icon indicating copy to clipboard operation
DiagrammeR copied to clipboard

Node shape 'note' isn't working / not showing

Open lsbjordao opened this issue 3 years ago • 3 comments

Hi!! I tested all node shapes and they are shown, but the 'note' isn't. Maybe that can be fixed.

Best,

lsbjordao avatar Jul 02 '21 04:07 lsbjordao

is this the list of shapes from: https://graphviz.org/doc/info/shapes.html ?

AlexAxthelm avatar Jan 04 '22 18:01 AlexAxthelm

Hi Alex! Yes, I tested these shapes, and all are showing correctly in DiagrammeR, but "note" isn't.

lsbjordao avatar Jan 04 '22 21:01 lsbjordao

I can confirm this behavior. It looks like there are also issues with restrictionsite (no shape) and point (no label)

image

library("DiagrammeR")

columns  <- 5

shapes <- c(
  "box",
  "polygon",
  "ellipse",
  "oval",
  "circle",
  "point",
  "egg",
  "triangle",
  "plaintext",
  "plain",
  "diamond",
  "trapezium",
  "parallelogram",
  "house",
  "pentagon",
  "hexagon",
  "septagon",
  "octagon",
  "doublecircle",
  "doubleoctagon",
  "tripleoctagon",
  "invtriangle",
  "invtrapezium",
  "invhouse",
  "Mdiamond",
  "Msquare",
  "Mcircle",
  "rect",
  "rectangle",
  "square",
  "star",
  "none",
  "underline",
  "cylinder",
  "note",
  "tab",
  "folder",
  "box3d",
  "component",
  "promoter",
  "cds",
  "terminator",
  "utr",
  "primersite",
  "restrictionsite",
  "fivepoverhang",
  "threepoverhang",
  "noverhang",
  "assembly",
  "signature",
  "insulator",
  "ribosite",
  "rnastab",
  "proteasesite",
  "proteinstab",
  "rpromoter",
  "rarrow",
  "larrow",
  "lpromoter"
)

ndf <- create_node_df(
  n = length(shapes),
  label = shapes,
  shape = shapes
) %>%
  dplyr::mutate(
    x = (id %% columns),
    y = floor(id / columns)
  )

create_graph(nodes_df = ndf)
#> DiagrammeR Graph // 59 nodes
#>   -- directed / disconnected / DAG / simple
#> 
#>   NODES / type: <unused> / label: 59 vals - complete & unique
#>     -- 3 additional node attributes (shape, x, y)
#>   EDGES / rel: <unused>                                    info: `get_edge_df()`
#>     -- no additional edge attributes
#>   SELECTION / <none>
#>   CACHE / <none>
#>   GLOBAL ATTRS / 17 are set                 info: `get_global_graph_attr_info()`
#>   GRAPH ACTIONS / <none>
#>   GRAPH LOG / create_graph()

Created on 2022-01-05 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.3 (2020-10-10)
#>  os       macOS Catalina 10.15.7      
#>  system   x86_64, darwin19.6.0        
#>  ui       unknown                     
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       Europe/Belgrade             
#>  date     2022-01-05                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package      * version date       lib source        
#>  assertthat     0.2.1   2019-03-21 [1] CRAN (R 4.0.3)
#>  cachem         1.0.4   2021-02-13 [1] CRAN (R 4.0.3)
#>  callr          3.7.0   2021-04-20 [1] CRAN (R 4.0.3)
#>  cli            3.1.0   2021-10-27 [1] CRAN (R 4.0.3)
#>  crayon         1.4.1   2021-02-08 [1] CRAN (R 4.0.3)
#>  DBI            1.1.1   2021-01-15 [1] CRAN (R 4.0.3)
#>  desc           1.4.0   2021-09-28 [1] CRAN (R 4.0.3)
#>  devtools       2.4.2   2021-06-07 [1] CRAN (R 4.0.3)
#>  DiagrammeR   * 1.0.6.1 2020-05-08 [1] CRAN (R 4.0.3)
#>  digest         0.6.27  2020-10-24 [1] CRAN (R 4.0.3)
#>  dplyr          1.0.7   2021-06-18 [1] CRAN (R 4.0.3)
#>  ellipsis       0.3.2   2021-04-29 [1] CRAN (R 4.0.3)
#>  evaluate       0.14    2019-05-28 [1] CRAN (R 4.0.3)
#>  fansi          0.4.2   2021-01-15 [1] CRAN (R 4.0.3)
#>  fastmap        1.1.0   2021-01-25 [1] CRAN (R 4.0.3)
#>  fs             1.5.0   2020-07-31 [1] CRAN (R 4.0.3)
#>  generics       0.1.0   2020-10-31 [1] CRAN (R 4.0.3)
#>  glue           1.5.0   2021-11-07 [1] CRAN (R 4.0.3)
#>  highr          0.8     2019-03-20 [1] CRAN (R 4.0.3)
#>  htmltools      0.5.2   2021-08-25 [1] CRAN (R 4.0.3)
#>  htmlwidgets    1.5.3   2020-12-10 [1] CRAN (R 4.0.3)
#>  igraph         1.2.7   2021-10-15 [1] CRAN (R 4.0.3)
#>  jsonlite       1.7.2   2020-12-09 [1] CRAN (R 4.0.3)
#>  knitr          1.33    2021-04-24 [1] CRAN (R 4.0.3)
#>  lifecycle      1.0.0   2021-02-15 [1] CRAN (R 4.0.3)
#>  magrittr       2.0.1   2020-11-17 [1] CRAN (R 4.0.3)
#>  memoise        2.0.0   2021-01-26 [1] CRAN (R 4.0.3)
#>  pillar         1.6.4   2021-10-18 [1] CRAN (R 4.0.3)
#>  pkgbuild       1.2.0   2020-12-15 [1] CRAN (R 4.0.3)
#>  pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.0.3)
#>  pkgload        1.2.3   2021-10-13 [1] CRAN (R 4.0.3)
#>  prettyunits    1.1.1   2020-01-24 [1] CRAN (R 4.0.3)
#>  processx       3.5.2   2021-04-30 [1] CRAN (R 4.0.3)
#>  ps             1.5.0   2020-12-05 [1] CRAN (R 4.0.3)
#>  purrr          0.3.4   2020-04-17 [1] CRAN (R 4.0.3)
#>  R6             2.5.0   2020-10-28 [1] CRAN (R 4.0.3)
#>  RColorBrewer   1.1-2   2014-12-07 [1] CRAN (R 4.0.3)
#>  remotes        2.4.1   2021-09-29 [1] CRAN (R 4.0.3)
#>  rlang          0.4.12  2021-10-18 [1] CRAN (R 4.0.3)
#>  rmarkdown      2.11    2021-09-14 [1] CRAN (R 4.0.3)
#>  rprojroot      2.0.2   2020-11-15 [1] CRAN (R 4.0.3)
#>  rstudioapi     0.13    2020-11-12 [1] CRAN (R 4.0.3)
#>  sessioninfo    1.1.1   2018-11-05 [1] CRAN (R 4.0.3)
#>  stringi        1.5.3   2020-09-09 [1] CRAN (R 4.0.3)
#>  stringr        1.4.0   2019-02-10 [1] CRAN (R 4.0.3)
#>  testthat       3.1.0   2021-10-04 [1] CRAN (R 4.0.3)
#>  tibble         3.1.6   2021-11-07 [1] CRAN (R 4.0.3)
#>  tidyselect     1.1.1   2021-04-30 [1] CRAN (R 4.0.3)
#>  usethis        2.0.1   2021-02-10 [1] CRAN (R 4.0.3)
#>  utf8           1.1.4   2018-05-24 [1] CRAN (R 4.0.3)
#>  vctrs          0.3.8   2021-04-29 [1] CRAN (R 4.0.3)
#>  visNetwork     2.1.0   2021-09-29 [1] CRAN (R 4.0.3)
#>  withr          2.4.2   2021-04-18 [1] CRAN (R 4.0.3)
#>  xfun           0.27    2021-10-18 [1] CRAN (R 4.0.3)
#>  yaml           2.2.1   2020-02-01 [1] CRAN (R 4.0.3)
#> 
#> [1] /usr/local/Cellar/r/4.0.3/lib/R/library

AlexAxthelm avatar Jan 05 '22 11:01 AlexAxthelm