first commit

This commit is contained in:
jefferyzhao
2025-07-31 17:44:12 +08:00
commit b9bdc8598b
42390 changed files with 4467935 additions and 0 deletions

116
node_modules/echarts/lib/coord/single/AxisModel.js generated vendored Normal file
View File

@ -0,0 +1,116 @@
/*
* 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.
*/
var zrUtil = require("zrender/lib/core/util");
var ComponentModel = require("../../model/Component");
var axisModelCreator = require("../axisModelCreator");
var axisModelCommonMixin = require("../axisModelCommonMixin");
/*
* 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.
*/
var AxisModel = ComponentModel.extend({
type: 'singleAxis',
layoutMode: 'box',
/**
* @type {module:echarts/coord/single/SingleAxis}
*/
axis: null,
/**
* @type {module:echarts/coord/single/Single}
*/
coordinateSystem: null,
/**
* @override
*/
getCoordSysModel: function () {
return this;
}
});
var defaultOption = {
left: '5%',
top: '5%',
right: '5%',
bottom: '5%',
type: 'value',
position: 'bottom',
orient: 'horizontal',
axisLine: {
show: true,
lineStyle: {
width: 1,
type: 'solid'
}
},
// Single coordinate system and single axis is the,
// which is used as the parent tooltip model.
// same model, so we set default tooltip show as true.
tooltip: {
show: true
},
axisTick: {
show: true,
length: 6,
lineStyle: {
width: 1
}
},
axisLabel: {
show: true,
interval: 'auto'
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed',
opacity: 0.2
}
}
};
function getAxisType(axisName, option) {
return option.type || (option.data ? 'category' : 'value');
}
zrUtil.merge(AxisModel.prototype, axisModelCommonMixin);
axisModelCreator('single', AxisModel, getAxisType, defaultOption);
var _default = AxisModel;
module.exports = _default;

288
node_modules/echarts/lib/coord/single/Single.js generated vendored Normal file
View File

