Plotly Graphs and Slack Integration

I have a Plotly graph showing an activity heatmap which gets inserted into my company's usage overview report. The graph renders fine in the webview, but not in the report image sent to my company's Slack team every morning. Instead, I see a blank space where the graph should be.

I assume this has to do with the interactive nature of Plotly's graphs. Is there a way to adjust my code to allow Mode to rasterize it before sending it to Slack?

 

The code, for reference:

from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
from plotly.tools import FigureFactory as ff
import plotly.graph_objs as graph

init_notebook_mode()

data = datasets['Day by Hour Activity']

trace = graph.Heatmap(z=data.event_count,x=data.hour,y=data.day_of_week)

plots = [trace]

layout = graph.Layout(
  xaxis=dict(
    type='category',
    categoryorder='category ascending',
    showgrid=False
    ),
  yaxis=dict(
    type='category',
    categoryorder='array',
    categoryarray=["Sunday", "Saturday", "Friday", "Thursday", "Wednesday", "Tuesday", "Monday"],
    showgrid=False
    )
  )

fig = graph.Figure(data=plots, layout=layout)
iplot(fig)
3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi David ,  This is actually a known issue that's been submitted to our development team.   We'll let you know when we've been able to fix it.  My apologies for this issue!

    Reply Like
  • Thanks,  Donna ! Good to know.

    Reply Like
  • Hi there! Any updates on this? We are running into the same issue

    Reply Like
Like1 Follow
  • Status Answered
  • 1 Likes
  • 8 days agoLast active
  • 3Replies
  • 932Views
  • 4 Following

Create A New Discussion

Share your thoughts