def make_plotly_fig(self, code: str) -> str:
global plotly
if plotly is None:
import plotly
loc: Dict[str, Any] = {}
self.plotly_globals.update({'plot': self.plotly_plotter.plot,
'go': plotly.graph_objs,
'plotly': plotly})
gl = self.plotly_globals
exec(code, gl, loc)
self.js_top['plotly'] = ("<script src='https://cdn.plot.ly/plotly-"
"latest.min.js'></script>")
return self.plotly_plotter.get_data()
评论列表
文章目录