Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
c6ea88a4
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c6ea88a4
编写于
11月 04, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix build
上级
27d4e573
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
137 addition
and
71 deletion
+137
-71
build/build.js
build/build.js
+2
-2
dist/echarts.js
dist/echarts.js
+134
-68
dist/echarts.js.map
dist/echarts.js.map
+1
-1
未找到文件。
build/build.js
浏览文件 @
c6ea88a4
...
@@ -90,11 +90,11 @@ function run() {
...
@@ -90,11 +90,11 @@ function run() {
let
opt
=
{
let
opt
=
{
lang
:
commander
.
lang
||
null
,
lang
:
commander
.
lang
||
null
,
min
:
!!
commander
.
min
,
min
:
commander
.
min
,
type
:
commander
.
type
||
''
,
type
:
commander
.
type
||
''
,
input
:
commander
.
input
,
input
:
commander
.
input
,
output
:
commander
.
output
,
output
:
commander
.
output
,
sourcemap
:
!!
commander
.
sourcemap
,
sourcemap
:
commander
.
sourcemap
,
format
:
commander
.
format
||
'
umd
'
format
:
commander
.
format
||
'
umd
'
};
};
...
...
dist/echarts.js
浏览文件 @
c6ea88a4
...
@@ -4,16 +4,11 @@
...
@@ -4,16 +4,11 @@
(factory((global.echarts = {})));
(factory((global.echarts = {})));
}(this, (function (exports) { 'use strict';
}(this, (function (exports) { 'use strict';
// Enable DEV mode when using source code without build. which has no __DEV__ variable
if (typeof __DEV__ === "undefined") {
// In build process 'typeof __DEV__' will be replace with 'boolean'
if (typeof window !== "undefined") {
// So this code will be removed or disabled anyway after built.
if (typeof __DEV__ === 'undefined') {
// In browser
if (typeof window !== 'undefined') {
window.__DEV__ = true;
window.__DEV__ = true;
}
}
// In node
else if (typeof global !== "undefined") {
else if (typeof global !== 'undefined') {
global.__DEV__ = true;
global.__DEV__ = true;
}
}
}
}
...
@@ -28792,7 +28787,10 @@ var defaultOption = {
...
@@ -28792,7 +28787,10 @@ var defaultOption = {
color: '#333',
color: '#333',
width: 1,
width: 1,
type: 'solid'
type: 'solid'
}
},
// 坐标轴两端的箭头
symbol: ['none', 'none'],
symbolSize: [10, 15]
},
},
// 坐标轴小标记
// 坐标轴小标记
axisTick: {
axisTick: {
...
@@ -29064,6 +29062,18 @@ function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {
...
@@ -29064,6 +29062,18 @@ function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {
return axisModel.getCoordSysModel() === gridModel;
return axisModel.getCoordSysModel() === gridModel;
}
}
function rotateTextRect(textRect, rotate) {
var rotateRadians = rotate * Math.PI / 180;
var boundingBox = textRect.plain();
var beforeWidth = boundingBox.width;
var beforeHeight = boundingBox.height;
var afterWidth = beforeWidth * Math.cos(rotateRadians) + beforeHeight * Math.sin(rotateRadians);
var afterHeight = beforeWidth * Math.sin(rotateRadians) + beforeHeight * Math.cos(rotateRadians);
var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight);
return rotatedRect;
}
function getLabelUnionRect(axis) {
function getLabelUnionRect(axis) {
var axisModel = axis.model;
var axisModel = axis.model;
var labels = axisModel.getFormattedLabels();
var labels = axisModel.getFormattedLabels();
...
@@ -29077,8 +29087,9 @@ function getLabelUnionRect(axis) {
...
@@ -29077,8 +29087,9 @@ function getLabelUnionRect(axis) {
}
}
for (var i = 0; i < labelCount; i += step) {
for (var i = 0; i < labelCount; i += step) {
if (!axis.isLabelIgnored(i)) {
if (!axis.isLabelIgnored(i)) {
var singleRect = axisLabelModel.getTextRect(labels[i]);
var unrotatedSingleRect = axisLabelModel.getTextRect(labels[i]);
// FIXME consider label rotate
var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);
rect ? rect.union(singleRect) : (rect = singleRect);
rect ? rect.union(singleRect) : (rect = singleRect);
}
}
}
}
...
@@ -29663,9 +29674,6 @@ Grid.dimensions = Grid.prototype.dimensions = Cartesian2D.prototype.dimensions;
...
@@ -29663,9 +29674,6 @@ Grid.dimensions = Grid.prototype.dimensions = Cartesian2D.prototype.dimensions;
CoordinateSystemManager.register('cartesian2d', Grid);
CoordinateSystemManager.register('cartesian2d', Grid);
var v2ApplyTransform$1 = applyTransform;
var retrieve$1 = retrieve;
var PI$2 = Math.PI;
var PI$2 = Math.PI;
function makeAxisEventDataBase(axisModel) {
function makeAxisEventDataBase(axisModel) {
...
@@ -29797,12 +29805,18 @@ var builders = {
...
@@ -29797,12 +29805,18 @@ var builders = {
var pt1 = [extent[0], 0];
var pt1 = [extent[0], 0];
var pt2 = [extent[1], 0];
var pt2 = [extent[1], 0];
if (matrix) {
if (matrix) {
v2ApplyTransform$1
(pt1, pt1, matrix);
applyTransform
(pt1, pt1, matrix);
v2ApplyTransform$1
(pt2, pt2, matrix);
applyTransform
(pt2, pt2, matrix);
}
}
this.group.add(new Line(subPixelOptimizeLine({
var lineStyle = extend(
{
lineCap: 'round'
},
axisModel.getModel('axisLine.lineStyle').getLineStyle()
);
this.group.add(new Line(subPixelOptimizeLine({
// Id for animation
// Id for animation
anid: 'line',
anid: 'line',
...
@@ -29812,14 +29826,53 @@ var builders = {
...
@@ -29812,14 +29826,53 @@ var builders = {
x2: pt2[0],
x2: pt2[0],
y2: pt2[1]
y2: pt2[1]
},
},
style: extend(
style: lineStyle,
{lineCap: 'round'},
axisModel.getModel('axisLine.lineStyle').getLineStyle()
),
strokeContainThreshold: opt.strokeContainThreshold || 5,
strokeContainThreshold: opt.strokeContainThreshold || 5,
silent: true,
silent: true,
z2: 1
z2: 1
})));
})));
var arrows = axisModel.get('axisLine.symbol');
var arrowSize = axisModel.get('axisLine.symbolSize');
if (arrows != null) {
if (typeof arrows === 'string') {
// Use the same arrow for start and end point
arrows = [arrows, arrows];
}
if (typeof arrowSize === 'string'
|| typeof arrowSize === 'number'
) {
// Use the same size for width and height
arrowSize = [arrowSize, arrowSize];
}
var symbolWidth = arrowSize[0];
var symbolHeight = arrowSize[1];
each$1([
[opt.rotation + Math.PI / 2, pt1],
[opt.rotation - Math.PI / 2, pt2]
], function (item, index) {
if (arrows[index] !== 'none' && arrows[index] != null) {
var symbol = createSymbol(
arrows[index],
-symbolWidth / 2,
-symbolHeight / 2,
symbolWidth,
symbolHeight,
lineStyle.stroke,
true
);
symbol.attr({
rotation: item[0],
position: item[1],
silent: true
});
this.group.add(symbol);
}
}, this);
}
},
},
/**
/**
...
@@ -29841,7 +29894,7 @@ var builders = {
...
@@ -29841,7 +29894,7 @@ var builders = {
axisName: function () {
axisName: function () {
var opt = this.opt;
var opt = this.opt;
var axisModel = this.axisModel;
var axisModel = this.axisModel;
var name = retrieve
$1
(opt.axisName, axisModel.get('name'));
var name = retrieve(opt.axisName, axisModel.get('name'));
if (!name) {
if (!name) {
return;
return;
...
@@ -29898,7 +29951,7 @@ var builders = {
...
@@ -29898,7 +29951,7 @@ var builders = {
var truncateOpt = axisModel.get('nameTruncate', true) || {};
var truncateOpt = axisModel.get('nameTruncate', true) || {};
var ellipsis = truncateOpt.ellipsis;
var ellipsis = truncateOpt.ellipsis;
var maxWidth = retrieve
$1
(
var maxWidth = retrieve(
opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth
opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth
);
);
// FIXME
// FIXME
...
@@ -30223,8 +30276,8 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
...
@@ -30223,8 +30276,8 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
pt2[1] = opt.tickDirection * tickLen;
pt2[1] = opt.tickDirection * tickLen;
if (matrix) {
if (matrix) {
v2ApplyTransform$1
(pt1, pt1, matrix);
applyTransform
(pt1, pt1, matrix);
v2ApplyTransform$1
(pt2, pt2, matrix);
applyTransform
(pt2, pt2, matrix);
}
}
// Tick line, Not use group transform to have better line draw
// Tick line, Not use group transform to have better line draw
var tickEl = new Line(subPixelOptimizeLine({
var tickEl = new Line(subPixelOptimizeLine({
...
@@ -30255,7 +30308,7 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
...
@@ -30255,7 +30308,7 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
function buildAxisLabel(axisBuilder, axisModel, opt) {
function buildAxisLabel(axisBuilder, axisModel, opt) {
var axis = axisModel.axis;
var axis = axisModel.axis;
var show = retrieve
$1
(opt.axisLabelShow, axisModel.get('axisLabel.show'));
var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show'));
if (!show || axis.scale.isBlank()) {
if (!show || axis.scale.isBlank()) {
return;
return;
...
@@ -30268,7 +30321,7 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
...
@@ -30268,7 +30321,7 @@ function buildAxisLabel(axisBuilder, axisModel, opt) {
// Special label rotate.
// Special label rotate.
var labelRotation = (
var labelRotation = (
retrieve
$1
(opt.labelRotate, labelModel.get('rotate')) || 0
retrieve(opt.labelRotate, labelModel.get('rotate')) || 0
) * PI$2 / 180;
) * PI$2 / 180;
var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
...
@@ -34059,7 +34112,7 @@ var backwardCompat$1 = function (option) {
...
@@ -34059,7 +34112,7 @@ var backwardCompat$1 = function (option) {
option.polar = polarNotRadar;
option.polar = polarNotRadar;
}
}
each$1(option.series, function (seriesOpt) {
each$1(option.series, function (seriesOpt) {
if (seriesOpt.type === 'radar' && seriesOpt.polarIndex) {
if (seriesOpt
&& seriesOpt
.type === 'radar' && seriesOpt.polarIndex) {
seriesOpt.radarIndex = seriesOpt.polarIndex;
seriesOpt.radarIndex = seriesOpt.polarIndex;
}
}
});
});
...
@@ -34374,7 +34427,7 @@ var parseGeoJson = function (geoJson) {
...
@@ -34374,7 +34427,7 @@ var parseGeoJson = function (geoJson) {
* Mapping given x, y to transformd view x, y
* Mapping given x, y to transformd view x, y
*/
*/
var v2ApplyTransform$
2
= applyTransform;
var v2ApplyTransform$
1
= applyTransform;
// Dummy transform node
// Dummy transform node
function TransformDummy() {
function TransformDummy() {
...
@@ -34599,7 +34652,7 @@ View.prototype = {
...
@@ -34599,7 +34652,7 @@ View.prototype = {
dataToPoint: function (data) {
dataToPoint: function (data) {
var transform = this.transform;
var transform = this.transform;
return transform
return transform
? v2ApplyTransform$
2
([], data, transform)
? v2ApplyTransform$
1
([], data, transform)
: [data[0], data[1]];
: [data[0], data[1]];
},
},
...
@@ -34611,7 +34664,7 @@ View.prototype = {
...
@@ -34611,7 +34664,7 @@ View.prototype = {
pointToData: function (point) {
pointToData: function (point) {
var invTransform = this.invTransform;
var invTransform = this.invTransform;
return invTransform
return invTransform
? v2ApplyTransform$
2
([], point, invTransform)
? v2ApplyTransform$
1
([], point, invTransform)
: [point[0], point[1]];
: [point[0], point[1]];
},
},
...
@@ -36547,16 +36600,13 @@ var backwardCompat$2 = function (option) {
...
@@ -36547,16 +36600,13 @@ var backwardCompat$2 = function (option) {
// Save geoCoord
// Save geoCoord
var mapSeries = [];
var mapSeries = [];
each$1(option.series, function (seriesOpt) {
each$1(option.series, function (seriesOpt) {
if (seriesOpt.type === 'map') {
if (seriesOpt
&& seriesOpt
.type === 'map') {
mapSeries.push(seriesOpt);
mapSeries.push(seriesOpt);
seriesOpt.map = seriesOpt.map || seriesOpt.mapType;
// Put x, y, width, height, x2, y2 in the top level
defaults(seriesOpt, seriesOpt.mapLocation);
}
}
});
});
each$1(mapSeries, function (seriesOpt) {
seriesOpt.map = seriesOpt.map || seriesOpt.mapType;
// Put x, y, width, height, x2, y2 in the top level
defaults(seriesOpt, seriesOpt.mapLocation);
});
};
};
registerLayout(mapSymbolLayout);
registerLayout(mapSymbolLayout);
...
@@ -53200,10 +53250,6 @@ extendChartView({
...
@@ -53200,10 +53250,6 @@ extendChartView({
render: function (seriesModel, ecModel, api) {
render: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var data = seriesModel.getData();
if (!data.count()) {
return;
}
var group = this.group;
var group = this.group;
var layerSeries = seriesModel.getLayerSeries();
var layerSeries = seriesModel.getLayerSeries();
...
@@ -53224,9 +53270,10 @@ extendChartView({
...
@@ -53224,9 +53270,10 @@ extendChartView({
var newLayersGroups = {};
var newLayersGroups = {};
dataDiffer.add(bind(curry(process, 'add'), this))
dataDiffer
.update(bind(curry(process, 'update'), this))
.add(bind(process, this, 'add'))
.remove(bind(curry(process, 'remove'), this))
.update(bind(process, this, 'update'))
.remove(bind(process, this, 'remove'))
.execute();
.execute();
function process(status, idx, oldIdx) {
function process(status, idx, oldIdx) {
...
@@ -58772,21 +58819,22 @@ var selector = {
...
@@ -58772,21 +58819,22 @@ var selector = {
lineY: getLineSelectors(1),
lineY: getLineSelectors(1),
rect: {
rect: {
point: function (itemLayout, selectors, area) {
point: function (itemLayout, selectors, area) {
return area.boundingRect.contain(itemLayout[0], itemLayout[1]);
return
itemLayout &&
area.boundingRect.contain(itemLayout[0], itemLayout[1]);
},
},
rect: function (itemLayout, selectors, area) {
rect: function (itemLayout, selectors, area) {
return area.boundingRect.intersect(itemLayout);
return
itemLayout &&
area.boundingRect.intersect(itemLayout);
}
}
},
},
polygon: {
polygon: {
point: function (itemLayout, selectors, area) {
point: function (itemLayout, selectors, area) {
return area.boundingRect.contain(itemLayout[0], itemLayout[1])
return itemLayout
&& area.boundingRect.contain(itemLayout[0], itemLayout[1])
&& contain$1(area.range, itemLayout[0], itemLayout[1]);
&& contain$1(area.range, itemLayout[0], itemLayout[1]);
},
},
rect: function (itemLayout, selectors, area) {
rect: function (itemLayout, selectors, area) {
var points = area.range;
var points = area.range;
if (points.length <= 1) {
if (
!itemLayout ||
points.length <= 1) {
return false;
return false;
}
}
...
@@ -58818,21 +58866,25 @@ function getLineSelectors(xyIndex) {
...
@@ -58818,21 +58866,25 @@ function getLineSelectors(xyIndex) {
return {
return {
point: function (itemLayout, selectors, area) {
point: function (itemLayout, selectors, area) {
var range = area.range;
if (itemLayout) {
var p = itemLayout[xyIndex];
var range = area.range;
return inLineRange(p, range);
var p = itemLayout[xyIndex];
return inLineRange(p, range);
}
},
},
rect: function (itemLayout, selectors, area) {
rect: function (itemLayout, selectors, area) {
var range = area.range;
if (itemLayout) {
var layoutRange = [
var range = area.range;
itemLayout[xy[xyIndex]],
var layoutRange = [
itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]
itemLayout[xy[xyIndex]],
];
itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]
layoutRange[1] < layoutRange[0] && layoutRange.reverse();
];
return inLineRange(layoutRange[0], range)
layoutRange[1] < layoutRange[0] && layoutRange.reverse();
|| inLineRange(layoutRange[1], range)
return inLineRange(layoutRange[0], range)
|| inLineRange(range[0], layoutRange)
|| inLineRange(layoutRange[1], range)
|| inLineRange(range[1], layoutRange);
|| inLineRange(range[0], layoutRange)
|| inLineRange(range[1], layoutRange);
}
}
}
};
};
}
}
...
@@ -62334,12 +62386,8 @@ var DataZoomModel = extendComponentModel({
...
@@ -62334,12 +62386,8 @@ var DataZoomModel = extendComponentModel({
* @param {boolean} [ignoreUpdateRangeUsg=false]
* @param {boolean} [ignoreUpdateRangeUsg=false]
*/
*/
setRawRange: function (opt, ignoreUpdateRangeUsg) {
setRawRange: function (opt, ignoreUpdateRangeUsg) {
each$25(['start', 'end', 'startValue', 'endValue'], function (name) {
setOneSide(opt, this.option, 'start');
// If any of those prop is null/undefined, we should alos set
setOneSide(opt, this.option, 'end');
// them, because only one pair between start/end and
// startValue/endValue can work.
this.option[name] = opt[name];
}, this);
!ignoreUpdateRangeUsg && updateRangeUse(this, opt);
!ignoreUpdateRangeUsg && updateRangeUse(this, opt);
},
},
...
@@ -62415,6 +62463,24 @@ var DataZoomModel = extendComponentModel({
...
@@ -62415,6 +62463,24 @@ var DataZoomModel = extendComponentModel({
});
});
// percentName: 'start' or 'end', valueName: 'startValue' or 'endValue'
function setOneSide(inputParams, option, percentName) {
var names = [percentName, percentName + 'Value'];
var hasValueIdx;
each$25(names, function (name, index) {
if (inputParams[name] != null) {
option[name] = inputParams[name];
hasValueIdx = index;
}
});
// If only 'start' or 'startValue' is set in inputParams and then assigned
// to option, the other one should be cleared in option. because only one
// pair between start/end and startValue/endValue can work.
if (hasValueIdx != null) {
option[names[1 - hasValueIdx]] = null;
}
}
function retrieveRaw(option) {
function retrieveRaw(option) {
var ret = {};
var ret = {};
each$25(
each$25(
dist/echarts.js.map
浏览文件 @
c6ea88a4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录