MCPcopy Index your code
hub / github.com/plotly/plotly.py / PlotlyRenderer

Class PlotlyRenderer

plotly/io/_base_renderers.py:75–95  ·  view source on GitHub ↗

Renderer to display figures using the plotly mime type. This renderer is compatible with VSCode and nteract. mime type: 'application/vnd.plotly.v1+json'

Source from the content-addressed store, hash-verified

73
74# Plotly mimetype
75class PlotlyRenderer(MimetypeRenderer):
76 """
77 Renderer to display figures using the plotly mime type. This renderer is
78 compatible with VSCode and nteract.
79
80 mime type: 'application/vnd.plotly.v1+json'
81 """
82
83 def __init__(self, config=None):
84 self.config = dict(config) if config else {}
85
86 def to_mimebundle(self, fig_dict):
87 config = _get_jconfig(self.config)
88 if config:
89 fig_dict["config"] = config
90
91 json_compatible_fig_dict = json.loads(
92 to_json(fig_dict, validate=False, remove_uids=False)
93 )
94
95 return {"application/vnd.plotly.v1+json": json_compatible_fig_dict}
96
97
98# Static Image

Callers 1

_renderers.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected