Skip to content

Commit a9de45e

Browse files
committed
mime
1 parent cc3066b commit a9de45e

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
deploy:
4343
needs: build
4444
runs-on: ubuntu-latest
45+
permissions:
46+
pages: write
47+
id-token: write
4548
environment:
4649
name: github-pages
4750
url: ${{ steps.deployment.outputs.page_url }}

examples/ggplotly_showcase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
# %%
116116
# iris - Classic flower measurements dataset
117117
iris = data('iris')
118-
(ggplot(iris, aes(x='Sepal.Length', y='Sepal.Width', color='Species'))
118+
(ggplot(iris, aes(x='sepal_length', y='sepal_width', color='Species'))
119119
+ geom_point(size=8)
120120
+ labs(title='Iris Dataset'))
121121

ggplotly/ggplot.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,16 @@ def _repr_html_(self):
128128
"""Return HTML representation for Jupyter/IPython display."""
129129
if self.auto_draw:
130130
fig = self.draw()
131-
# return fig._repr_html_()
132-
fig.show()
131+
return fig._repr_html_()
133132
return ""
134133

134+
def _repr_mimebundle_(self, **kwargs):
135+
"""Return MIME bundle for Jupyter display (preferred by VS Code, JupyterLab)."""
136+
if self.auto_draw:
137+
fig = self.draw()
138+
return fig._repr_mimebundle_(**kwargs)
139+
return {}
140+
135141
def add_stat(self, stat):
136142
"""
137143
Add stat as a new layer with its own geom.

0 commit comments

Comments
 (0)