{0|example: hover, select, ...}
{0|example: opening animation}
{1|~1200*500}
{0|example: stream}
{1|~800*500}
{0|example: layout}
{0|example: data zoom}
{0|example: roam}
Animation Requirements
Animation Module
Programming Requirements
{0|}
Note: Creating shape each time is an easy way. But, animation requires shape reuse.
Programming Pattern: Data Diff
// diff: map by key. data.diff(oldData) .add(function (newIdx) { // Create symbol ... // Store symbol on data. data.setItemGraphicEl(newIdx, symbolEl); }) .update(function (newIdx, oldIdx) { // Create or update symbol. ... // Store symbol on data. data.setItemGraphicEl(newIdx, symbolEl); }) .remove(function (oldIdx) { // Remove symbol. }) .execute();
option = { animation: true, animationDuration: ..., animationEasing: ..., animationDelay: ..., ..., xxxx: [{ animation: true, animationDuration: ..., animationEasing: ..., animationDelay: ..., ... }, { ... }] };
itemStyle: { normal: { color: ..., ... }, emphasis: { color: ..., ... } }
Programming Pattern: Unified API
graphic.updateProps(symbolEl, { // properties to be updated with or without animation. position: point, ... }, seriesModel);
Throttle
fn = echarts.throttle(fn);