Skip to content

Commit a8305df

Browse files
committed
ENH: Don't center the HTML animation rendering (Fixes #11795)
Centering the animations makes them align differently than the regular images in the notebook. Also, align attribute is somewhat deprecated. This adjusts some of the styling as well so that the controls are somewhat aligned with themselves.
1 parent 108501c commit a8305df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/_animation_data.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@
148148

149149
# HTML template for HTMLWriter
150150
DISPLAY_TEMPLATE = """
151-
<div class="animation" align="center">
151+
<div class="animation">
152152
<img id="_anim_img{id}">
153153
<br>
154-
<input id="_anim_slider{id}" type="range" style="width:350px"
154+
<input id="_anim_slider{id}" type="range" style="width:275px"
155155
name="points" min="0" max="1" step="1" value="0"
156156
onchange="anim{id}.set_frame(parseInt(this.value));"></input>
157157
<br>
@@ -171,7 +171,8 @@
171171
<button onclick="anim{id}.last_frame()"><i class="fa fa-fast-forward">
172172
</i></button>
173173
<button onclick="anim{id}.faster()"><i class="fa fa-plus"></i></button>
174-
<form action="#n" name="_anim_loop_select{id}" class="anim_control">
174+
<form action="#n" name="_anim_loop_select{id}" class="anim_control"
175+
style="margin-left:50px">
175176
<input type="radio" name="state"
176177
value="once" {once_checked}> Once </input>
177178
<input type="radio" name="state"

0 commit comments

Comments
 (0)