Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5153224

Browse files
committed
change redraw to true for choropleth map animation
1 parent 816afd3 commit 5153224

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

_posts/plotly_js/animations/map-animations/2017-08-22-choropleth-animation.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Map Animations
3-
plot_url: https://codepen.io/bcd/embed/rzrJjb/?height=500&theme-id=15263&default-tab=result
3+
plot_url: https://codepen.io/plotly/embed/YoZLGQ/?height=500&theme-id=15263&default-tab=result
44
language: plotly_js
55
suite: map-animations
66
order: 1
@@ -24,9 +24,9 @@
2424
var num = 2009
2525
for (var i = 0; i < n; i++) {
2626
k++
27-
num++
2827
j = 51
2928
j = j*k
29+
num++
3030
frames[i] = {data: [{z: [], locations: []}], name: num}
3131
frames[i].data[0].z = z.slice(0, j);
3232
frames[i].data[0].locations = locations.slice(0, j);
@@ -74,8 +74,7 @@
7474
duration: 200,
7575
},
7676
frame: {
77-
duration: 500,
78-
redraw: false
77+
duration: 500
7978
}
8079
}],
8180
label: "Play"
@@ -89,8 +88,7 @@
8988
duration: 0
9089
},
9190
frame: {
92-
duration: 0,
93-
redraw: false
91+
duration: 0
9492
}
9593
}
9694
],
@@ -105,7 +103,7 @@
105103
args: [["2010"], {
106104
mode: "immediate",
107105
transition: {duration: 300},
108-
frame: {duration: 300, "redraw": false}
106+
frame: {duration: 300}
109107
}
110108
]
111109
},{
@@ -114,7 +112,7 @@
114112
args: [["2011"], {
115113
mode: "immediate",
116114
transition: {duration: 300},
117-
frame: {duration: 300, "redraw": false}
115+
frame: {duration: 300}
118116
}
119117
]
120118
}, {
@@ -123,7 +121,7 @@
123121
args: [["2012"], {
124122
mode: "immediate",
125123
transition: {duration: 300},
126-
frame: {duration: 300, "redraw": false}
124+
frame: {duration: 300}
127125
}
128126
]
129127
}, {
@@ -132,7 +130,7 @@
132130
args: [["2013"], {
133131
mode: "immediate",
134132
transition: {duration: 300},
135-
frame: {duration: 300, "redraw": false}
133+
frame: {duration: 300}
136134
}
137135
]
138136
}, {
@@ -141,7 +139,7 @@
141139
args: [["2014"], {
142140
mode: "immediate",
143141
transition: {duration: 300},
144-
frame: {duration: 300, "redraw": false}
142+
frame: {duration: 300}
145143
}
146144
]
147145
}, {
@@ -150,7 +148,7 @@
150148
args: [["2015"], {
151149
mode: "immediate",
152150
transition: {duration: 300},
153-
frame: {duration: 300, "redraw": false}
151+
frame: {duration: 300}
154152
}
155153
]
156154
}, {
@@ -159,7 +157,7 @@
159157
args: [["2016"], {
160158
mode: "immediate",
161159
transition: {duration: 300},
162-
frame: {duration: 300, "redraw": false}
160+
frame: {duration: 300}
163161
}
164162
]
165163
}],
@@ -185,7 +183,7 @@
185183
}]
186184
};
187185

188-
Plotly.plot(myDiv, data, layout).then(function() {
186+
Plotly.newPlot(myDiv, data, layout).then(function() {
189187
Plotly.addFrames('myDiv', frames);
190188
});
191189
})

0 commit comments

Comments
 (0)