@@ -113,20 +113,20 @@ def wait(self):
113
113
"""
114
114
return self .window .wait ()
115
115
116
- def jupyter_cell (self ):
116
+ def jupyter_cell (self , height = 400 ):
117
117
"""
118
118
Render the visualizer in a jupyter notebook or jupyterlab cell.
119
119
120
120
For this to work, it should be the very last command in the given jupyter
121
121
cell.
122
122
"""
123
123
return HTML ("""
124
- <div style="height: 400px ; width: 100%; overflow-x: auto; overflow-y: hidden; resize: both">
124
+ <div style="height: {height}px ; width: 100%; overflow-x: auto; overflow-y: hidden; resize: both">
125
125
<iframe src="{url}" style="width: 100%; height: 100%; border: none"></iframe>
126
126
</div>
127
- """ .format (url = self .url ()))
127
+ """ .format (url = self .url (), height = height ))
128
128
129
- def render_static (self ):
129
+ def render_static (self , height = 400 ):
130
130
"""
131
131
Render a static snapshot of the visualizer in a jupyter notebook or
132
132
jupyterlab cell. The resulting snapshot of the visualizer will still be an
@@ -137,10 +137,10 @@ def render_static(self):
137
137
on a different machine or inside a container.
138
138
"""
139
139
return HTML ("""
140
- <div style="height: 400px ; width: 100%; overflow-x: auto; overflow-y: hidden; resize: both">
140
+ <div style="height: {height}px ; width: 100%; overflow-x: auto; overflow-y: hidden; resize: both">
141
141
<iframe srcdoc="{srcdoc}" style="width: 100%; height: 100%; border: none"></iframe>
142
142
</div>
143
- """ .format (srcdoc = srcdoc_escape (self .static_html ())))
143
+ """ .format (srcdoc = srcdoc_escape (self .static_html ()), height = height ))
144
144
145
145
def __getitem__ (self , path ):
146
146
return Visualizer .view_into (self .window , self .path .append (path ))
0 commit comments