I am using Plotly and Jupyter to generate some visuals to better understand user journeys online. I am using the Plotly sunburst chart since this makes a great visual for that purpose. Plotly provides an example that works great and provides the visual that I am looking to produce with my own data. I have created a dataframe that mirrors the example but when I try to use .show()
no chart is produced. It appears to run fine (no errors) and produces white space where the chart should be but not chart. The data we are testing on ends up being about about 16K rows ultimately.
I have played around with the online vs offline for Plotly neither appeared to make a difference. I tried different labels and ID's. I have also tried restarting the notebook and only running my plot instead of the example first. I have taken my data and narrowed down to only about 50 lines with 4 parent nodes and the rest decedents. All of this got the same result of the white space appearing for the plot but no plot being produced and no errors reported.
import numpy as np
import pandas as pd
import plotly.graph_objects as go
df3=pd.read_csv('sessionsForAnalysis.csv')
df3['parents'] = df3.groupby(['sessionid'])['pagelabel'].shift(1)
df4=df3[['pagelabel','pagelabel','parents']]
df4.columns=["ids", "labels","parents"]
df4=df4.drop_duplicates()
fig1 = go.Figure()
fig1.add_trace(go.Sunburst(
ids=df4.ids,
labels=df4.labels,
parents=df4.parents,
#values=one_dimensional_array, #I added this
domain=dict(column=0)
))
fig1.show()
I expect this to produce a sunburst plot like below, similar to the one found here except with our data so we can use it to analyze journeys: