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

93
node_modules/echarts/lib/chart/chord/ChordSeries.js generated vendored Normal file
View File

@ -0,0 +1,93 @@
/*
* 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 SeriesModel = require("../../model/Series");
var createGraphFromNodeEdge = require("../helper/createGraphFromNodeEdge");
var createGraphFromNodeMatrix = require("../helper/createGraphFromNodeMatrix");
/*
* 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 ChordSeries = SeriesModel.extend({
type: 'series.chord',
getInitialData: function (option) {
var edges = option.edges || option.links;
var nodes = option.data || option.nodes;
var matrix = option.matrix;
if (nodes && edges) {
var graph = createGraphFromNodeEdge(nodes, edges, this, true);
return graph.data;
} else if (nodes && matrix) {
var graph = createGraphFromNodeMatrix(nodes, matrix, this, true);
return graph.data;
}
},
/**
* @return {module:echarts/data/Graph}
*/
getGraph: function () {
return this.getData().graph;
},
/**
* @return {module:echarts/data/List}
*/
getEdgeData: function () {
return this.getGraph().edgeData;
},
defaultOption: {
center: ['50%', '50%'],
radius: ['65%', '75%'],
//
// layout: 'circular',
sort: 'none',
sortSub: 'none',
padding: 0.02,
startAngle: 90,
clockwise: true,
itemStyle: {},
emphasis: {
itemStyle: {},
chordStyle: {}
},
chordStyle: {}
}
});
var _default = ChordSeries;
module.exports = _default;

107
node_modules/echarts/lib/chart/chord/ChordView.js generated vendored Normal file
View File

