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

Method to_mimebundle

plotly/io/_base_renderers.py:122–138  ·  view source on GitHub ↗
(self, fig_dict)

Source from the content-addressed store, hash-verified

120 self.engine = engine
121
122 def to_mimebundle(self, fig_dict):
123 image_bytes = to_image(
124 fig_dict,
125 format=self.format,
126 width=self.width,
127 height=self.height,
128 scale=self.scale,
129 validate=False,
130 engine=self.engine,
131 )
132
133 if self.b64_encode:
134 image_str = base64.b64encode(image_bytes).decode("utf8")
135 else:
136 image_str = image_bytes.decode("utf8")
137
138 return {self.mime_type: image_str}
139
140
141class PngRenderer(ImageRenderer):

Callers

nothing calls this directly

Calls 2

to_imageFunction · 0.90
decodeMethod · 0.45

Tested by

no test coverage detected