提交 ec38a917 编写于 作者: L lang

Graph using layout except force can't set draggable: true

上级 c256bcde
......@@ -45,7 +45,6 @@ define(function (require) {
symbolDraw.updateData(data);
var edgeData = data.graph.edgeData;
var rawOption = seriesModel.option;
var formatModel = modelUtil.createDataFormatModel(seriesModel, edgeData);
formatModel.formatTooltip = function (dataIndex) {
var params = this.getDataParams(dataIndex);
......@@ -99,22 +98,26 @@ define(function (require) {
// Update draggable
data.eachItemGraphicEl(function (el, idx) {
var draggable = data.getItemModel(idx).get('draggable');
if (draggable && forceLayout) {
if (draggable) {
el.on('drag', function () {
forceLayout.warmUp();
!this._layouting
&& this._startForceLayoutIteration(forceLayout, layoutAnimation);
forceLayout.setFixed(idx);
// Write position back to layout
data.setItemLayout(idx, el.position);
if (forceLayout) {
forceLayout.warmUp();
!this._layouting
&& this._startForceLayoutIteration(forceLayout, layoutAnimation);
forceLayout.setFixed(idx);
// Write position back to layout
data.setItemLayout(idx, el.position);
}
}, this).on('dragend', function () {
forceLayout.setUnfixed(idx);
if (forceLayout) {
forceLayout.setUnfixed(idx);
}
}, this);
}
else {
el.off('drag');
}
el.setDraggable(draggable);
el.setDraggable(draggable && forceLayout);
}, this);
this._firstRender = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册