逐步完成前后端服务器

This commit is contained in:
2025-09-09 15:00:30 +08:00
parent fcb09432e9
commit c7dfa1e9fc
2937 changed files with 1477567 additions and 0 deletions

View File

@ -0,0 +1,309 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* AUTO-GENERATED FILE. DO NOT MODIFY.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { __extends } from "tslib";
/* global Uint32Array, Float64Array, Float32Array */
import SeriesModel from '../../model/Series.js';
import SeriesData from '../../data/SeriesData.js';
import { concatArray, mergeAll, map, isNumber } from 'zrender/lib/core/util.js';
import CoordinateSystem from '../../core/CoordinateSystem.js';
import { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';
var Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;
var Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;
function compatEc2(seriesOpt) {
var data = seriesOpt.data;
if (data && data[0] && data[0][0] && data[0][0].coord) {
if (process.env.NODE_ENV !== 'production') {
console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }');
}
seriesOpt.data = map(data, function (itemOpt) {
var coords = [itemOpt[0].coord, itemOpt[1].coord];
var target = {
coords: coords
};
if (itemOpt[0].name) {
target.fromName = itemOpt[0].name;
}
if (itemOpt[1].name) {
target.toName = itemOpt[1].name;
}
return mergeAll([target, itemOpt[0], itemOpt[1]]);
});
}
}
var LinesSeriesModel = /** @class */function (_super) {
__extends(LinesSeriesModel, _super);
function LinesSeriesModel() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = LinesSeriesModel.type;
_this.visualStyleAccessPath = 'lineStyle';
_this.visualDrawType = 'stroke';
return _this;
}
LinesSeriesModel.prototype.init = function (option) {
// The input data may be null/undefined.
option.data = option.data || [];
// Not using preprocessor because mergeOption may not have series.type
compatEc2(option);
var result = this._processFlatCoordsArray(option.data);
this._flatCoords = result.flatCoords;
this._flatCoordsOffset = result.flatCoordsOffset;
if (result.flatCoords) {
option.data = new Float32Array(result.count);
}
_super.prototype.init.apply(this, arguments);
};
LinesSeriesModel.prototype.mergeOption = function (option) {
compatEc2(option);
if (option.data) {
// Only update when have option data to merge.
var result = this._processFlatCoordsArray(option.data);
this._flatCoords = result.flatCoords;
this._flatCoordsOffset = result.flatCoordsOffset;
if (result.flatCoords) {
option.data = new Float32Array(result.count);
}
}
_super.prototype.mergeOption.apply(this, arguments);
};
LinesSeriesModel.prototype.appendData = function (params) {
var result = this._processFlatCoordsArray(params.data);
if (result.flatCoords) {
if (!this._flatCoords) {
this._flatCoords = result.flatCoords;
this._flatCoordsOffset = result.flatCoordsOffset;
} else {
this._flatCoords = concatArray(this._flatCoords, result.flatCoords);
this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);
}
params.data = new Float32Array(result.count);
}
this.getRawData().appendData(params.data);
};
LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {
var itemModel = this.getData().getItemModel(idx);
var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords');
if (process.env.NODE_ENV !== 'production') {
if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {
throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');
}
}
return coords;
};
LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {
if (this._flatCoordsOffset) {
return this._flatCoordsOffset[idx * 2 + 1];
} else {
return this._getCoordsFromItemModel(idx).length;
}
};
LinesSeriesModel.prototype.getLineCoords = function (idx, out) {
if (this._flatCoordsOffset) {
var offset = this._flatCoordsOffset[idx * 2];
var len = this._flatCoordsOffset[idx * 2 + 1];
for (var i = 0; i < len; i++) {
out[i] = out[i] || [];
out[i][0] = this._flatCoords[offset + i * 2];
out[i][1] = this._flatCoords[offset + i * 2 + 1];
}
return len;
} else {
var coords = this._getCoordsFromItemModel(idx);
for (var i = 0; i < coords.length; i++) {
out[i] = out[i] || [];
out[i][0] = coords[i][0];
out[i][1] = coords[i][1];
}
return coords.length;
}
};
LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {
var startOffset = 0;
if (this._flatCoords) {
startOffset = this._flatCoords.length;
}
// Stored as a typed array. In format
// Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |
if (isNumber(data[0])) {
var len = data.length;
// Store offset and len of each segment
var coordsOffsetAndLenStorage = new Uint32Arr(len);
var coordsStorage = new Float64Arr(len);
var coordsCursor = 0;
var offsetCursor = 0;
var dataCount = 0;
for (var i = 0; i < len;) {
dataCount++;
var count = data[i++];
// Offset
coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;
// Len
coordsOffsetAndLenStorage[offsetCursor++] = count;
for (var k = 0; k < count; k++) {
var x = data[i++];
var y = data[i++];
coordsStorage[coordsCursor++] = x;
coordsStorage[coordsCursor++] = y;
if (i > len) {
if (process.env.NODE_ENV !== 'production') {
throw new Error('Invalid data format.');
}
}
}
}
return {
flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),
flatCoords: coordsStorage,
count: dataCount
};
}
return {
flatCoordsOffset: null,
flatCoords: null,
count: data.length
};
};
LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {
if (process.env.NODE_ENV !== 'production') {
var CoordSys = CoordinateSystem.get(option.coordinateSystem);
if (!CoordSys) {
throw new Error('Unknown coordinate system ' + option.coordinateSystem);
}
}
var lineData = new SeriesData(['value'], this);
lineData.hasItemOption = false;
lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {
// dataItem is simply coords
if (dataItem instanceof Array) {
return NaN;
} else {
lineData.hasItemOption = true;
var value = dataItem.value;
if (value != null) {
return value instanceof Array ? value[dimIndex] : value;
}
}
});
return lineData;
};
LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {
var data = this.getData();
var itemModel = data.getItemModel(dataIndex);
var name = itemModel.get('name');
if (name) {
return name;
}
var fromName = itemModel.get('fromName');
var toName = itemModel.get('toName');
var nameArr = [];
fromName != null && nameArr.push(fromName);
toName != null && nameArr.push(toName);
return createTooltipMarkup('nameValue', {
name: nameArr.join(' > ')
});
};
LinesSeriesModel.prototype.preventIncremental = function () {
return !!this.get(['effect', 'show']);
};
LinesSeriesModel.prototype.getProgressive = function () {
var progressive = this.option.progressive;
if (progressive == null) {
return this.option.large ? 1e4 : this.get('progressive');
}
return progressive;
};
LinesSeriesModel.prototype.getProgressiveThreshold = function () {
var progressiveThreshold = this.option.progressiveThreshold;
if (progressiveThreshold == null) {
return this.option.large ? 2e4 : this.get('progressiveThreshold');
}
return progressiveThreshold;
};
LinesSeriesModel.prototype.getZLevelKey = function () {
var effectModel = this.getModel('effect');
var trailLength = effectModel.get('trailLength');
return this.getData().count() > this.getProgressiveThreshold()
// Each progressive series has individual key.
? this.id : effectModel.get('show') && trailLength > 0 ? trailLength + '' : '';
};
LinesSeriesModel.type = 'series.lines';
LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];
LinesSeriesModel.defaultOption = {
coordinateSystem: 'geo',
// zlevel: 0,
z: 2,
legendHoverLink: true,
// Cartesian coordinate system
xAxisIndex: 0,
yAxisIndex: 0,
symbol: ['none', 'none'],
symbolSize: [10, 10],
// Geo coordinate system
geoIndex: 0,
effect: {
show: false,
period: 4,
constantSpeed: 0,
symbol: 'circle',
symbolSize: 3,
loop: true,
trailLength: 0.2
},
large: false,
// Available when large is true
largeThreshold: 2000,
polyline: false,
clip: true,
label: {
show: false,
position: 'end'
// distance: 5,
// formatter: 标签文本格式器同Tooltip.formatter不支持异步回调
},
lineStyle: {
opacity: 0.5
}
};
return LinesSeriesModel;
}(SeriesModel);
export default LinesSeriesModel;