@ -0,0 +1,288 @@
/*
* 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.
*/
var SingleAxis = require("./SingleAxis");
var axisHelper = require("../axisHelper");
var _layout = require("../../util/layout");
var getLayoutRect = _layout.getLayoutRect;
var _util = require("zrender/lib/core/util");
var each = _util.each;
/*
* 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.
*/
/**
* Single coordinates system.
*/
/**
* Create a single coordinates system.
*
* @param {module:echarts/coord/single/AxisModel} axisModel
* @param {module:echarts/model/Global} ecModel
* @param {module:echarts/ExtensionAPI} api
*/
function Single(axisModel, ecModel, api) {
/**
* @type {string}
* @readOnly
*/
this.dimension = 'single';
/**
* Add it just for draw tooltip.
*
* @type {Array.<string>}
* @readOnly
*/
this.dimensions = ['single'];
/**
* @private
* @type {module:echarts/coord/single/SingleAxis}.
*/
this._axis = null;
/**
* @private
* @type {module:zrender/core/BoundingRect}
*/
this._rect;
this._init(axisModel, ecModel, api);
/**
* @type {module:echarts/coord/single/AxisModel}
*/
this.model = axisModel;
}
Single.prototype = {
type: 'singleAxis',
axisPointerEnabled: true,
constructor: Single,
/**
* Initialize single coordinate system.
*
* @param {module:echarts/coord/single/AxisModel} axisModel
* @param {module:echarts/model/Global} ecModel
* @param {module:echarts/ExtensionAPI} api
* @private
*/
_init: function (axisModel, ecModel, api) {
var dim = this.dimension;
var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));
var isCategory = axis.type === 'category';
axis.onBand = isCategory && axisModel.get('boundaryGap');
axis.inverse = axisModel.get('inverse');
axis.orient = axisModel.get('orient');
axisModel.axis = axis;
axis.model = axisModel;
axis.coordinateSystem = this;
this._axis = axis;
},
/**
* Update axis scale after data processed
* @param {module:echarts/model/Global} ecModel
* @param {module:echarts/ExtensionAPI} api
*/
update: function (ecModel, api) {
ecModel.eachSeries(function (seriesModel) {
if (seriesModel.coordinateSystem === this) {
var data = seriesModel.getData();
each(data.mapDimension(this.dimension, true), function (dim) {
this._axis.scale.unionExtentFromData(data, dim);
}, this);
axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);
}
}, this);
},
/**
* Resize the single coordinate system.
*
* @param {module:echarts/coord/single/AxisModel} axisModel
* @param {module:echarts/ExtensionAPI} api
*/
resize: function (axisModel, api) {
this._rect = getLayoutRect({
left: axisModel.get('left'),
top: axisModel.get('top'),
right: axisModel.get('right'),
bottom: axisModel.get('bottom'),
width: axisModel.get('width'),
height: axisModel.get('height')
}, {
width: api.getWidth(),
height: api.getHeight()
});
this._adjustAxis();
},
/**
* @return {module:zrender/core/BoundingRect}
*/
getRect: function () {
return this._rect;
},
/**
* @private
*/
_adjustAxis: function () {
var rect = this._rect;
var axis = this._axis;
var isHorizontal = axis.isHorizontal();
var extent = isHorizontal ? [0, rect.width] : [0, rect.height];
var idx = axis.reverse ? 1 : 0;
axis.setExtent(extent[idx], extent[1 - idx]);
this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);
},
/**
* @param {module:echarts/coord/single/SingleAxis} axis
* @param {number} coordBase
*/
_updateAxisTransform: function (axis, coordBase) {
var axisExtent = axis.getExtent();
var extentSum = axisExtent[0] + axisExtent[1];
var isHorizontal = axis.isHorizontal();
axis.toGlobalCoord = isHorizontal ? function (coord) {
return coord + coordBase;
} : function (coord) {
return extentSum - coord + coordBase;
};
axis.toLocalCoord = isHorizontal ? function (coord) {
return coord - coordBase;
} : function (coord) {
return extentSum - coord + coordBase;
};
},
/**
* Get axis.
*
* @return {module:echarts/coord/single/SingleAxis}
*/
getAxis: function () {
return this._axis;
},
/**
* Get axis, add it just for draw tooltip.
*
* @return {[type]} [description]
*/
getBaseAxis: function () {
return this._axis;
},
/**
* @return {Array.<module:echarts/coord/Axis>}
*/
getAxes: function () {
return [this._axis];
},
/**
* @return {Object} {baseAxes: [], otherAxes: []}
*/
getTooltipAxes: function () {
return {
baseAxes: [this.getAxis()]
};
},
/**
* If contain point.
*
* @param {Array.<number>} point
* @return {boolean}
*/
containPoint: function (point) {
var rect = this.getRect();
var axis = this.getAxis();
var orient = axis.orient;
if (orient === 'horizontal') {
return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;
} else {
return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;
}
},
/**
* @param {Array.<number>} point
* @return {Array.<number>}
*/
pointToData: function (point) {
var axis = this.getAxis();
return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];
},
/**
* Convert the series data to concrete point.
*
* @param {number|Array.<number>} val
* @return {Array.<number>}
*/
dataToPoint: function (val) {
var axis = this.getAxis();
var rect = this.getRect();
var pt = [];
var idx = axis.orient === 'horizontal' ? 0 : 1;
if (val instanceof Array) {
val = val[0];
}
pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));
pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;
return pt;
}
};
var _default = Single;
module.exports = _default;

127
node_modules/echarts/lib/coord/single/SingleAxis.js generated vendored Normal file
View File

@ -0,0 +1,127 @@
/*
* 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.
*/
var zrUtil = require("zrender/lib/core/util");
var Axis = require("../Axis");
/*
* 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.
*/
/**
* @constructor module:echarts/coord/single/SingleAxis
* @extends {module:echarts/coord/Axis}
* @param {string} dim
* @param {*} scale
* @param {Array.<number>} coordExtent
* @param {string} axisType
* @param {string} position
*/
var SingleAxis = function (dim, scale, coordExtent, axisType, position) {
Axis.call(this, dim, scale, coordExtent);
/**
* Axis type
* - 'category'
* - 'value'
* - 'time'
* - 'log'
* @type {string}
*/
this.type = axisType || 'value';
/**
* Axis position
* - 'top'
* - 'bottom'
* - 'left'
* - 'right'
* @type {string}
*/
this.position = position || 'bottom';
/**
* Axis orient
* - 'horizontal'
* - 'vertical'
* @type {[type]}
*/
this.orient = null;
};
SingleAxis.prototype = {
constructor: SingleAxis,
/**
* Axis model
* @type {module:echarts/coord/single/AxisModel}
*/
model: null,
/**
* Judge the orient of the axis.
* @return {boolean}
*/
isHorizontal: function () {
var position = this.position;
return position === 'top' || position === 'bottom';
},
/**
* @override
*/
pointToData: function (point, clamp) {
return this.coordinateSystem.pointToData(point, clamp)[0];
},
/**
* Convert the local coord(processed by dataToCoord())
* to global coord(concrete pixel coord).
* designated by module:echarts/coord/single/Single.
* @type {Function}
*/
toGlobalCoord: null,
/**
* Convert the global coord to local coord.
* designated by module:echarts/coord/single/Single.
* @type {Function}
*/
toLocalCoord: null
};
zrUtil.inherits(SingleAxis, Axis);
var _default = SingleAxis;
module.exports = _default;

