erblast / parcats

htmlwidget that creates plotly parallel categories diagrams from easyalluvial plots.
https://erblast.github.io/parcats/
Other
25 stars 3 forks source link

Conflict plotly.js versions #3

Closed jose-barrera closed 4 years ago

jose-barrera commented 4 years ago

When plotting a treemap graph and a parcats graph in a RMarkdown document, the former does not display because the parcats library references plotly.js version 1.47.3 which does not support treemap traces.


library(plotly)
library(easyalluvial)
library(parcats, attach.required = FALSE)

df1 = read.csv('https://raw.githubusercontent.com/plotly/datasets/718417069ead87650b90472464c7565dc8c2cb1c/sunburst-coffee-flavors-complete.csv')
df2 = read.csv('https://raw.githubusercontent.com/plotly/datasets/718417069ead87650b90472464c7565dc8c2cb1c/coffee-flavors.csv')

fig <- plot_ly(
    type='treemap',
    ids=df1$ids,
    labels=df1$labels,
    parents=df1$parents,
    domain=list(column=0))

fig <- fig %>% add_trace(
    type='treemap',
    ids=df2$ids,
    labels=df2$labels,
    parents=df2$parents,
    maxdepth=1,
    domain=list(column=1))
fig <- fig %>% layout(grid=list(columns=2, rows=1))
fig

p = alluvial_wide(mtcars2, max_variables = 5)
parcats(p, marginal_histograms = FALSE)

Is thera a way to change the plotly.js version reference?

erblast commented 4 years ago

hello, thank you for reporting this. I have not updated the plotly.js distribution that I package with parcats since its release. I was able to replicate your error and it should be fixed now. Can you give it a go?

remotes::install_github("erblast/parcats")

if it works for you I will submit the update to CRAN in the next week.

Cheers

jose-barrera commented 4 years ago

Hi, it works perfect.

Thank you very much.

Best regards,

erblast commented 4 years ago

https://github.com/erblast/parcats/pull/4