@ -0,0 +1,107 @@
/*
* 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 echarts = require("../../echarts");
var RibbonPath = require("./Ribbon");
var graphic = require("../../util/graphic");
/*
* 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 _default = echarts.extendChartView({
type: 'chord',
init: function (option) {},
render: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var graph = seriesModel.getGraph();
var edgeData = seriesModel.getEdgeData();
var group = this.group;
group.removeAll();
data.each(function (idx) {
var layout = data.getItemLayout(idx);
var sector = new graphic.Sector({
shape: {
cx: layout.cx,
cy: layout.cy,
clockwise: layout.clockwise,
r0: layout.r0,
r: layout.r,
startAngle: layout.startAngle,
endAngle: layout.endAngle
}
});
sector.setStyle({
fill: data.getItemVisual(idx, 'color')
});
data.setItemLayout(idx);
group.add(sector);
});
var edgeRendered = {};
edgeData.each(function (idx) {
if (edgeRendered[idx]) {
return;
}
var layout = edgeData.getItemLayout(idx);
var edge = graph.getEdgeByIndex(idx);
var otherEdge = graph.getEdge(edge.node2, edge.node1);
var otherEdgeLayout = otherEdge.getLayout();
edgeRendered[idx] = edgeRendered[otherEdge.dataIndex] = true;
var ribbon = new RibbonPath({
shape: {
cx: layout.cx,
cy: layout.cy,
r: layout.r,
s0: layout.startAngle,
s1: layout.endAngle,
t0: otherEdgeLayout.startAngle,
t1: otherEdgeLayout.endAngle,
clockwise: layout.clockwise
}
});
ribbon.setStyle({
// Use color of source
fill: edge.node1.getVisual('color'),
opacity: 0.5
});
group.add(ribbon);
});
},
dispose: function () {}
});
module.exports = _default;

88
node_modules/echarts/lib/chart/chord/Ribbon.js generated vendored Normal file
View File

@ -0,0 +1,88 @@
/*
* 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 graphic = require("../../util/graphic");
/*
* 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 sin = Math.sin;
var cos = Math.cos;
var _default = graphic.extendShape({
type: 'ec-ribbon',
shape: {
cx: 0,
cy: 0,
r: 0,
s0: 0,
s1: 0,
t0: 0,
t1: 0
},
style: {
fill: '#000'
},
buildPath: function (ctx, shape) {
var clockwise = shape.clockwise || false;
var cx = shape.cx;
var cy = shape.cy;
var r = shape.r;
var s0 = shape.s0;
var s1 = shape.s1;
var t0 = shape.t0;
var t1 = shape.t1;
var sx0 = cx + cos(s0) * r;
var sy0 = cy + sin(s0) * r;
var sx1 = cx + cos(s1) * r;
var sy1 = cy + sin(s1) * r;
var tx0 = cx + cos(t0) * r;
var ty0 = cy + sin(t0) * r;
var tx1 = cx + cos(t1) * r;
var ty1 = cy + sin(t1) * r;
ctx.moveTo(sx0, sy0);
ctx.arc(cx, cy, shape.r, s0, s1, !clockwise);
ctx.bezierCurveTo((cx - sx1) * 0.70 + sx1, (cy - sy1) * 0.70 + sy1, (cx - tx0) * 0.70 + tx0, (cy - ty0) * 0.70 + ty0, tx0, ty0); // Chord to self
if (shape.s0 === shape.t0 && shape.s1 === shape.t1) {
return;
}
ctx.arc(cx, cy, shape.r, t0, t1, !clockwise);
ctx.bezierCurveTo((cx - tx1) * 0.70 + tx1, (cy - ty1) * 0.70 + ty1, (cx - sx0) * 0.70 + sx0, (cy - sy0) * 0.70 + sy0, sx0, sy0);
}
});
module.exports = _default;

View File

@ -0,0 +1,153 @@
/*
* 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 _number = require("../../util/number");
var parsePercent = _number.parsePercent;
/*
* 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 {module:echarts/data/Graph} graph
*/
function layout(graphs, opts) {
if (!zrUtil.isArray(graphs)) {
graphs = [graphs];
}
var graph0 = graphs[0];
var groups = []; // Init groups
graph0.eachNode(function (node) {
var group = {
size: 0,
subGroups: [],
node: node
};
groups.push(group);
});
zrUtil.each(graphs, function (graph) {
graph.eachEdge(function (edge) {
var g1 = groups[edge.node1.dataIndex];
g1.size += edge.getValue('value') || 0;
g1.subGroups.push({
size: edge.getValue('value'),
edge: edge
});
});
});
var sumSize = zrUtil.reduce(groups, function (sumSize, group) {
return sumSize + group.size;
}, 0);
if (opts.sort && opts.sort !== 'none') {
groups.sort(compareGroups);
if (opts.sort === 'descending') {
groups.reverse();
}
}
var unitAngle = (Math.PI * 2 - opts.padding * graph0.data.count()) / sumSize;
var angle = opts.startAngle * Math.PI / 180;
var sign = opts.clockwise ? -1 : 1;
zrUtil.each(groups, function (group) {
if (opts.sortSub && opts.sortSub !== 'none') {
group.subGroups.sort(compareGroups);
if (opts.sortSub === 'descending') {
group.subGroups.reverse();
}
}
var endAngle = angle + sign * group.size * unitAngle;
group.node.setLayout({
startAngle: -angle,
endAngle: -endAngle,
cx: opts.cx,
cy: opts.cy,
r0: opts.r0,
r: opts.r,
clockwise: opts.clockwise
});
zrUtil.each(group.subGroups, function (subGroup) {
var startAngle = angle;
var endAngle = angle + sign * subGroup.size * unitAngle;
var layout = subGroup.edge.getLayout() || {
cx: opts.cx,
cy: opts.cy,
r: opts.r0,
clockwise: opts.clockwise
};
layout.startAngle = -startAngle;
layout.endAngle = -endAngle;
subGroup.edge.setLayout(layout);
angle = endAngle;
});
angle = endAngle + sign * opts.padding;
});
}
var compareGroups = function (a, b) {
return a.size - b.size;
};
function _default(ecModel, api, payload) {
ecModel.eachSeriesByType('chord', function (chordSeries) {
var graph = chordSeries.getGraph();
var center = chordSeries.get('center');
var radius = chordSeries.get('radius');
var viewWidth = api.getWidth();
var viewHeight = api.getHeight();
var viewSize = Math.min(viewWidth, viewHeight) / 2;
layout(graph, {
sort: chordSeries.get('sort'),
sortSub: chordSeries.get('sortSub'),
padding: chordSeries.get('padding'),
startAngle: chordSeries.get('startAngle'),
clockwise: chordSeries.get('clockwise'),
cx: parsePercent(center[0], viewWidth),
cy: parsePercent(center[1], viewHeight),
r0: parsePercent(radius[0], viewSize),
r: parsePercent(radius[1], viewSize)
});
});
}
module.exports = _default;