69
node_modules/echarts/lib/coord/single/prepareCustom.js generated vendored Normal file
View File

@ -0,0 +1,69 @@
/*
* 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.
*/
var zrUtil = require("zrender/lib/core/util");
/*
* 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 dataToCoordSize(dataSize, dataItem) {
// dataItem is necessary in log axis.
var axis = this.getAxis();
var val = dataItem instanceof Array ? dataItem[0] : dataItem;
var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;
return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));
}
function _default(coordSys) {
var rect = coordSys.getRect();
return {
coordSys: {
type: 'singleAxis',
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height
},
api: {
coord: function (val) {
// do not provide "out" param
return coordSys.dataToPoint(val);
},
size: zrUtil.bind(dataToCoordSize, coordSys)
}
};
}
module.exports = _default;

View File

@ -0,0 +1,97 @@
/*
* 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.
*/
var zrUtil = require("zrender/lib/core/util");
/*
* 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.
*/
/**
* @param {Object} opt {labelInside}
* @return {Object} {
* position, rotation, labelDirection, labelOffset,
* tickDirection, labelRotate, z2
* }
*/
function layout(axisModel, opt) {
opt = opt || {};
var single = axisModel.coordinateSystem;
var axis = axisModel.axis;
var layout = {};
var axisPosition = axis.position;
var orient = axis.orient;
var rect = single.getRect();
var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
var positionMap = {
horizontal: {
top: rectBound[2],
bottom: rectBound[3]
},
vertical: {
left: rectBound[0],
right: rectBound[1]
}
};
layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];
var r = {
horizontal: 0,
vertical: 1
};
layout.rotation = Math.PI / 2 * r[orient];
var directionMap = {
top: -1,
bottom: 1,
right: 1,
left: -1
};
layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];
if (axisModel.get('axisTick.inside')) {
layout.tickDirection = -layout.tickDirection;
}
if (zrUtil.retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) {
layout.labelDirection = -layout.labelDirection;
}
var labelRotation = opt.rotate;
labelRotation == null && (labelRotation = axisModel.get('axisLabel.rotate'));
layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;
layout.z2 = 1;
return layout;
}
exports.layout = layout;

80
node_modules/echarts/lib/coord/single/singleCreator.js generated vendored Normal file
View File

@ -0,0 +1,80 @@
/*
* 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.
*/
var Single = require("./Single");
var CoordinateSystem = require("../../CoordinateSystem");
/*
* 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.
*/
/**
* Single coordinate system creator.
*/
/**
* Create single coordinate system and inject it into seriesModel.
*
* @param {module:echarts/model/Global} ecModel
* @param {module:echarts/ExtensionAPI} api
* @return {Array.<module:echarts/coord/single/Single>}
*/
function create(ecModel, api) {
var singles = [];
ecModel.eachComponent('singleAxis', function (axisModel, idx) {
var single = new Single(axisModel, ecModel, api);
single.name = 'single_' + idx;
single.resize(axisModel, api);
axisModel.coordinateSystem = single;
singles.push(single);
});
ecModel.eachSeries(function (seriesModel) {
if (seriesModel.get('coordinateSystem') === 'singleAxis') {
var singleAxisModel = ecModel.queryComponents({
mainType: 'singleAxis',
index: seriesModel.get('singleAxisIndex'),
id: seriesModel.get('singleAxisId')
})[0];
seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;
}
});
return singles;
}
CoordinateSystem.register('single', {
create: create,
dimensions: Single.prototype.dimensions
});