逐步完成前后端服务器
This commit is contained in:
255
frontend/node_modules/echarts/lib/preprocessor/backwardCompat.js
generated
vendored
Normal file
255
frontend/node_modules/echarts/lib/preprocessor/backwardCompat.js
generated
vendored
Normal file
@ -0,0 +1,255 @@
|
||||
|
||||
/*
|
||||
* 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 { each, isArray, isObject, isTypedArray, defaults } from 'zrender/lib/core/util.js';
|
||||
import compatStyle from './helper/compatStyle.js';
|
||||
import { normalizeToArray } from '../util/model.js';
|
||||
import { deprecateLog, deprecateReplaceLog } from '../util/log.js';
|
||||
function get(opt, path) {
|
||||
var pathArr = path.split(',');
|
||||
var obj = opt;
|
||||
for (var i = 0; i < pathArr.length; i++) {
|
||||
obj = obj && obj[pathArr[i]];
|
||||
if (obj == null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function set(opt, path, val, overwrite) {
|
||||
var pathArr = path.split(',');
|
||||
var obj = opt;
|
||||
var key;
|
||||
var i = 0;
|
||||
for (; i < pathArr.length - 1; i++) {
|
||||
key = pathArr[i];
|
||||
if (obj[key] == null) {
|
||||
obj[key] = {};
|
||||
}
|
||||
obj = obj[key];
|
||||
}
|
||||
if (overwrite || obj[pathArr[i]] == null) {
|
||||
obj[pathArr[i]] = val;
|
||||
}
|
||||
}
|
||||
function compatLayoutProperties(option) {
|
||||
option && each(LAYOUT_PROPERTIES, function (prop) {
|
||||
if (prop[0] in option && !(prop[1] in option)) {
|
||||
option[prop[1]] = option[prop[0]];
|
||||
}
|
||||
});
|
||||
}
|
||||
var LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']];
|
||||
var COMPATITABLE_COMPONENTS = ['grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'];
|
||||
var BAR_ITEM_STYLE_MAP = [['borderRadius', 'barBorderRadius'], ['borderColor', 'barBorderColor'], ['borderWidth', 'barBorderWidth']];
|
||||
function compatBarItemStyle(option) {
|
||||
var itemStyle = option && option.itemStyle;
|
||||
if (itemStyle) {
|
||||
for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {
|
||||
var oldName = BAR_ITEM_STYLE_MAP[i][1];
|
||||
var newName = BAR_ITEM_STYLE_MAP[i][0];
|
||||
if (itemStyle[oldName] != null) {
|
||||
itemStyle[newName] = itemStyle[oldName];
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog(oldName, newName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function compatPieLabel(option) {
|
||||
if (!option) {
|
||||
return;
|
||||
}
|
||||
if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');
|
||||
}
|
||||
option.edgeDistance = option.margin;
|
||||
}
|
||||
}
|
||||
function compatSunburstState(option) {
|
||||
if (!option) {
|
||||
return;
|
||||
}
|
||||
if (option.downplay && !option.blur) {
|
||||
option.blur = option.downplay;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('downplay', 'blur', 'sunburst');
|
||||
}
|
||||
}
|
||||
}
|
||||
function compatGraphFocus(option) {
|
||||
if (!option) {
|
||||
return;
|
||||
}
|
||||
if (option.focusNodeAdjacency != null) {
|
||||
option.emphasis = option.emphasis || {};
|
||||
if (option.emphasis.focus == null) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \'adjacency\'}', 'graph/sankey');
|
||||
}
|
||||
option.emphasis.focus = 'adjacency';
|
||||
}
|
||||
}
|
||||
}
|
||||
function traverseTree(data, cb) {
|
||||
if (data) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
cb(data[i]);
|
||||
data[i] && traverseTree(data[i].children, cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
export default function globalBackwardCompat(option, isTheme) {
|
||||
compatStyle(option, isTheme);
|
||||
// Make sure series array for model initialization.
|
||||
option.series = normalizeToArray(option.series);
|
||||
each(option.series, function (seriesOpt) {
|
||||
if (!isObject(seriesOpt)) {
|
||||
return;
|
||||
}
|
||||
var seriesType = seriesOpt.type;
|
||||
if (seriesType === 'line') {
|
||||
if (seriesOpt.clipOverflow != null) {
|
||||
seriesOpt.clip = seriesOpt.clipOverflow;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('clipOverflow', 'clip', 'line');
|
||||
}
|
||||
}
|
||||
} else if (seriesType === 'pie' || seriesType === 'gauge') {
|
||||
if (seriesOpt.clockWise != null) {
|
||||
seriesOpt.clockwise = seriesOpt.clockWise;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('clockWise', 'clockwise');
|
||||
}
|
||||
}
|
||||
compatPieLabel(seriesOpt.label);
|
||||
var data = seriesOpt.data;
|
||||
if (data && !isTypedArray(data)) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
compatPieLabel(data[i]);
|
||||
}
|
||||
}
|
||||
if (seriesOpt.hoverOffset != null) {
|
||||
seriesOpt.emphasis = seriesOpt.emphasis || {};
|
||||
if (seriesOpt.emphasis.scaleSize = null) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');
|
||||
}
|
||||
seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;
|
||||
}
|
||||
}
|
||||
} else if (seriesType === 'gauge') {
|
||||
var pointerColor = get(seriesOpt, 'pointer.color');
|
||||
pointerColor != null && set(seriesOpt, 'itemStyle.color', pointerColor);
|
||||
} else if (seriesType === 'bar') {
|
||||
compatBarItemStyle(seriesOpt);
|
||||
compatBarItemStyle(seriesOpt.backgroundStyle);
|
||||
compatBarItemStyle(seriesOpt.emphasis);
|
||||
var data = seriesOpt.data;
|
||||
if (data && !isTypedArray(data)) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (typeof data[i] === 'object') {
|
||||
compatBarItemStyle(data[i]);
|
||||
compatBarItemStyle(data[i] && data[i].emphasis);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (seriesType === 'sunburst') {
|
||||
var highlightPolicy = seriesOpt.highlightPolicy;
|
||||
if (highlightPolicy) {
|
||||
seriesOpt.emphasis = seriesOpt.emphasis || {};
|
||||
if (!seriesOpt.emphasis.focus) {
|
||||
seriesOpt.emphasis.focus = highlightPolicy;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');
|
||||
}
|
||||
}
|
||||
}
|
||||
compatSunburstState(seriesOpt);
|
||||
traverseTree(seriesOpt.data, compatSunburstState);
|
||||
} else if (seriesType === 'graph' || seriesType === 'sankey') {
|
||||
compatGraphFocus(seriesOpt);
|
||||
// TODO nodes, edges?
|
||||
} else if (seriesType === 'map') {
|
||||
if (seriesOpt.mapType && !seriesOpt.map) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('mapType', 'map', 'map');
|
||||
}
|
||||
seriesOpt.map = seriesOpt.mapType;
|
||||
}
|
||||
if (seriesOpt.mapLocation) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateLog('`mapLocation` is not used anymore.');
|
||||
}
|
||||
defaults(seriesOpt, seriesOpt.mapLocation);
|
||||
}
|
||||
}
|
||||
if (seriesOpt.hoverAnimation != null) {
|
||||
seriesOpt.emphasis = seriesOpt.emphasis || {};
|
||||
if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog('hoverAnimation', 'emphasis.scale');
|
||||
}
|
||||
seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;
|
||||
}
|
||||
}
|
||||
compatLayoutProperties(seriesOpt);
|
||||
});
|
||||
// dataRange has changed to visualMap
|
||||
if (option.dataRange) {
|
||||
option.visualMap = option.dataRange;
|
||||
}
|
||||
each(COMPATITABLE_COMPONENTS, function (componentName) {
|
||||
var options = option[componentName];
|
||||
if (options) {
|
||||
if (!isArray(options)) {
|
||||
options = [options];
|
||||
}
|
||||
each(options, function (option) {
|
||||
compatLayoutProperties(option);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
330
frontend/node_modules/echarts/lib/preprocessor/helper/compatStyle.js
generated
vendored
Normal file
330
frontend/node_modules/echarts/lib/preprocessor/helper/compatStyle.js
generated
vendored
Normal file
@ -0,0 +1,330 @@
|
||||
|
||||
/*
|
||||
* 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 * as zrUtil from 'zrender/lib/core/util.js';
|
||||
import * as modelUtil from '../../util/model.js';
|
||||
import { deprecateLog, deprecateReplaceLog } from '../../util/log.js';
|
||||
var each = zrUtil.each;
|
||||
var isObject = zrUtil.isObject;
|
||||
var POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine'];
|
||||
function compatEC2ItemStyle(opt) {
|
||||
var itemStyleOpt = opt && opt.itemStyle;
|
||||
if (!itemStyleOpt) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {
|
||||
var styleName = POSSIBLE_STYLES[i];
|
||||
var normalItemStyleOpt = itemStyleOpt.normal;
|
||||
var emphasisItemStyleOpt = itemStyleOpt.emphasis;
|
||||
if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog("itemStyle.normal." + styleName, styleName);
|
||||
}
|
||||
opt[styleName] = opt[styleName] || {};
|
||||
if (!opt[styleName].normal) {
|
||||
opt[styleName].normal = normalItemStyleOpt[styleName];
|
||||
} else {
|
||||
zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);
|
||||
}
|
||||
normalItemStyleOpt[styleName] = null;
|
||||
}
|
||||
if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateReplaceLog("itemStyle.emphasis." + styleName, "emphasis." + styleName);
|
||||
}
|
||||
opt[styleName] = opt[styleName] || {};
|
||||
if (!opt[styleName].emphasis) {
|
||||
opt[styleName].emphasis = emphasisItemStyleOpt[styleName];
|
||||
} else {
|
||||
zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);
|
||||
}
|
||||
emphasisItemStyleOpt[styleName] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
function convertNormalEmphasis(opt, optType, useExtend) {
|
||||
if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {
|
||||
var normalOpt = opt[optType].normal;
|
||||
var emphasisOpt = opt[optType].emphasis;
|
||||
if (normalOpt) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// eslint-disable-next-line max-len
|
||||
deprecateLog("'normal' hierarchy in " + optType + " has been removed since 4.0. All style properties are configured in " + optType + " directly now.");
|
||||
}
|
||||
// Timeline controlStyle has other properties besides normal and emphasis
|
||||
if (useExtend) {
|
||||
opt[optType].normal = opt[optType].emphasis = null;
|
||||
zrUtil.defaults(opt[optType], normalOpt);
|
||||
} else {
|
||||
opt[optType] = normalOpt;
|
||||
}
|
||||
}
|
||||
if (emphasisOpt) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateLog(optType + ".emphasis has been changed to emphasis." + optType + " since 4.0");
|
||||
}
|
||||
opt.emphasis = opt.emphasis || {};
|
||||
opt.emphasis[optType] = emphasisOpt;
|
||||
// Also compat the case user mix the style and focus together in ec3 style
|
||||
// for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }
|
||||
if (emphasisOpt.focus) {
|
||||
opt.emphasis.focus = emphasisOpt.focus;
|
||||
}
|
||||
if (emphasisOpt.blurScope) {
|
||||
opt.emphasis.blurScope = emphasisOpt.blurScope;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function removeEC3NormalStatus(opt) {
|
||||
convertNormalEmphasis(opt, 'itemStyle');
|
||||
convertNormalEmphasis(opt, 'lineStyle');
|
||||
convertNormalEmphasis(opt, 'areaStyle');
|
||||
convertNormalEmphasis(opt, 'label');
|
||||
convertNormalEmphasis(opt, 'labelLine');
|
||||
// treemap
|
||||
convertNormalEmphasis(opt, 'upperLabel');
|
||||
// graph
|
||||
convertNormalEmphasis(opt, 'edgeLabel');
|
||||
}
|
||||
function compatTextStyle(opt, propName) {
|
||||
// Check whether is not object (string\null\undefined ...)
|
||||
var labelOptSingle = isObject(opt) && opt[propName];
|
||||
var textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;
|
||||
if (textStyle) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// eslint-disable-next-line max-len
|
||||
deprecateLog("textStyle hierarchy in " + propName + " has been removed since 4.0. All textStyle properties are configured in " + propName + " directly now.");
|
||||
}
|
||||
for (var i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {
|
||||
var textPropName = modelUtil.TEXT_STYLE_OPTIONS[i];
|
||||
if (textStyle.hasOwnProperty(textPropName)) {
|
||||
labelOptSingle[textPropName] = textStyle[textPropName];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function compatEC3CommonStyles(opt) {
|
||||
if (opt) {
|
||||
removeEC3NormalStatus(opt);
|
||||
compatTextStyle(opt, 'label');
|
||||
opt.emphasis && compatTextStyle(opt.emphasis, 'label');
|
||||
}
|
||||
}
|
||||
function processSeries(seriesOpt) {
|
||||
if (!isObject(seriesOpt)) {
|
||||
return;
|
||||
}
|
||||
compatEC2ItemStyle(seriesOpt);
|
||||
removeEC3NormalStatus(seriesOpt);
|
||||
compatTextStyle(seriesOpt, 'label');
|
||||
// treemap
|
||||
compatTextStyle(seriesOpt, 'upperLabel');
|
||||
// graph
|
||||
compatTextStyle(seriesOpt, 'edgeLabel');
|
||||
if (seriesOpt.emphasis) {
|
||||
compatTextStyle(seriesOpt.emphasis, 'label');
|
||||
// treemap
|
||||
compatTextStyle(seriesOpt.emphasis, 'upperLabel');
|
||||
// graph
|
||||
compatTextStyle(seriesOpt.emphasis, 'edgeLabel');
|
||||
}
|
||||
var markPoint = seriesOpt.markPoint;
|
||||
if (markPoint) {
|
||||
compatEC2ItemStyle(markPoint);
|
||||
compatEC3CommonStyles(markPoint);
|
||||
}
|
||||
var markLine = seriesOpt.markLine;
|
||||
if (markLine) {
|
||||
compatEC2ItemStyle(markLine);
|
||||
compatEC3CommonStyles(markLine);
|
||||
}
|
||||
var markArea = seriesOpt.markArea;
|
||||
if (markArea) {
|
||||
compatEC3CommonStyles(markArea);
|
||||
}
|
||||
var data = seriesOpt.data;
|
||||
// Break with ec3: if `setOption` again, there may be no `type` in option,
|
||||
// then the backward compat based on option type will not be performed.
|
||||
if (seriesOpt.type === 'graph') {
|
||||
data = data || seriesOpt.nodes;
|
||||
var edgeData = seriesOpt.links || seriesOpt.edges;
|
||||
if (edgeData && !zrUtil.isTypedArray(edgeData)) {
|
||||
for (var i = 0; i < edgeData.length; i++) {
|
||||
compatEC3CommonStyles(edgeData[i]);
|
||||
}
|
||||
}
|
||||
zrUtil.each(seriesOpt.categories, function (opt) {
|
||||
removeEC3NormalStatus(opt);
|
||||
});
|
||||
}
|
||||
if (data && !zrUtil.isTypedArray(data)) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
compatEC3CommonStyles(data[i]);
|
||||
}
|
||||
}
|
||||
// mark point data
|
||||
markPoint = seriesOpt.markPoint;
|
||||
if (markPoint && markPoint.data) {
|
||||
var mpData = markPoint.data;
|
||||
for (var i = 0; i < mpData.length; i++) {
|
||||
compatEC3CommonStyles(mpData[i]);
|
||||
}
|
||||
}
|
||||
// mark line data
|
||||
markLine = seriesOpt.markLine;
|
||||
if (markLine && markLine.data) {
|
||||
var mlData = markLine.data;
|
||||
for (var i = 0; i < mlData.length; i++) {
|
||||
if (zrUtil.isArray(mlData[i])) {
|
||||
compatEC3CommonStyles(mlData[i][0]);
|
||||
compatEC3CommonStyles(mlData[i][1]);
|
||||
} else {
|
||||
compatEC3CommonStyles(mlData[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Series
|
||||
if (seriesOpt.type === 'gauge') {
|
||||
compatTextStyle(seriesOpt, 'axisLabel');
|
||||
compatTextStyle(seriesOpt, 'title');
|
||||
compatTextStyle(seriesOpt, 'detail');
|
||||
} else if (seriesOpt.type === 'treemap') {
|
||||
convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');
|
||||
zrUtil.each(seriesOpt.levels, function (opt) {
|
||||
removeEC3NormalStatus(opt);
|
||||
});
|
||||
} else if (seriesOpt.type === 'tree') {
|
||||
removeEC3NormalStatus(seriesOpt.leaves);
|
||||
}
|
||||
// sunburst starts from ec4, so it does not need to compat levels.
|
||||
}
|
||||
function toArr(o) {
|
||||
return zrUtil.isArray(o) ? o : o ? [o] : [];
|
||||
}
|
||||
function toObj(o) {
|
||||
return (zrUtil.isArray(o) ? o[0] : o) || {};
|
||||
}
|
||||
export default function globalCompatStyle(option, isTheme) {
|
||||
each(toArr(option.series), function (seriesOpt) {
|
||||
isObject(seriesOpt) && processSeries(seriesOpt);
|
||||
});
|
||||
var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];
|
||||
isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');
|
||||
each(axes, function (axisName) {
|
||||
each(toArr(option[axisName]), function (axisOpt) {
|
||||
if (axisOpt) {
|
||||
compatTextStyle(axisOpt, 'axisLabel');
|
||||
compatTextStyle(axisOpt.axisPointer, 'label');
|
||||
}
|
||||
});
|
||||
});
|
||||
each(toArr(option.parallel), function (parallelOpt) {
|
||||
var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;
|
||||
compatTextStyle(parallelAxisDefault, 'axisLabel');
|
||||
compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');
|
||||
});
|
||||
each(toArr(option.calendar), function (calendarOpt) {
|
||||
convertNormalEmphasis(calendarOpt, 'itemStyle');
|
||||
compatTextStyle(calendarOpt, 'dayLabel');
|
||||
compatTextStyle(calendarOpt, 'monthLabel');
|
||||
compatTextStyle(calendarOpt, 'yearLabel');
|
||||
});
|
||||
// radar.name.textStyle
|
||||
each(toArr(option.radar), function (radarOpt) {
|
||||
compatTextStyle(radarOpt, 'name');
|
||||
// Use axisName instead of name because component has name property
|
||||
if (radarOpt.name && radarOpt.axisName == null) {
|
||||
radarOpt.axisName = radarOpt.name;
|
||||
delete radarOpt.name;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateLog('name property in radar component has been changed to axisName');
|
||||
}
|
||||
}
|
||||
if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {
|
||||
radarOpt.axisNameGap = radarOpt.nameGap;
|
||||
delete radarOpt.nameGap;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
deprecateLog('nameGap property in radar component has been changed to axisNameGap');
|
||||
}
|
||||
}
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
each(radarOpt.indicator, function (indicatorOpt) {
|
||||
if (indicatorOpt.text) {
|
||||
deprecateReplaceLog('text', 'name', 'radar.indicator');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
each(toArr(option.geo), function (geoOpt) {
|
||||
if (isObject(geoOpt)) {
|
||||
compatEC3CommonStyles(geoOpt);
|
||||
each(toArr(geoOpt.regions), function (regionObj) {
|
||||
compatEC3CommonStyles(regionObj);
|
||||
});
|
||||
}
|
||||
});
|
||||
each(toArr(option.timeline), function (timelineOpt) {
|
||||
compatEC3CommonStyles(timelineOpt);
|
||||
convertNormalEmphasis(timelineOpt, 'label');
|
||||
convertNormalEmphasis(timelineOpt, 'itemStyle');
|
||||
convertNormalEmphasis(timelineOpt, 'controlStyle', true);
|
||||
var data = timelineOpt.data;
|
||||
zrUtil.isArray(data) && zrUtil.each(data, function (item) {
|
||||
if (zrUtil.isObject(item)) {
|
||||
convertNormalEmphasis(item, 'label');
|
||||
convertNormalEmphasis(item, 'itemStyle');
|
||||
}
|
||||
});
|
||||
});
|
||||
each(toArr(option.toolbox), function (toolboxOpt) {
|
||||
convertNormalEmphasis(toolboxOpt, 'iconStyle');
|
||||
each(toolboxOpt.feature, function (featureOpt) {
|
||||
convertNormalEmphasis(featureOpt, 'iconStyle');
|
||||
});
|
||||
});
|
||||
compatTextStyle(toObj(option.axisPointer), 'label');
|
||||
compatTextStyle(toObj(option.tooltip).axisPointer, 'label');
|
||||
// Clean logs
|
||||
// storedLogs = {};
|
||||
}
|
Reference in New Issue
Block a user