Skip to content

Commit 52fc944

Browse files
committed
tweak examples.
1 parent fc3c34f commit 52fc944

20 files changed

+390
-571
lines changed

dist/echarts-en.common.js

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26551,8 +26551,22 @@ Axis.prototype = {
2655126551
return Math.abs(size) / len;
2655226552
},
2655326553

26554+
/**
26555+
* @abstract
26556+
* @return {boolean} Is horizontal
26557+
*/
26558+
isHorizontal: null,
26559+
26560+
/**
26561+
* @abstract
26562+
* @return {number} Get axis rotate, by degree.
26563+
*/
26564+
getRotate: null,
26565+
2655426566
/**
2655526567
* Get interval of the axis label.
26568+
* To get precise result, at least one of `getRotate` and `isHorizontal`
26569+
* should be implemented.
2655626570
* @return {number}
2655726571
*/
2655826572
getLabelInterval: function () {
@@ -26569,7 +26583,11 @@ Axis.prototype = {
2656926583
map(this.scale.getTicks(), this.dataToCoord, this),
2657026584
axisModel.getFormattedLabels(),
2657126585
labelModel.getFont(),
26572-
this.isHorizontal() ? 0 : 90,
26586+
this.getRotate
26587+
? this.getRotate()
26588+
: (this.isHorizontal && !this.isHorizontal())
26589+
? 90
26590+
: 0,
2657326591
labelModel.get('rotate')
2657426592
);
2657526593
}
@@ -40635,8 +40653,18 @@ var DataZoomModel = extendComponentModel({
4063540653
* @param {boolean} [ignoreUpdateRangeUsg=false]
4063640654
*/
4063740655
setRawRange: function (opt, ignoreUpdateRangeUsg) {
40638-
setOneSide(opt, this.option, 'start');
40639-
setOneSide(opt, this.option, 'end');
40656+
var option = this.option;
40657+
each$15([['start', 'startValue'], ['end', 'endValue']], function (names) {
40658+
// If only one of 'start' and 'startValue' is not null/undefined, the other
40659+
// should be cleared, which enable clear the option.
40660+
// If both of them are not set, keep option with the original value, which
40661+
// enable use only set start but not set end when calling `dispatchAction`.
40662+
// The same as 'end' and 'endValue'.
40663+
if (opt[names[0]] != null || opt[names[1]] != null) {
40664+
option[names[0]] = opt[names[0]];
40665+
option[names[1]] = opt[names[1]];
40666+
}
40667+
}, this);
4064040668

4064140669
!ignoreUpdateRangeUsg && updateRangeUse(this, opt);
4064240670
},
@@ -40712,24 +40740,6 @@ var DataZoomModel = extendComponentModel({
4071240740

4071340741
});
4071440742

40715-
// percentName: 'start' or 'end', valueName: 'startValue' or 'endValue'
40716-
function setOneSide(inputParams, option, percentName) {
40717-
var names = [percentName, percentName + 'Value'];
40718-
var hasValueIdx;
40719-
each$15(names, function (name, index) {
40720-
if (inputParams[name] != null) {
40721-
option[name] = inputParams[name];
40722-
hasValueIdx = index;
40723-
}
40724-
});
40725-
// If only 'start' or 'startValue' is set in inputParams and then assigned
40726-
// to option, the other one should be cleared in option. because only one
40727-
// pair between start/end and startValue/endValue can work.
40728-
if (hasValueIdx != null) {
40729-
option[names[1 - hasValueIdx]] = null;
40730-
}
40731-
}
40732-
4073340743
function retrieveRaw(option) {
4073440744
var ret = {};
4073540745
each$15(
@@ -45445,11 +45455,11 @@ var win = window;
4544545455

4544645456
var vmlInited = false;
4544745457

45448-
var doc = win.document;
45458+
var doc = win && win.document;
4544945459

4545045460
var createNode;
4545145461

45452-
if (!env$1.canvasSupported) {
45462+
if (doc && !env$1.canvasSupported) {
4545345463
try {
4545445464
!doc.namespaces.zrvml && doc.namespaces.add('zrvml', urn);
4545545465
createNode = function (tagName) {
@@ -45465,7 +45475,7 @@ if (!env$1.canvasSupported) {
4546545475

4546645476
// From raphael
4546745477
function initVML() {
45468-
if (vmlInited) {
45478+
if (vmlInited || !doc) {
4546945479
return;
4547045480
}
4547145481
vmlInited = true;
@@ -48080,6 +48090,7 @@ var SVGPainter = function (root, storage) {
4808048090
svgRoot.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
4808148091
svgRoot.setAttribute('version', '1.1');
4808248092
svgRoot.setAttribute('baseProfile', 'full');
48093+
svgRoot.style['user-select'] = 'none';
4808348094

4808448095
this.gradientManager = new GradientManager(svgRoot);
4808548096
this.clipPathManager = new ClippathManager(svgRoot);

dist/echarts-en.common.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts-en.js

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26640,8 +26640,22 @@ Axis.prototype = {
2664026640
return Math.abs(size) / len;
2664126641
},
2664226642

26643+
/**
26644+
* @abstract
26645+
* @return {boolean} Is horizontal
26646+
*/
26647+
isHorizontal: null,
26648+
26649+
/**
26650+
* @abstract
26651+
* @return {number} Get axis rotate, by degree.
26652+
*/
26653+
getRotate: null,
26654+
2664326655
/**
2664426656
* Get interval of the axis label.
26657+
* To get precise result, at least one of `getRotate` and `isHorizontal`
26658+
* should be implemented.
2664526659
* @return {number}
2664626660
*/
2664726661
getLabelInterval: function () {
@@ -26658,7 +26672,11 @@ Axis.prototype = {
2665826672
map(this.scale.getTicks(), this.dataToCoord, this),
2665926673
axisModel.getFormattedLabels(),
2666026674
labelModel.getFont(),
26661-
this.isHorizontal() ? 0 : 90,
26675+
this.getRotate
26676+
? this.getRotate()
26677+
: (this.isHorizontal && !this.isHorizontal())
26678+
? 90
26679+
: 0,
2666226680
labelModel.get('rotate')
2666326681
);
2666426682
}
@@ -44942,7 +44960,14 @@ ParallelAxis.prototype = {
4494244960
* Axis model
4494344961
* @param {module:echarts/coord/parallel/AxisModel}
4494444962
*/
44945-
model: null
44963+
model: null,
44964+
44965+
/**
44966+
* @override
44967+
*/
44968+
isHorizontal: function () {
44969+
return this.coordinateSystem.getModel().get('layout') !== 'horizontal';
44970+
}
4494644971

4494744972
};
4494844973

@@ -45146,6 +45171,10 @@ Parallel.prototype = {
4514645171
&& pLayout <= layoutBase + layoutInfo.layoutLength;
4514745172
},
4514845173

45174+
getModel: function () {
45175+
return this._model;
45176+
},
45177+
4514945178
/**
4515045179
* Update properties from series
4515145180
* @private
@@ -63608,8 +63637,18 @@ var DataZoomModel = extendComponentModel({
6360863637
* @param {boolean} [ignoreUpdateRangeUsg=false]
6360963638
*/
6361063639
setRawRange: function (opt, ignoreUpdateRangeUsg) {
63611-
setOneSide(opt, this.option, 'start');
63612-
setOneSide(opt, this.option, 'end');
63640+
var option = this.option;
63641+
each$24([['start', 'startValue'], ['end', 'endValue']], function (names) {
63642+
// If only one of 'start' and 'startValue' is not null/undefined, the other
63643+
// should be cleared, which enable clear the option.
63644+
// If both of them are not set, keep option with the original value, which
63645+
// enable use only set start but not set end when calling `dispatchAction`.
63646+
// The same as 'end' and 'endValue'.
63647+
if (opt[names[0]] != null || opt[names[1]] != null) {
63648+
option[names[0]] = opt[names[0]];
63649+
option[names[1]] = opt[names[1]];
63650+
}
63651+
}, this);
6361363652

6361463653
!ignoreUpdateRangeUsg && updateRangeUse(this, opt);
6361563654
},
@@ -63685,24 +63724,6 @@ var DataZoomModel = extendComponentModel({
6368563724

6368663725
});
6368763726

63688-
// percentName: 'start' or 'end', valueName: 'startValue' or 'endValue'
63689-
function setOneSide(inputParams, option, percentName) {
63690-
var names = [percentName, percentName + 'Value'];
63691-
var hasValueIdx;
63692-
each$24(names, function (name, index) {
63693-
if (inputParams[name] != null) {
63694-
option[name] = inputParams[name];
63695-
hasValueIdx = index;
63696-
}
63697-
});
63698-
// If only 'start' or 'startValue' is set in inputParams and then assigned
63699-
// to option, the other one should be cleared in option. because only one
63700-
// pair between start/end and startValue/endValue can work.
63701-
if (hasValueIdx != null) {
63702-
option[names[1 - hasValueIdx]] = null;
63703-
}
63704-
}
63705-
6370663727
function retrieveRaw(option) {
6370763728
var ret = {};
6370863729
each$24(
@@ -71765,11 +71786,11 @@ var win = window;
7176571786

7176671787
var vmlInited = false;
7176771788

71768-
var doc = win.document;
71789+
var doc = win && win.document;
7176971790

7177071791
var createNode;
7177171792

71772-
if (!env$1.canvasSupported) {
71793+
if (doc && !env$1.canvasSupported) {
7177371794
try {
7177471795
!doc.namespaces.zrvml && doc.namespaces.add('zrvml', urn);
7177571796
createNode = function (tagName) {
@@ -71785,7 +71806,7 @@ if (!env$1.canvasSupported) {
7178571806

7178671807
// From raphael
7178771808
function initVML() {
71788-
if (vmlInited) {
71809+
if (vmlInited || !doc) {
7178971810
return;
7179071811
}
7179171812
vmlInited = true;
@@ -74400,6 +74421,7 @@ var SVGPainter = function (root, storage) {
7440074421
svgRoot.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
7440174422
svgRoot.setAttribute('version', '1.1');
7440274423
svgRoot.setAttribute('baseProfile', 'full');
74424+
svgRoot.style['user-select'] = 'none';
7440374425

7440474426
this.gradientManager = new GradientManager(svgRoot);
7440574427
this.clipPathManager = new ClippathManager(svgRoot);

dist/echarts-en.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts-en.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts-en.simple.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27920,8 +27920,22 @@ Axis.prototype = {
2792027920
return Math.abs(size) / len;
2792127921
},
2792227922

27923+
/**
27924+
* @abstract
27925+
* @return {boolean} Is horizontal
27926+
*/
27927+
isHorizontal: null,
27928+
27929+
/**
27930+
* @abstract
27931+
* @return {number} Get axis rotate, by degree.
27932+
*/
27933+
getRotate: null,
27934+
2792327935
/**
2792427936
* Get interval of the axis label.
27937+
* To get precise result, at least one of `getRotate` and `isHorizontal`
27938+
* should be implemented.
2792527939
* @return {number}
2792627940
*/
2792727941
getLabelInterval: function () {
@@ -27938,7 +27952,11 @@ Axis.prototype = {
2793827952
map(this.scale.getTicks(), this.dataToCoord, this),
2793927953
axisModel.getFormattedLabels(),
2794027954
labelModel.getFont(),
27941-
this.isHorizontal() ? 0 : 90,
27955+
this.getRotate
27956+
? this.getRotate()
27957+
: (this.isHorizontal && !this.isHorizontal())
27958+
? 90
27959+
: 0,
2794227960
labelModel.get('rotate')
2794327961
);
2794427962
}

dist/echarts-en.simple.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)