提交 b3c0e1fd 编写于 作者: L lang

geoLine => lines

上级 d61d53c2
......@@ -37,7 +37,7 @@
'echarts/chart/boxplot',
'echarts/chart/candlestick',
'echarts/chart/effectScatter',
'echarts/chart/geoLine',
'echarts/chart/lines',
'echarts/chart/heatmap',
'echarts/component/geo',
......
define(function (require) {
require('./geoLine/GeoLineSeries');
require('./geoLine/GeoLineView');
require('../component/geo');
require('./lines/LinesSeries');
require('./lines/LinesView');
var zrUtil = require('zrender/core/util');
var echarts = require('../echarts');
echarts.registerLayout(
require('./geoLine/geoLineLayout')
require('./lines/linesLayout')
);
echarts.registerVisualCoding(
'chart', zrUtil.curry(require('../visual/seriesColor'), 'geoLine', 'lineStyle')
'chart', zrUtil.curry(require('../visual/seriesColor'), 'lines', 'lineStyle')
);
});
\ No newline at end of file
......@@ -8,7 +8,7 @@ define(function (require) {
return SeriesModel.extend({
type: 'series.geoLine',
type: 'series.lines',
dependencies: ['grid', 'polar'],
......@@ -25,8 +25,15 @@ define(function (require) {
));
});
var fromData = new List(['lng', 'lat'], this);
var toData = new List(['lng', 'lat'], this);
var coordSys = option.coordinateSystem;
if (coordSys !== 'cartesian2d' && coordSys !== 'geo') {
throw new Error('Coordinate system can only be cartesian2d or geo in lines');
}
var dimensions = coordSys === 'geo' ? ['lng', 'lat'] : ['x', 'y'];
var fromData = new List(dimensions, this);
var toData = new List(dimensions, this);
var lineData = new List(['value'], this);
function geoCoordGetter(item, dim, dataIndex, dimIndex) {
......@@ -54,9 +61,6 @@ define(function (require) {
xAxisIndex: 0,
yAxisIndex: 0,
// Polar coordinate system
polarIndex: 0,
// Geo coordinate system
geoIndex: 0,
......
......@@ -6,7 +6,7 @@ define(function (require) {
require('../../echarts').extendChartView({
type: 'geoLine',
type: 'lines',
init: function () {},
......
define(function (require) {
return function (ecModel) {
ecModel.eachSeriesByType('geoLine', function (seriesModel) {
ecModel.eachSeriesByType('lines', function (seriesModel) {
var coordSys = seriesModel.coordinateSystem;
var fromData = seriesModel.fromData;
var toData = seriesModel.toData;
var lineData = seriesModel.getData();
fromData.each(['lng', 'lat'], function (lng, lat, idx) {
fromData.setItemLayout(idx, coordSys.dataToPoint([lng, lat]));
var dims = coordSys.dimensions;
fromData.each(dims, function (x, y, idx) {
fromData.setItemLayout(idx, coordSys.dataToPoint([x, y]));
});
toData.each(['lng', 'lat'], function (lng, lat, idx) {
toData.setItemLayout(idx, coordSys.dataToPoint([lng, lat]));
toData.each(dims, function (x, y, idx) {
toData.setItemLayout(idx, coordSys.dataToPoint([x, y]));
});
lineData.each(function (idx) {
var p1 = fromData.getItemLayout(idx);
......
......@@ -50,7 +50,7 @@ define(function (require) {
var COMPATITABLE_SERIES = [
'bar', 'boxplot', 'candlestick', 'chord', 'effectScatter',
'funnel', 'gauge', 'geoLine', 'graph', 'heatmap', 'line', 'map', 'parallel',
'funnel', 'gauge', 'lines', 'graph', 'heatmap', 'line', 'map', 'parallel',
'pie', 'radar', 'sankey', 'scatter', 'treemap'
];
......
......@@ -96,7 +96,9 @@
}
},
labelLine: {
length: config.labelLineLen
normal: {
length: config.labelLineLen
}
}
}]
});
......
......@@ -20,7 +20,7 @@
require([
'echarts',
'echarts/chart/geoLine',
'echarts/chart/lines',
'echarts/chart/effectScatter',
'echarts/component/legend',
'echarts/component/geo'
......@@ -209,7 +209,7 @@
[['北京', BJData], ['上海', SHData], ['广州', GZData]].forEach(function (item, i) {
series.push({
name: item[0] + ' Top10',
type: 'geoLine',
type: 'lines',
zlevel: 1,
effect: {
show: true,
......@@ -229,7 +229,7 @@
},
{
name: item[0] + ' Top10',
type: 'geoLine',
type: 'lines',
zlevel: 2,
effect: {
show: true,
......@@ -275,7 +275,7 @@
return {
name: dataItem[1].name,
value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
}
};
})
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册