cran / processmapR

:exclamation: This is a read-only mirror of the CRAN R package repository. processmapR — Construct Process Maps Using Event Data. Homepage: https://bupar.net/, https://github.com/bupaverse/processmapr/, https://bupaverse.github.io/processmapR/ Report bugs for this package: https://github.com/bupaverse/processmapr/iss ...
Other
1 stars 1 forks source link

Plotly doesn't render the plot correctly #4

Open quartermaine opened 1 year ago

quartermaine commented 1 year ago

I am trying to make a plot created with the trace_explorer function from buraR package interactive using the ggplotly function but the resulting plot is not the expected.

Here is the code :

library(ggplot2)
library(bupaR)

patients <- eventdataR::patients # dataset from bupaR

df <- eventlog(patients,
               case_id = "patient",
               activity_id = "handling",
               activity_instance_id = "handling_id",
               lifecycle_id = "registration_type",
               timestamp = "time",
               resource_id = "employee")

tr <- df %>% processmapR::trace_explorer(type = "frequent", coverage = 1.0)

# tr # print the ggplot to see the expected output!
ggplotly(tr)

and the resulting plot

image

I tried to use the theme option in ggplot2 and then the layout function but the result is still the same without the legend.

ggtrace <- trace_explorer(df,
                          type = "frequent", 
                          coverage = 1.0)

ggtrace <- ggtrace + 
  theme (legend.position="none") +
  theme(axis.text.x=element_blank(),
        axis.ticks.x=element_blank(),
        axis.text.y=element_blank(),
        axis.ticks.y=element_blank()
  )

plotly_trace <- ggplotly(ggtrace)

layout(plotly_trace, 
                    margin=list(l=50, b=50), 
                    legend=list(x=1.05)
)

image

gaborcsardi commented 1 year ago

Hi, this is a read only mirror of CRAN, please see the package authors in the DESCRIPTION file. Look for Maintainer, BugReports and URL. Thanks!

quartermaine commented 1 year ago

@gaborcsardi Hi, thank you I will search as you suggested.