Renderer to display figures as JSON hierarchies. This renderer is compatible with JupyterLab and VSCode. mime type: 'application/json'
| 59 | |
| 60 | |
| 61 | class JsonRenderer(MimetypeRenderer): |
| 62 | """ |
| 63 | Renderer to display figures as JSON hierarchies. This renderer is |
| 64 | compatible with JupyterLab and VSCode. |
| 65 | |
| 66 | mime type: 'application/json' |
| 67 | """ |
| 68 | |
| 69 | def to_mimebundle(self, fig_dict): |
| 70 | value = json.loads(to_json(fig_dict, validate=False, remove_uids=False)) |
| 71 | return {"application/json": value} |
| 72 | |
| 73 | |
| 74 | # Plotly mimetype |