jbkunst / highcharter

R wrapper for highcharts
http://jkunst.com/highcharter/
Other
723 stars 150 forks source link

Networkgraph #696

Closed robertogilsaura closed 2 years ago

robertogilsaura commented 3 years ago

Can anyone help me?

I will try reproduce this chart from Highcharts networkgraph proto-language but I can't do it. Blank screen, only title and subtitle are printed.

sessionInfo() R version 4.0.3 (2020-10-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale: [1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252 [4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252

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

other attached packages: [1] highcharter_0.8.2.9000 dplyr_1.0.3

loaded via a namespace (and not attached): [1] Rcpp_1.0.6 compiler_4.0.3 pillar_1.4.7 xts_0.12.1 prettyunits_1.1.1 [6] remotes_2.2.0 tools_4.0.3 digest_0.6.27 pkgbuild_1.2.0 lattice_0.20-41
[11] lubridate_1.7.9.2 jsonlite_1.7.2 lifecycle_0.2.0 tibble_3.0.6 pkgconfig_2.0.3
[16] rlang_0.4.10 igraph_1.2.6 cli_2.3.0 DBI_1.1.1 rstudioapi_0.13
[21] yaml_2.2.1 curl_4.3 xfun_0.20 stringr_1.4.0 withr_2.4.1
[26] htmlwidgets_1.5.3 generics_0.1.0 vctrs_0.3.6 grid_4.0.3 rprojroot_2.0.2
[31] tidyselect_1.1.0 data.table_1.13.6 glue_1.4.2 R6_2.5.0 processx_3.4.5
[36] TTR_0.24.2 callr_3.5.1 purrr_0.3.4 tidyr_1.1.2 magrittr_2.0.1
[41] backports_1.2.1 ps_1.5.0 ellipsis_0.3.1 htmltools_0.5.1.1 rlist_0.4.6.1
[46] quantmod_0.4.18 assertthat_0.2.1 tinytex_0.29 stringi_1.5.3 broom_0.7.4
[51] crayon_1.4.0 zoo_1.8-8

library(highcharter)
highchart() %>%
     hc_add_dependency(name='modules/networkgraph.js') %>%
     hc_chart(type = 'networkgraph') %>%
     hc_title(text='The Indo-European Language Tree') %>%
     hc_subtitle(text='A Force-Directed Network Graph in Highcharts') %>%
     hc_plotOptions(networkgraph=list(keys=c('from', 'to'),layoutAlgorithm=list(enableSimulation =  TRUE,friction = -0.9))) %>%
     hc_series(dataLabels=list(enabled=TRUE,linkFormat = ''),
               id ='lang-tree',
               data=list(
                    c('Proto Indo-European', 'Balto-Slavic'),
                    c('Proto Indo-European', 'Germanic'),
                    c('Proto Indo-European', 'Celtic'),
                    c('Proto Indo-European', 'Italic'),
                    c('Proto Indo-European', 'Hellenic'),
                    c('Proto Indo-European', 'Anatolian'),
                    c('Proto Indo-European', 'Indo-Iranian'),
                    c('Proto Indo-European', 'Tocharian'),
                    c('Indo-Iranian', 'Dardic'),
                    c('Indo-Iranian', 'Indic'),
                    c('Indo-Iranian', 'Iranian'),
                    c('Iranian', 'Old Persian'),
                    c('Old Persian', 'Middle Persian'),
                    c('Indic', 'Sanskrit'),
                    c('Italic', 'Osco-Umbrian'),
                    c('Italic', 'Latino-Faliscan'),
                    c('Latino-Faliscan', 'Latin'),
                    c('Celtic', 'Brythonic'),
                    c('Celtic', 'Goidelic'),
                    c('Germanic', 'North Germanic'),
                    c('Germanic', 'West Germanic'),
                    c('Germanic', 'East Germanic'),
                    c('North Germanic', 'Old Norse'),
                    c('North Germanic', 'Old Swedish'),
                    c('North Germanic', 'Old Danish'),
                    c('West Germanic', 'Old English'),
                    c('West Germanic', 'Old Frisian'),
                    c('West Germanic', 'Old Dutch'),
                    c('West Germanic', 'Old Low German'),
                    c('West Germanic', 'Old High German'),
                    c('Old Norse', 'Old Icelandic'),
                    c('Old Norse', 'Old Norwegian'),
                    c('Old Norwegian', 'Middle Norwegian'),
                    c('Old Swedish', 'Middle Swedish'),
                    c('Old Danish', 'Middle Danish'),
                    c('Old English', 'Middle English'),
                    c('Old Dutch', 'Middle Dutch'),
                    c('Old Low German', 'Middle Low German'),
                    c('Old High German', 'Middle High German'),
                    c('Balto-Slavic', 'Baltic'),
                    c('Balto-Slavic', 'Slavic'),
                    c('Slavic', 'East Slavic'),
                    c('Slavic', 'West Slavic'),
                    c('Slavic', 'South Slavic'),
                    c('Proto Indo-European', 'Phrygian'),
                    c('Proto Indo-European', 'Armenian'),
                    c('Proto Indo-European', 'Albanian'),
                    c('Proto Indo-European', 'Thracian'),
                    c('Tocharian', 'Tocharian A'),
                    c('Tocharian', 'Tocharian B'),
                    c('Anatolian', 'Hittite'),
                    c('Anatolian', 'Palaic'),
                    c('Anatolian', 'Luwic'),
                    c('Anatolian', 'Lydian'),
                    c('Iranian', 'Balochi'),
                    c('Iranian', 'Kurdish'),
                    c('Iranian', 'Pashto'),
                    c('Iranian', 'Sogdian'),
                    c('Old Persian', 'Pahlavi'),
                    c('Middle Persian', 'Persian'),
                    c('Hellenic', 'Greek'),
                    c('Dardic', 'Dard'),
                    c('Sanskrit', 'Sindhi'),
                    c('Sanskrit', 'Romani'),
                    c('Sanskrit', 'Urdu'),
                    c('Sanskrit', 'Hindi'),
                    c('Sanskrit', 'Bihari'),
                    c('Sanskrit', 'Assamese'),
                    c('Sanskrit', 'Bengali'),
                    c('Sanskrit', 'Marathi'),
                    c('Sanskrit', 'Gujarati'),
                    c('Sanskrit', 'Punjabi'),
                    c('Sanskrit', 'Sinhalese'),
                    c('Osco-Umbrian', 'Umbrian'),
                    c('Osco-Umbrian', 'Oscan'),
                    c('Latino-Faliscan', 'Faliscan'),
                    c('Latin', 'Portugese'),
                    c('Latin', 'Spanish'),
                    c('Latin', 'French'),
                    c('Latin', 'Romanian'),
                    c('Latin', 'Italian'),
                    c('Latin', 'Catalan'),
                    c('Latin', 'Franco-Provençal'),
                    c('Latin', 'Rhaeto-Romance'),
                    c('Brythonic', 'Welsh'),
                    c('Brythonic', 'Breton'),
                    c('Brythonic', 'Cornish'),
                    c('Brythonic', 'Cuymbric'),
                    c('Goidelic', 'Modern Irish'),
                    c('Goidelic', 'Scottish Gaelic'),
                    c('Goidelic', 'Manx'),
                    c('East Germanic', 'Gothic'),
                    c('Middle Low German', 'Low German'),
                    c('Middle High German', '(High) German'),
                    c('Middle High German', 'Yiddish'),
                    c('Middle English', 'English'),
                    c('Middle Dutch', 'Hollandic'),
                    c('Middle Dutch', 'Flemish'),
                    c('Middle Dutch', 'Dutch'),
                    c('Middle Dutch', 'Limburgish'),
                    c('Middle Dutch', 'Brabantian'),
                    c('Middle Dutch', 'Rhinelandic'),
                    c('Old Frisian', 'Frisian'),
                    c('Middle Danish', 'Danish'),
                    c('Middle Swedish', 'Swedish'),
                    c('Middle Norwegian', 'Norwegian'),
                    c('Old Norse', 'Faroese'),
                    c('Old Icelandic', 'Icelandic'),
                    c('Baltic', 'Old Prussian'),
                    c('Baltic', 'Lithuanian'),
                    c('Baltic', 'Latvian'),
                    c('West Slavic', 'Polish'),
                    c('West Slavic', 'Slovak'),
                    c('West Slavic', 'Czech'),
                    c('West Slavic', 'Wendish'),
                    c('East Slavic', 'Bulgarian'),
                    c('East Slavic', 'Old Church Slavonic'),
                    c('East Slavic', 'Macedonian'),
                    c('East Slavic', 'Serbo-Croatian'),
                    c('East Slavic', 'Slovene'),
                    c('South Slavic', 'Russian'),
                    c('South Slavic', 'Ukrainian'),
                    c('South Slavic', 'Belarusian'),
                    c('South Slavic', 'Rusyn'))) %>% 
        hc_exporting(enabled=TRUE)

thanks in advance

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Feel free to reopen it if you find it necessary.