View File

@ -0,0 +1,184 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* AUTO-GENERATED FILE. DO NOT MODIFY.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { __extends } from "tslib";
import LineDraw from '../helper/LineDraw.js';
import EffectLine from '../helper/EffectLine.js';
import Line from '../helper/Line.js';
import Polyline from '../helper/Polyline.js';
import EffectPolyline from '../helper/EffectPolyline.js';
import LargeLineDraw from '../helper/LargeLineDraw.js';
import linesLayout from './linesLayout.js';
import { createClipPath } from '../helper/createClipPathFromCoordSys.js';
import ChartView from '../../view/Chart.js';
var LinesView = /** @class */function (_super) {
__extends(LinesView, _super);
function LinesView() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = LinesView.type;
return _this;
}
LinesView.prototype.render = function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var lineDraw = this._updateLineDraw(data, seriesModel);
var zlevel = seriesModel.get('zlevel');
var trailLength = seriesModel.get(['effect', 'trailLength']);
var zr = api.getZr();
// Avoid the drag cause ghost shadow
// FIXME Better way ?
// SVG doesn't support
var isSvg = zr.painter.getType() === 'svg';
if (!isSvg) {
zr.painter.getLayer(zlevel).clear(true);
}
// Config layer with motion blur
if (this._lastZlevel != null && !isSvg) {
zr.configLayer(this._lastZlevel, {
motionBlur: false
});
}
if (this._showEffect(seriesModel) && trailLength > 0) {
if (!isSvg) {
zr.configLayer(zlevel, {
motionBlur: true,
lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
});
} else if (process.env.NODE_ENV !== 'production') {
console.warn('SVG render mode doesn\'t support lines with trail effect');
}
}
lineDraw.updateData(data);
var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);
if (clipPath) {
this.group.setClipPath(clipPath);
} else {
this.group.removeClipPath();
}
this._lastZlevel = zlevel;
this._finished = true;
};
LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var lineDraw = this._updateLineDraw(data, seriesModel);
lineDraw.incrementalPrepareUpdate(data);
this._clearLayer(api);
this._finished = false;
};
LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {
this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());
this._finished = taskParams.end === seriesModel.getData().count();
};
LinesView.prototype.eachRendered = function (cb) {
this._lineDraw && this._lineDraw.eachRendered(cb);
};
LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var pipelineContext = seriesModel.pipelineContext;
if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {
// TODO Don't have to do update in large mode. Only do it when there are millions of data.
return {
update: true
};
} else {
// TODO Use same logic with ScatterView.
// Manually update layout
var res = linesLayout.reset(seriesModel, ecModel, api);
if (res.progress) {
res.progress({
start: 0,
end: data.count(),
count: data.count()
}, data);
}
// Not in large mode
this._lineDraw.updateLayout();
this._clearLayer(api);
}
};
LinesView.prototype._updateLineDraw = function (data, seriesModel) {
var lineDraw = this._lineDraw;
var hasEffect = this._showEffect(seriesModel);
var isPolyline = !!seriesModel.get('polyline');
var pipelineContext = seriesModel.pipelineContext;
var isLargeDraw = pipelineContext.large;
if (process.env.NODE_ENV !== 'production') {
if (hasEffect && isLargeDraw) {
console.warn('Large lines not support effect');
}
}
if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {
if (lineDraw) {
lineDraw.remove();
}
lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);
this._hasEffet = hasEffect;
this._isPolyline = isPolyline;
this._isLargeDraw = isLargeDraw;
}
this.group.add(lineDraw.group);
return lineDraw;
};
LinesView.prototype._showEffect = function (seriesModel) {
return !!seriesModel.get(['effect', 'show']);
};
LinesView.prototype._clearLayer = function (api) {
// Not use motion when dragging or zooming
var zr = api.getZr();
var isSvg = zr.painter.getType() === 'svg';
if (!isSvg && this._lastZlevel != null) {
zr.painter.getLayer(this._lastZlevel).clear(true);
}
};
LinesView.prototype.remove = function (ecModel, api) {
this._lineDraw && this._lineDraw.remove();
this._lineDraw = null;
// Clear motion when lineDraw is removed
this._clearLayer(api);
};
LinesView.prototype.dispose = function (ecModel, api) {
this.remove(ecModel, api);
};
LinesView.type = 'lines';
return LinesView;
}(ChartView);
export default LinesView;

