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)