提交 34c38d5c 编写于 作者: L lang

Symbol needs draw validate fix, symbol hover animation on line fix

上级 9f66fa6f
......@@ -19,6 +19,11 @@ define(function (require) {
var symbolDrawProto = SymbolDraw.prototype;
function symbolNeedsDraw(data, idx, isIgnore) {
var point = data.getItemLayout(idx);
return point && !isNaN(point[0]) && !isNaN(point[1]) && !(isIgnore && isIgnore(idx))
&& data.getItemVisual(idx, 'symbol') !== 'none';
}
/**
* Update symbols draw by new data
* @param {module:echarts/data/List} data
......@@ -33,24 +38,21 @@ define(function (require) {
data.diff(oldData)
.add(function (newIdx) {
if (!(isIgnore && isIgnore(newIdx))
&& data.getItemVisual(newIdx, 'symbol') !== 'none'
) {
var point = data.getItemLayout(newIdx);
if (symbolNeedsDraw(data, newIdx, isIgnore)) {
var symbolEl = new SymbolCtor(data, newIdx);
symbolEl.attr('position', data.getItemLayout(newIdx));
symbolEl.attr('position', point);
data.setItemGraphicEl(newIdx, symbolEl);
group.add(symbolEl);
}
})
.update(function (newIdx, oldIdx) {
var symbolEl = oldData.getItemGraphicEl(oldIdx);
if ((isIgnore && isIgnore(newIdx))
|| data.getItemVisual(newIdx, 'symbol') === 'none'
) {
var point = data.getItemLayout(newIdx);
if (!symbolNeedsDraw(data, newIdx, isIgnore)) {
group.remove(symbolEl);
return;
}
var point = data.getItemLayout(newIdx);
if (!symbolEl) {
symbolEl = new SymbolCtor(data, newIdx);
symbolEl.attr('position', point);
......
......@@ -329,7 +329,7 @@ define(function(require) {
data.setItemGraphicEl(dataIndex, symbol);
// Stop scale animation
symbol.stopAnimation(true);
symbol.stopSymbolAnimation(true);
this.group.add(symbol);
}
......
......@@ -214,7 +214,7 @@ define(function (require) {
data.getItemLayout(idx),
itemModel.get('selected'),
seriesModel.get('selectedOffset'),
seriesModel.ecModel.get('animation')
seriesModel.get('animation')
);
function onEmphasis() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册