View File

@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* AUTO-GENERATED FILE. DO NOT MODIFY.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import LinesView from './LinesView.js';
import LinesSeriesModel from './LinesSeries.js';
import linesLayout from './linesLayout.js';
import linesVisual from './linesVisual.js';
export function install(registers) {
registers.registerChartView(LinesView);
registers.registerSeriesModel(LinesSeriesModel);
registers.registerLayout(linesLayout);
registers.registerVisual(linesVisual);
}

View File

@ -0,0 +1,113 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* AUTO-GENERATED FILE. DO NOT MODIFY.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* global Float32Array */
import createRenderPlanner from '../helper/createRenderPlanner.js';
import { error } from '../../util/log.js';
var linesLayout = {
seriesType: 'lines',
plan: createRenderPlanner(),
reset: function (seriesModel) {
var coordSys = seriesModel.coordinateSystem;
if (!coordSys) {
if (process.env.NODE_ENV !== 'production') {
error('The lines series must have a coordinate system.');
}
return;
}
var isPolyline = seriesModel.get('polyline');
var isLarge = seriesModel.pipelineContext.large;
return {
progress: function (params, lineData) {
var lineCoords = [];
if (isLarge) {
var points = void 0;
var segCount = params.end - params.start;
if (isPolyline) {
var totalCoordsCount = 0;
for (var i = params.start; i < params.end; i++) {
totalCoordsCount += seriesModel.getLineCoordsCount(i);
}
points = new Float32Array(segCount + totalCoordsCount * 2);
} else {
points = new Float32Array(segCount * 4);
}
var offset = 0;
var pt = [];
for (var i = params.start; i < params.end; i++) {
var len = seriesModel.getLineCoords(i, lineCoords);
if (isPolyline) {
points[offset++] = len;
}
for (var k = 0; k < len; k++) {
pt = coordSys.dataToPoint(lineCoords[k], false, pt);
points[offset++] = pt[0];
points[offset++] = pt[1];
}
}
lineData.setLayout('linesPoints', points);
} else {
for (var i = params.start; i < params.end; i++) {
var itemModel = lineData.getItemModel(i);
var len = seriesModel.getLineCoords(i, lineCoords);
var pts = [];
if (isPolyline) {
for (var j = 0; j < len; j++) {
pts.push(coordSys.dataToPoint(lineCoords[j]));
}
} else {
pts[0] = coordSys.dataToPoint(lineCoords[0]);
pts[1] = coordSys.dataToPoint(lineCoords[1]);
var curveness = itemModel.get(['lineStyle', 'curveness']);
if (+curveness) {
pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness];
}
}
lineData.setItemLayout(i, pts);
}
}
}
};
}
};
export default linesLayout;

View File

@ -0,0 +1,74 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* AUTO-GENERATED FILE. DO NOT MODIFY.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
function normalize(a) {
if (!(a instanceof Array)) {
a = [a, a];
}
return a;
}
var linesVisual = {
seriesType: 'lines',
reset: function (seriesModel) {
var symbolType = normalize(seriesModel.get('symbol'));
var symbolSize = normalize(seriesModel.get('symbolSize'));
var data = seriesModel.getData();
data.setVisual('fromSymbol', symbolType && symbolType[0]);
data.setVisual('toSymbol', symbolType && symbolType[1]);
data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);
data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);
function dataEach(data, idx) {
var itemModel = data.getItemModel(idx);
var symbolType = normalize(itemModel.getShallow('symbol', true));
var symbolSize = normalize(itemModel.getShallow('symbolSize', true));
symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);
symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);
symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);
symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);
}
return {
dataEach: data.hasItemOption ? dataEach : null
};
}
};
export default linesVisual;