From 4ad3b0f42a821f5ab29e953aa73cc08f0633ac5e Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Wed, 20 Sep 2023 21:45:40 +0800 Subject: [PATCH 1/9] feat: sankey chart supoort config color --- common/config/rush/pnpm-lock.yaml | 6 +- .../runtime/browser/test-page/sankey.ts | 3726 ++++++++++++++++- packages/vchart/src/chart/sankey/sankey.ts | 2 + packages/vchart/src/series/sankey/sankey.ts | 27 +- 4 files changed, 3739 insertions(+), 22 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 71e92fb125..369c799164 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4594,7 +4594,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.22.5_@babel+core@7.20.12 magic-string: 0.27.0 react-refresh: 0.14.0 - vite: 3.2.6_@types+node@20.6.3 + vite: 3.2.6 transitivePeerDependencies: - supports-color dev: true @@ -15305,7 +15305,7 @@ packages: decamelize: 1.2.0 loud-rejection: 1.6.0 map-obj: 1.0.1 - minimist: 1.2.5 + minimist: 1.2.8 normalize-package-data: 2.5.0 object-assign: 4.1.1 read-pkg-up: 1.0.1 @@ -17704,7 +17704,7 @@ packages: dependencies: deep-extend: 0.6.0 ini: 1.3.8 - minimist: 1.2.5 + minimist: 1.2.8 strip-json-comments: 2.0.1 dev: true diff --git a/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts b/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts index 4f589fe7e9..e0d9bd8a53 100644 --- a/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts +++ b/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts @@ -87,7 +87,12 @@ const run = () => { ], categoryField: 'name', valueField: 'value', - + color: { + field: 'color', + type: 'ordinal', + domain: ['A', 'top', '00', '01', '02', 'middle', 'bottom', 'B', 'C'], + range: ['#fd7f6f', '#7eb0d5', '#b2e061', '#bd7ebe', '#ffb55a', '#ffee65', '#beb9db', '#fdcce5', '#8bd3c7'] + }, nodeAlign: 'left', nodeGap: 8, nodeWidth: 10, @@ -6354,12 +6359,3719 @@ const run = () => { hash: '71fea1bfaf872918422ee9e61d79eb03' }; - const vChart = new VChart(spec_992, { - dom: document.getElementById('chart') as HTMLElement, - mode: isMobile ? 'mobile-browser' : 'desktop-browser' - }); - vChart.renderAsync(); - window['vchart'] = vChart; + const spec1_update = { + type: 'sankey', + nodeGap: 5, + nodeWidth: 12, + nodeAlign: 'justify', + iterations: 0, + padding: { + top: 0, + left: 2, + bottom: 0, + right: 2 + }, + minNodeHeight: 1, + categoryField: 'key', + nodeKey: d => d['key'], + valueField: 'value', + data: [ + { + name: 'data', + values: [ + { + nodes: [ + { + '230919171022011': '技术', + color: '技术', + group: '230919171022011', + key: '230919171022011-技术', + name: '技术', + type: 'node', + value: 5469023.505149841, + '230919103714013': 5469023.505149841, + outDegree: 3, + inDegree: 0, + children: [ + { + '230919202156019': '公司', + color: '公司', + group: '230919202156019', + key: '230919202156019-公司', + name: '公司', + type: 'node', + value: 1764574.614578247, + '230919103714013': 5152793.296570778, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '公司', + color: '公司', + group: '230919205000017', + key: '230919205000017-公司', + name: '公司', + type: 'node', + value: 1764574.614578247, + '230919103714013': 5152793.296570778, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + }, + { + '230919202156019': '消费者', + color: '消费者', + group: '230919202156019', + key: '230919202156019-消费者', + name: '消费者', + type: 'node', + value: 2692828.4352111816, + '230919103714013': 8025072.194172859, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '消费者', + color: '消费者', + group: '230919205000017', + key: '230919205000017-消费者', + name: '消费者', + type: 'node', + value: 2692828.4352111816, + '230919103714013': 8025072.194172859, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + }, + { + '230919202156019': '小型企业', + color: '小型企业', + group: '230919202156019', + key: '230919202156019-小型企业', + name: '小型企业', + type: 'node', + value: 1011620.4553604126, + '230919103714013': 2891088.6421899796, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '小型企业', + color: '小型企业', + group: '230919205000017', + key: '230919205000017-小型企业', + name: '小型企业', + type: 'node', + value: 1011620.4553604126, + '230919103714013': 2891088.6421899796, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + } + ] + }, + { + '230919171022011': '办公用品', + color: '办公用品', + group: '230919171022011', + key: '230919171022011-办公用品', + name: '办公用品', + type: 'node', + value: 4865589.799788475, + '230919103714013': 4865589.799788475, + outDegree: 3, + inDegree: 0, + children: [ + { + '230919202156019': '消费者', + color: '消费者', + group: '230919202156019', + key: '230919202156019-消费者', + name: '消费者', + type: 'node', + value: 2543529.3300714493, + '230919103714013': 8025072.194172859, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '消费者', + color: '消费者', + group: '230919205000017', + key: '230919205000017-消费者', + name: '消费者', + type: 'node', + value: 2543529.3300714493, + '230919103714013': 8025072.194172859, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + }, + { + '230919202156019': '公司', + color: '公司', + group: '230919202156019', + key: '230919202156019-公司', + name: '公司', + type: 'node', + value: 1484595.9238786697, + '230919103714013': 5152793.296570778, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '公司', + color: '公司', + group: '230919205000017', + key: '230919205000017-公司', + name: '公司', + type: 'node', + value: 1484595.9238786697, + '230919103714013': 5152793.296570778, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + }, + { + '230919202156019': '小型企业', + color: '小型企业', + group: '230919202156019', + key: '230919202156019-小型企业', + name: '小型企业', + type: 'node', + value: 837464.545838356, + '230919103714013': 2891088.6421899796, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '小型企业', + color: '小型企业', + group: '230919205000017', + key: '230919205000017-小型企业', + name: '小型企业', + type: 'node', + value: 837464.545838356, + '230919103714013': 2891088.6421899796, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + } + ] + }, + { + '230919171022011': 'https://bing.com', + color: 'https://bing.com', + group: '230919171022011', + key: '230919171022011-https://bing.com', + name: 'https://bing.com', + type: 'node', + value: 5734340.8279953, + '230919103714013': 5734340.8279953, + outDegree: 3, + inDegree: 0, + children: [ + { + '230919202156019': '消费者', + color: '消费者', + group: '230919202156019', + key: '230919202156019-消费者', + name: '消费者', + type: 'node', + value: 2788714.4288902283, + '230919103714013': 8025072.194172859, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '消费者', + color: '消费者', + group: '230919205000017', + key: '230919205000017-消费者', + name: '消费者', + type: 'node', + value: 2788714.4288902283, + '230919103714013': 8025072.194172859, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + }, + { + '230919202156019': '公司', + color: '公司', + group: '230919202156019', + key: '230919202156019-公司', + name: '公司', + type: 'node', + value: 1903622.758113861, + '230919103714013': 5152793.296570778, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '公司', + color: '公司', + group: '230919205000017', + key: '230919205000017-公司', + name: '公司', + type: 'node', + value: 1903622.758113861, + '230919103714013': 5152793.296570778, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + }, + { + '230919202156019': '小型企业', + color: '小型企业', + group: '230919202156019', + key: '230919202156019-小型企业', + name: '小型企业', + type: 'node', + value: 1042003.6409912109, + '230919103714013': 2891088.6421899796, + outDegree: 3, + inDegree: 3, + children: [ + { + '230919205000017': '小型企业', + color: '小型企业', + group: '230919205000017', + key: '230919205000017-小型企业', + name: '小型企业', + type: 'node', + value: 1042003.6409912109, + '230919103714013': 2891088.6421899796, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + } + ] + } + ] + } + ] + } + ], + legends: [ + { + type: 'discrete', + item: { + label: { + style: { + fontSize: 12, + fill: '#6F6F6F' + } + }, + focus: true, + focusIconStyle: { + size: 14 + }, + maxWidth: 400, + spaceRow: 0, + spaceCol: 0, + padding: { + top: 1, + bottom: 1, + left: 1, + right: 1 + }, + background: { + visible: false, + style: { + fillOpacity: 0.001 + } + }, + shape: { + style: { + lineWidth: 0, + symbolType: 'square' + } + } + }, + id: 'legend', + orient: 'bottom', + position: 'middle', + layoutType: 'normal', + visible: true, + maxRow: 2, + title: { + textStyle: { + fontSize: 12, + fill: '#6F6F6F' + } + }, + layoutLevel: 50, + pager: { + layout: 'horizontal', + padding: 0, + textStyle: {}, + space: 0, + handler: { + preShape: 'triangleLeft', + nextShape: 'triangleRight', + style: {}, + state: { + disable: {} + } + } + }, + padding: { + top: 16, + bottom: 0, + left: 0, + right: 0 + } + } + ], + label: { + visible: false, + overlap: { + hideOnHit: true, + avoidBaseMark: false, + strategy: [ + { + type: 'moveY', + offset: [ + -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + ] + }, + { + type: 'moveX', + offset: [ + -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + ] + } + ] + }, + style: { + fontSize: 16, + zIndex: 100, + fill: '#f7555d', + stroke: null, + strokeOpacity: 1 + }, + limit: 200, + interactive: false + }, + tooltip: { + handler: {} + }, + region: [ + { + clip: true + } + ], + background: 'rgba(255, 255, 255, 0)', + hover: { + enable: true + }, + select: { + enable: true + }, + emphasis: { + enable: true, + effect: 'related' + }, + link: { + state: { + hover: { + cursor: 'pointer', + fillOpacity: 0.8, + stroke: '#58595B', + lineWidth: 0, + zIndex: 500 + }, + selected: { + cursor: 'pointer', + fillOpacity: 1, + stroke: '#58595B', + lineWidth: 1 + }, + blur: { + fillOpacity: 0.025 + } + } + }, + node: { + state: { + hover: { + cursor: 'pointer', + fillOpacity: 0.8, + stroke: '#58595B', + lineWidth: 1, + zIndex: 500 + }, + selected: { + cursor: 'pointer', + fillOpacity: 1, + stroke: '#58595B', + lineWidth: 1 + }, + blur: { + fillOpacity: 0.1 + } + } + }, + animation: false, + hash: 'a0caad94135ce1882e7615e8119d4e92' + }; + + const spec2_update = { + type: 'sankey', + nodeGap: 5, + nodeWidth: 12, + nodeAlign: 'justify', + iterations: 0, + padding: { + top: 0, + left: 2, + bottom: 0, + right: 2 + }, + minNodeHeight: 1, + categoryField: 'key', + valueField: 'value', + nodeKey: d => d['key'], + data: [ + { + name: 'data', + values: [ + { + nodes: [ + { + '230919171022011': '技术', + color: '技术', + group: '230919171022011', + key: '230919171022011-技术', + name: '技术', + type: 'node', + value: 5469023.505149841, + '230919103714013': 5469023.505149841, + outDegree: 3, + inDegree: 0, + children: [ + { + '230919205000017': '公司', + color: '公司', + group: '230919205000017', + key: '230919205000017-公司', + name: '公司', + type: 'node', + value: 1764574.614578247, + '230919103714013': 5152793.296570778, + outDegree: 0, + inDegree: 3, + children: [] + }, + { + '230919205000017': '消费者', + color: '消费者', + group: '230919205000017', + key: '230919205000017-消费者', + name: '消费者', + type: 'node', + value: 2692828.4352111816, + '230919103714013': 8025072.194172859, + outDegree: 0, + inDegree: 3, + children: [] + }, + { + '230919205000017': '小型企业', + color: '小型企业', + group: '230919205000017', + key: '230919205000017-小型企业', + name: '小型企业', + type: 'node', + value: 1011620.4553604126, + '230919103714013': 2891088.6421899796, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + }, + { + '230919171022011': '办公用品', + color: '办公用品', + group: '230919171022011', + key: '230919171022011-办公用品', + name: '办公用品', + type: 'node', + value: 4865589.799788475, + '230919103714013': 4865589.799788475, + outDegree: 3, + inDegree: 0, + children: [ + { + '230919205000017': '消费者', + color: '消费者', + group: '230919205000017', + key: '230919205000017-消费者', + name: '消费者', + type: 'node', + value: 2543529.3300714493, + '230919103714013': 8025072.194172859, + outDegree: 0, + inDegree: 3, + children: [] + }, + { + '230919205000017': '公司', + color: '公司', + group: '230919205000017', + key: '230919205000017-公司', + name: '公司', + type: 'node', + value: 1484595.9238786697, + '230919103714013': 5152793.296570778, + outDegree: 0, + inDegree: 3, + children: [] + }, + { + '230919205000017': '小型企业', + color: '小型企业', + group: '230919205000017', + key: '230919205000017-小型企业', + name: '小型企业', + type: 'node', + value: 837464.545838356, + '230919103714013': 2891088.6421899796, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + }, + { + '230919171022011': 'https://bing.com', + color: 'https://bing.com', + group: '230919171022011', + key: '230919171022011-https://bing.com', + name: 'https://bing.com', + type: 'node', + value: 5734340.8279953, + '230919103714013': 5734340.8279953, + outDegree: 3, + inDegree: 0, + children: [ + { + '230919205000017': '消费者', + color: '消费者', + group: '230919205000017', + key: '230919205000017-消费者', + name: '消费者', + type: 'node', + value: 2788714.4288902283, + '230919103714013': 8025072.194172859, + outDegree: 0, + inDegree: 3, + children: [] + }, + { + '230919205000017': '公司', + color: '公司', + group: '230919205000017', + key: '230919205000017-公司', + name: '公司', + type: 'node', + value: 1903622.758113861, + '230919103714013': 5152793.296570778, + outDegree: 0, + inDegree: 3, + children: [] + }, + { + '230919205000017': '小型企业', + color: '小型企业', + group: '230919205000017', + key: '230919205000017-小型企业', + name: '小型企业', + type: 'node', + value: 1042003.6409912109, + '230919103714013': 2891088.6421899796, + outDegree: 0, + inDegree: 3, + children: [] + } + ] + } + ] + } + ] + } + ], + legends: [ + { + type: 'discrete', + item: { + label: { + style: { + fontSize: 12, + fill: '#6F6F6F' + } + }, + focus: true, + focusIconStyle: { + size: 14 + }, + maxWidth: 400, + spaceRow: 0, + spaceCol: 0, + padding: { + top: 1, + bottom: 1, + left: 1, + right: 1 + }, + background: { + visible: false, + style: { + fillOpacity: 0.001 + } + }, + shape: { + style: { + lineWidth: 0, + symbolType: 'square' + } + } + }, + id: 'legend', + orient: 'bottom', + position: 'middle', + layoutType: 'normal', + visible: true, + maxRow: 2, + title: { + textStyle: { + fontSize: 12, + fill: '#6F6F6F' + } + }, + layoutLevel: 50, + pager: { + layout: 'horizontal', + padding: 0, + textStyle: {}, + space: 0, + handler: { + preShape: 'triangleLeft', + nextShape: 'triangleRight', + style: {}, + state: { + disable: {} + } + } + }, + padding: { + top: 16, + bottom: 0, + left: 0, + right: 0 + } + } + ], + label: { + visible: true, + overlap: { + hideOnHit: true, + avoidBaseMark: false, + strategy: [ + { + type: 'moveY', + offset: [ + -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + ] + }, + { + type: 'moveX', + offset: [ + -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + ] + } + ] + }, + style: { + fontSize: 16, + zIndex: 100, + fill: '#f7555d', + stroke: null, + strokeOpacity: 1 + }, + limit: 200, + interactive: false + }, + tooltip: { + handler: {} + }, + region: [ + { + clip: true + } + ], + background: 'rgba(255, 255, 255, 0)', + hover: { + enable: true + }, + select: { + enable: true + }, + emphasis: { + enable: true, + effect: 'related' + }, + link: { + state: { + hover: { + cursor: 'pointer', + fillOpacity: 0.8, + stroke: '#58595B', + lineWidth: 0, + zIndex: 500 + }, + selected: { + cursor: 'pointer', + fillOpacity: 1, + stroke: '#58595B', + lineWidth: 1 + }, + blur: { + fillOpacity: 0.025 + } + } + }, + node: { + state: { + hover: { + cursor: 'pointer', + fillOpacity: 0.8, + stroke: '#58595B', + lineWidth: 1, + zIndex: 500 + }, + selected: { + cursor: 'pointer', + fillOpacity: 1, + stroke: '#58595B', + lineWidth: 1 + }, + blur: { + fillOpacity: 0.1 + } + } + }, + animation: false, + hash: 'ed02f01497bb549cf3622a941932c75b' + }; + + const spec3_update = { + type: 'sankey', + nodeGap: 5, + nodeWidth: 12, + nodeAlign: 'justify', + iterations: 0, + padding: { + top: 0, + left: 2, + bottom: 0, + right: 2 + }, + categoryField: 'key', + valueField: 'value', + link: { + style: { + pathType: 'smooth' + }, + state: { + hover: { + cursor: 'pointer', + fillOpacity: 0.8, + stroke: '#58595B', + lineWidth: 0, + zIndex: 500 + }, + selected: { + cursor: 'pointer', + fillOpacity: 1, + stroke: '#58595B', + lineWidth: 1 + }, + blur: { + fillOpacity: 0.025 + } + } + }, + data: [ + { + name: 'data', + values: [ + { + nodes: [ + { + '230920170354037': '中南', + color: '中南', + group: '230920170354037', + key: '230920170354037-中南', + name: '中南', + type: 'node', + value: 4137415.0951108932, + '230920170354034': 4137415.0951108932, + outDegree: 4, + inDegree: 0, + children: [ + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 2309088.987888336, + '230920170354034': 6648863.4112615585, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 901351.8420200348, + '230920170354034': 2593996.0728883743, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 647170.607293129, + '230920170354034': 1597588.3425855637, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 279803.6579093933, + '230920170354034': 543999.8639507294, + outDegree: 0, + inDegree: 6, + children: [] + } + ] + }, + { + '230920170354037': '西南', + color: '西南', + group: '230920170354037', + key: '230920170354037-西南', + name: '西南', + type: 'node', + value: 1303124.5089645386, + '230920170354034': 1303124.5089645386, + outDegree: 4, + inDegree: 0, + children: [ + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 766227.8120193481, + '230920170354034': 6648863.4112615585, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 292123.4119319916, + '230920170354034': 2593996.0728883743, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 214409.8048610687, + '230920170354034': 1597588.3425855637, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 30363.4801521301, + '230920170354034': 543999.8639507294, + outDegree: 0, + inDegree: 6, + children: [] + } + ] + }, + { + '230920170354037': '西北', + color: '西北', + group: '230920170354037', + key: '230920170354037-西北', + name: '西北', + type: 'node', + value: 815039.5979347229, + '230920170354034': 815039.5979347229, + outDegree: 4, + inDegree: 0, + children: [ + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 62348.0195865631, + '230920170354034': 1597588.3425855637, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 462025.3692798615, + '230920170354034': 6648863.4112615585, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 259640.2487258911, + '230920170354034': 2593996.0728883743, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 31025.9603424072, + '230920170354034': 543999.8639507294, + outDegree: 0, + inDegree: 6, + children: [] + } + ] + }, + { + '230920170354037': '地区-dongbei', + color: '地区-dongbei', + group: '230920170354037', + key: '230920170354037-地区-dongbei', + name: '地区-dongbei', + type: 'node', + value: 2681567.4745378494, + '230920170354034': 2681567.4745378494, + outDegree: 4, + inDegree: 0, + children: [ + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 1647264.992395401, + '230920170354034': 6648863.4112615585, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 598626.2052869797, + '230920170354034': 2593996.0728883743, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 81002.901506424, + '230920170354034': 543999.8639507294, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 354673.3753490448, + '230920170354034': 1597588.3425855637, + outDegree: 0, + inDegree: 6, + children: [] + } + ] + }, + { + '230920170354037': '华东', + color: '华东', + group: '230920170354037', + key: '230920170354037-华东', + name: '华东', + type: 'node', + value: 0, + '230920170354034': 0, + outDegree: 4, + inDegree: 0, + children: [ + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 0, + '230920170354034': 543999.8639507294, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 0, + '230920170354034': 2593996.0728883743, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 0, + '230920170354034': 6648863.4112615585, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 0, + '230920170354034': 1597588.3425855637, + outDegree: 0, + inDegree: 6, + children: [] + } + ] + }, + { + '230920170354037': '华北', + color: '华北', + group: '230920170354037', + key: '230920170354037-华北', + name: '华北', + type: 'node', + value: 2447301.0141382217, + '230920170354034': 2447301.0141382217, + outDegree: 4, + inDegree: 0, + children: [ + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 1464256.2496786118, + '230920170354034': 6648863.4112615585, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 542254.3649234772, + '230920170354034': 2593996.0728883743, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 318986.5354957581, + '230920170354034': 1597588.3425855637, + outDegree: 0, + inDegree: 6, + children: [] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 121803.8640403748, + '230920170354034': 543999.8639507294, + outDegree: 0, + inDegree: 6, + children: [] + } + ] + } + ] + } + ] + } + ], + legends: [ + { + type: 'discrete', + item: { + label: { + style: { + fontSize: 12, + fill: '#6F6F6F' + } + }, + focus: true, + focusIconStyle: { + size: 14 + }, + maxWidth: 400, + spaceRow: 0, + spaceCol: 0, + padding: { + top: 1, + bottom: 1, + left: 1, + right: 1 + }, + background: { + visible: false, + style: { + fillOpacity: 0.001 + } + }, + shape: { + style: { + lineWidth: 0, + symbolType: 'square' + } + } + }, + id: 'legend', + orient: 'bottom', + position: 'middle', + layoutType: 'normal', + visible: true, + maxRow: 2, + title: { + textStyle: { + fontSize: 12, + fill: '#6F6F6F' + } + }, + layoutLevel: 50, + pager: { + layout: 'horizontal', + padding: 0, + textStyle: {}, + space: 0, + handler: { + preShape: 'triangleLeft', + nextShape: 'triangleRight', + style: {}, + state: { + disable: {} + } + } + }, + padding: { + top: 16, + bottom: 0, + left: 0, + right: 0 + } + } + ], + label: { + visible: true, + overlap: { + hideOnHit: true, + overlapPadding: 10, + avoidBaseMark: false, + strategy: [ + { + type: 'moveY', + offset: [ + -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + ] + }, + { + type: 'moveX', + offset: [ + -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + ] + } + ] + }, + style: { + fontSize: 12, + zIndex: 100, + fill: '#363839', + stroke: 'rgba(255, 255, 255, 0.8)', + strokeOpacity: 1, + lineWidth: 2 + }, + limit: 200, + interactive: false + }, + region: [ + { + clip: false + } + ], + extensionMark: [ + { + type: 'text', + dataId: 'data', + style: { + text: '中南', + fontSize: 12, + fill: 'red', + y: 0 + } + }, + { + type: 'text', + dataId: 'data', + style: { + text: '当日', + fontSize: 12, + fill: 'red', + y: 0 + } + } + ], + tooltip: { + handler: {} + }, + background: 'rgba(255, 255, 255, 0)', + hover: { + enable: true + }, + select: { + enable: true + }, + emphasis: { + enable: true, + effect: 'related' + }, + node: { + state: { + hover: { + cursor: 'pointer', + fillOpacity: 0.8, + stroke: '#58595B', + lineWidth: 1, + zIndex: 500 + }, + selected: { + cursor: 'pointer', + fillOpacity: 1, + stroke: '#58595B', + lineWidth: 1 + }, + blur: { + fillOpacity: 0.1 + } + } + }, + animation: false, + hash: 'd620b58401d072113f285aa7037c567a' + }; + + const spec4_update = { + type: 'sankey', + nodeGap: 5, + nodeWidth: 12, + nodeAlign: 'justify', + iterations: 0, + padding: { + top: 0, + left: 2, + bottom: 0, + right: 2 + }, + categoryField: 'key', + valueField: 'value', + link: { + style: { + pathType: 'smooth' + }, + state: { + hover: { + cursor: 'pointer', + fillOpacity: 0.8, + stroke: '#58595B', + lineWidth: 0, + zIndex: 500 + }, + selected: { + cursor: 'pointer', + fillOpacity: 1, + stroke: '#58595B', + lineWidth: 1 + }, + blur: { + fillOpacity: 0.025 + } + } + }, + data: [ + { + name: 'data', + values: [ + { + nodes: [ + { + '230920170354037': '华北', + color: '华北', + group: '230920170354037', + key: '230920170354037-华北', + name: '华北', + type: 'node', + value: 2447301.0141382217, + '230920170354034': 2447301.0141382217, + outDegree: 12, + inDegree: 0, + children: [ + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 161239.86883926392, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 161239.86883926392, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 20837.627975463867, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 20837.627975463867, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 237232.88373947144, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 237232.88373947144, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 61445.215839385986, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 61445.215839385986, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 163016.81268692017, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 163016.81268692017, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 315627.76114845276, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 315627.76114845276, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 544905.6529664993, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 544905.6529664993, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 39521.0202255249, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 39521.0202255249, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 57325.982006073, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 57325.982006073, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 63609.79108810425, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 63609.79108810425, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 682117.712972641, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 682117.712972641, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 100420.68465042114, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 100420.68465042114, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + } + ] + }, + { + '230920170354037': '西北', + color: '西北', + group: '230920170354037', + key: '230920170354037-西北', + name: '西北', + type: 'node', + value: 815039.5979347229, + '230920170354034': 815039.5979347229, + outDegree: 12, + inDegree: 0, + children: [ + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 62002.78022766113, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 62002.78022766113, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 61836.431911468506, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 61836.431911468506, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 7096.600036621094, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 7096.600036621094, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 18803.26025390625, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 18803.26025390625, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 237356.98112678528, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 237356.98112678528, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 43739.58361244202, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 43739.58361244202, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 5126.100051879883, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 5126.100051879883, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 162831.95624160767, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 162831.95624160767, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 169864.94074249268, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 169864.94074249268, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 27772.527755737305, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 27772.527755737305, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 9820.187911987305, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 9820.187911987305, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 8788.248062133789, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 8788.248062133789, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + } + ] + }, + { + '230920170354037': '西南', + color: '西南', + group: '230920170354037', + key: '230920170354037-西南', + name: '西南', + type: 'node', + value: 1303124.5089645386, + '230920170354034': 1303124.5089645386, + outDegree: 12, + inDegree: 0, + children: [ + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 48292.076080322266, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 48292.076080322266, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 137932.25577926636, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 137932.25577926636, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 27165.04006576538, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 27165.04006576538, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 110508.30136489868, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 110508.30136489868, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 2496.0599975585938, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 2496.0599975585938, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 14919.716171264648, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 14919.716171264648, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 479747.631729126, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 479747.631729126, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 76736.46343040466, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 76736.46343040466, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 12947.703983306885, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 12947.703983306885, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 78526.75593566895, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 78526.75593566895, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 105899.08007240295, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 105899.08007240295, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 207953.42435455322, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 207953.42435455322, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + } + ] + }, + { + '230920170354037': '地区-dongbei', + color: '地区-dongbei', + group: '230920170354037', + key: '230920170354037-地区-dongbei', + name: '地区-dongbei', + type: 'node', + value: 2681567.4745378494, + '230920170354034': 2681567.4745378494, + outDegree: 12, + inDegree: 0, + children: [ + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 785608.566778183, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 785608.566778183, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 85133.94373703003, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 85133.94373703003, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 4617.591995239258, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 4617.591995239258, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 298002.60119628906, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 298002.60119628906, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 198293.94263839722, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 198293.94263839722, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 339639.0273742676, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 339639.0273742676, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 34304.80926513672, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 34304.80926513672, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 71245.48897361755, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 71245.48897361755, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 93348.47202587128, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 93348.47202587128, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 42080.50024604797, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 42080.50024604797, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 207275.13206481934, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 207275.13206481934, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 522017.39824295044, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 522017.39824295044, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + } + ] + }, + { + '230920170354037': '中南', + color: '中南', + group: '230920170354037', + key: '230920170354037-中南', + name: '中南', + type: 'node', + value: 4137415.0951108932, + '230920170354034': 4137415.0951108932, + outDegree: 12, + inDegree: 0, + children: [ + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 433963.2788925171, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 433963.2788925171, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 717389.1995487213, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 717389.1995487213, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 96088.13107299805, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 96088.13107299805, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 29316.52554321289, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 29316.52554321289, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 433355.5802783966, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 433355.5802783966, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 344421.0977716446, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 344421.0977716446, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 283551.1897010803, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 283551.1897010803, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 1157736.5094470978, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 1157736.5094470978, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 206661.37844848633, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 206661.37844848633, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 128063.55743408203, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 128063.55743408203, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 184445.07204055786, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 184445.07204055786, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 122423.57493209839, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 122423.57493209839, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + } + ] + }, + { + '230920170354037': '华东', + color: '华东', + group: '230920170354037', + key: '230920170354037-华东', + name: '华东', + type: 'node', + value: 0, + '230920170354034': 0, + outDegree: 12, + inDegree: 0, + children: [ + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 0, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 0, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 0, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 0, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 0, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 0, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 0, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 0, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '当日', + color: '当日', + group: '230920170354057', + key: '230920170354057-当日', + name: '当日', + type: 'node', + value: 0, + '230920170354034': 543999.8639507294, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 0, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 0, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 0, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 0, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 0, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 0, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 0, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 0, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 0, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '二级', + color: '二级', + group: '230920170354057', + key: '230920170354057-二级', + name: '二级', + type: 'node', + value: 0, + '230920170354034': 2593996.0728883743, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '公司', + color: '公司', + group: '230920170354076', + key: '230920170354076-公司', + name: '公司', + type: 'node', + value: 0, + '230920170354034': 3698077.491681099, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '一级', + color: '一级', + group: '230920170354057', + key: '230920170354057-一级', + name: '一级', + type: 'node', + value: 0, + '230920170354034': 1597588.3425855637, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '小型企业', + color: '小型企业', + group: '230920170354076', + key: '230920170354076-小型企业', + name: '小型企业', + type: 'node', + value: 0, + '230920170354034': 1948656.2699956894, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + }, + { + '230920170354057': '标准级', + color: '标准级', + group: '230920170354057', + key: '230920170354057-标准级', + name: '标准级', + type: 'node', + value: 0, + '230920170354034': 6648863.4112615585, + outDegree: 18, + inDegree: 18, + children: [ + { + '230920170354076': '消费者', + color: '消费者', + group: '230920170354076', + key: '230920170354076-消费者', + name: '消费者', + type: 'node', + value: 0, + '230920170354034': 5737713.929009438, + outDegree: 0, + inDegree: 24, + children: [] + } + ] + } + ] + } + ] + } + ] + } + ], + legends: [ + { + type: 'discrete', + item: { + label: { + style: { + fontSize: 12, + fill: '#6F6F6F' + } + }, + focus: true, + focusIconStyle: { + size: 14 + }, + maxWidth: 400, + spaceRow: 0, + spaceCol: 0, + padding: { + top: 1, + bottom: 1, + left: 1, + right: 1 + }, + background: { + visible: false, + style: { + fillOpacity: 0.001 + } + }, + shape: { + style: { + lineWidth: 0, + symbolType: 'square' + } + } + }, + id: 'legend', + orient: 'bottom', + position: 'middle', + layoutType: 'normal', + visible: true, + maxRow: 2, + title: { + textStyle: { + fontSize: 12, + fill: '#6F6F6F' + } + }, + layoutLevel: 50, + pager: { + layout: 'horizontal', + padding: 0, + textStyle: {}, + space: 0, + handler: { + preShape: 'triangleLeft', + nextShape: 'triangleRight', + style: {}, + state: { + disable: {} + } + } + }, + padding: { + top: 16, + bottom: 0, + left: 0, + right: 0 + } + } + ], + label: { + visible: false, + overlap: { + hideOnHit: true, + overlapPadding: 10, + avoidBaseMark: false, + strategy: [ + { + type: 'moveY', + offset: [ + -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + ] + }, + { + type: 'moveX', + offset: [ + -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 + ] + } + ] + }, + style: { + fontSize: 12, + zIndex: 100, + fill: '#363839', + stroke: 'rgba(255, 255, 255, 0.8)', + strokeOpacity: 1, + lineWidth: 2 + }, + limit: 200, + interactive: false + }, + region: [ + { + clip: false + } + ], + extensionMark: [ + { + type: 'text', + dataId: 'data', + style: { + text: '华北', + fontSize: 12, + fill: 'red', + y: 0 + } + }, + { + type: 'text', + dataId: 'data', + style: { + text: '一级', + fontSize: 12, + fill: 'red', + y: 0 + } + }, + { + type: 'text', + dataId: 'data', + style: { + text: '小型企业', + fontSize: 12, + fill: 'red', + y: 0 + } + } + ], + tooltip: { + handler: {} + }, + background: 'rgba(255, 255, 255, 0)', + hover: { + enable: true + }, + select: { + enable: true + }, + emphasis: { + enable: true, + effect: 'related' + }, + node: { + state: { + hover: { + cursor: 'pointer', + fillOpacity: 0.8, + stroke: '#58595B', + lineWidth: 1, + zIndex: 500 + }, + selected: { + cursor: 'pointer', + fillOpacity: 1, + stroke: '#58595B', + lineWidth: 1 + }, + blur: { + fillOpacity: 0.1 + } + } + }, + animation: false, + hash: 'bac9588b1df4b39ecd241109d133d496' + }; + + const vChart = new VChart(spec1, { + dom: document.getElementById('chart') as HTMLElement, + mode: isMobile ? 'mobile-browser' : 'desktop-browser' + }); + vChart.renderAsync(); + // vChart.renderAsync().then(() => { + // setTimeout(() => { + // console.log('updateSpec'); + // vChart.updateSpec(spec4_update); + // }, 3000); + // }); + window['vchart'] = vChart; + // 监听点击事件 // vChart.on('click', { level: 'mark' }, ctx => { // console.log('mark', ctx); diff --git a/packages/vchart/src/chart/sankey/sankey.ts b/packages/vchart/src/chart/sankey/sankey.ts index e8b528651c..ce907e47c4 100644 --- a/packages/vchart/src/chart/sankey/sankey.ts +++ b/packages/vchart/src/chart/sankey/sankey.ts @@ -22,6 +22,8 @@ export class SankeyChart extends BaseChart { sourceField: spec.sourceField, targetField: spec.targetField, + color: spec.color, + direction: spec.direction, nodeAlign: spec.nodeAlign, nodeGap: spec.nodeGap, diff --git a/packages/vchart/src/series/sankey/sankey.ts b/packages/vchart/src/series/sankey/sankey.ts index 6e12ae44cc..d3c094fdb6 100644 --- a/packages/vchart/src/series/sankey/sankey.ts +++ b/packages/vchart/src/series/sankey/sankey.ts @@ -1255,24 +1255,27 @@ export class SankeySeries exten } getNodeOrdinalColorScale(item: string) { - const colorDomain = this._rawData.latestData[0]?.nodes - ? this._rawData.latestData[0].nodes[0]?.children - ? Array.from(this.extractNamesFromTree(this._rawData.latestData[0].nodes, this._spec.categoryField)) - : this._rawData.latestData[0].nodes.map((datum: Datum, index: number) => { + const colorDomain = + this._spec?.color?.domain ?? this._rawData.latestData[0]?.nodes + ? this._rawData.latestData[0].nodes[0]?.children + ? Array.from(this.extractNamesFromTree(this._rawData.latestData[0].nodes, this._spec.categoryField)) + : this._rawData.latestData[0].nodes.map((datum: Datum, index: number) => { + if (this._spec.nodeKey) { + return datum[this._spec.categoryField]; + } + return index; + }) + : this._rawData.latestData[0]?.values.map((datum: Datum, index: number) => { if (this._spec.nodeKey) { return datum[this._spec.categoryField]; } return index; - }) - : this._rawData.latestData[0]?.values.map((datum: Datum, index: number) => { - if (this._spec.nodeKey) { - return datum[this._spec.categoryField]; - } - return index; - }); + }); const colorRange = - this._option.globalScale.color?.range() ?? getDataScheme(this._option.getTheme().colorScheme, this.type as any); + this._spec?.color?.range ?? + this._option.globalScale.color?.range() ?? + getDataScheme(this._option.getTheme().colorScheme, this.type as any); const ordinalScale = new ColorOrdinalScale(); From c7bc817a52ba13aedf7a0529f8effb20b6040bee Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Wed, 20 Sep 2023 22:14:03 +0800 Subject: [PATCH 2/9] feat: optimize get color method --- .../vchart/__tests__/runtime/browser/test-page/sankey.ts | 3 ++- packages/vchart/src/chart/sankey/sankey.ts | 2 -- packages/vchart/src/series/sankey/sankey.ts | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts b/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts index e0d9bd8a53..7242a0c999 100644 --- a/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts +++ b/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts @@ -90,7 +90,8 @@ const run = () => { color: { field: 'color', type: 'ordinal', - domain: ['A', 'top', '00', '01', '02', 'middle', 'bottom', 'B', 'C'], + domain: ['C', 'A', 'top', '00', '01', '02', 'middle', 'bottom', 'B'], + // domain: ['A', 'top', '00', '01', '02', 'middle', 'bottom', 'B', 'C'], range: ['#fd7f6f', '#7eb0d5', '#b2e061', '#bd7ebe', '#ffb55a', '#ffee65', '#beb9db', '#fdcce5', '#8bd3c7'] }, nodeAlign: 'left', diff --git a/packages/vchart/src/chart/sankey/sankey.ts b/packages/vchart/src/chart/sankey/sankey.ts index ce907e47c4..e8b528651c 100644 --- a/packages/vchart/src/chart/sankey/sankey.ts +++ b/packages/vchart/src/chart/sankey/sankey.ts @@ -22,8 +22,6 @@ export class SankeyChart extends BaseChart { sourceField: spec.sourceField, targetField: spec.targetField, - color: spec.color, - direction: spec.direction, nodeAlign: spec.nodeAlign, nodeGap: spec.nodeGap, diff --git a/packages/vchart/src/series/sankey/sankey.ts b/packages/vchart/src/series/sankey/sankey.ts index d3c094fdb6..ca94c8e0f8 100644 --- a/packages/vchart/src/series/sankey/sankey.ts +++ b/packages/vchart/src/series/sankey/sankey.ts @@ -1256,7 +1256,8 @@ export class SankeySeries exten getNodeOrdinalColorScale(item: string) { const colorDomain = - this._spec?.color?.domain ?? this._rawData.latestData[0]?.nodes + this._option.globalScale.getScale('color')?.domain() ?? + (this._rawData.latestData[0]?.nodes ? this._rawData.latestData[0].nodes[0]?.children ? Array.from(this.extractNamesFromTree(this._rawData.latestData[0].nodes, this._spec.categoryField)) : this._rawData.latestData[0].nodes.map((datum: Datum, index: number) => { @@ -1270,11 +1271,10 @@ export class SankeySeries exten return datum[this._spec.categoryField]; } return index; - }); + })); const colorRange = - this._spec?.color?.range ?? - this._option.globalScale.color?.range() ?? + this._option.globalScale.getScale('color')?.range() ?? getDataScheme(this._option.getTheme().colorScheme, this.type as any); const ordinalScale = new ColorOrdinalScale(); From 4fd68b2cc0fc30af465d64577f6bc61e2cf1a639 Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Wed, 20 Sep 2023 22:34:12 +0800 Subject: [PATCH 3/9] feat: add rush change log --- .../feat-sankey-support-color_2023-09-20-14-33.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vchart/feat-sankey-support-color_2023-09-20-14-33.json diff --git a/common/changes/@visactor/vchart/feat-sankey-support-color_2023-09-20-14-33.json b/common/changes/@visactor/vchart/feat-sankey-support-color_2023-09-20-14-33.json new file mode 100644 index 0000000000..7074031c1d --- /dev/null +++ b/common/changes/@visactor/vchart/feat-sankey-support-color_2023-09-20-14-33.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "fix: sankey chart support color config'", + "type": "none" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file From 4ff5281e611b0d8839d0b8870ebc66cf0290e26e Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Thu, 21 Sep 2023 11:59:28 +0800 Subject: [PATCH 4/9] feat: exchange nodeName define to adapt link source color --- common/config/rush/pnpm-lock.yaml | 130 +++++++++--------- .../runtime/browser/test-page/sankey.ts | 2 +- packages/vchart/src/series/sankey/sankey.ts | 54 ++++---- 3 files changed, 97 insertions(+), 89 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 369c799164..62357209f9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -44,8 +44,8 @@ importers: '@visactor/vchart': link:../packages/vchart '@visactor/vgrammar': 0.7.3 '@visactor/vmind': 1.0.6-alpha.2_7i2a3jlfudjwv4qjzxr3uxbiwi - '@visactor/vrender': 0.15.2 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vutils': 0.16.1 axios: 1.5.0 highlight.js: 11.8.0 markdown-it: 13.0.1 @@ -144,8 +144,8 @@ importers: dependencies: '@visactor/vchart': link:../vchart '@visactor/vgrammar-core': 0.7.3 - '@visactor/vrender': 0.15.2 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vutils': 0.16.1 react-is: 18.2.0 devDependencies: '@internal/bundler': link:../../tools/bundler @@ -318,7 +318,7 @@ importers: typescript: 4.9.5 vite: 3.2.6 dependencies: - '@visactor/vdataset': 0.16.0 + '@visactor/vdataset': 0.16.1 '@visactor/vgrammar-core': 0.7.3 '@visactor/vgrammar-hierarchy': 0.7.3 '@visactor/vgrammar-projection': 0.7.3 @@ -326,10 +326,10 @@ importers: '@visactor/vgrammar-util': 0.7.3 '@visactor/vgrammar-wordcloud': 0.7.3 '@visactor/vgrammar-wordcloud-shape': 0.7.3 - '@visactor/vrender': 0.15.2 - '@visactor/vrender-components': 0.15.2 - '@visactor/vscale': 0.16.0 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vrender-components': 0.15.3 + '@visactor/vscale': 0.16.1 + '@visactor/vutils': 0.16.1 '@visactor/vutils-extension': link:../vutils-extension devDependencies: '@esbuild-plugins/node-globals-polyfill': 0.1.1 @@ -402,9 +402,9 @@ importers: vite: 3.2.6 dependencies: '@visactor/vchart': link:../vchart - '@visactor/vdataset': 0.16.0 - '@visactor/vrender': 0.15.2 - '@visactor/vutils': 0.16.0 + '@visactor/vdataset': 0.16.1 + '@visactor/vrender': 0.15.3 + '@visactor/vutils': 0.16.1 devDependencies: '@internal/bundler': link:../../tools/bundler '@internal/eslint-config': link:../../share/eslint-config @@ -485,9 +485,9 @@ importers: typescript: 4.9.5 vite: 3.2.6 dependencies: - '@visactor/vrender': 0.15.2 - '@visactor/vscale': 0.16.0 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vscale': 0.16.1 + '@visactor/vutils': 0.16.1 devDependencies: '@internal/bundler': link:../../tools/bundler '@internal/eslint-config': link:../../share/eslint-config @@ -741,8 +741,8 @@ importers: vite: 3.2.6 dependencies: '@visactor/vchart': link:../../packages/vchart - '@visactor/vrender': 0.15.2 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vutils': 0.16.1 devDependencies: '@internal/bundler': link:../bundler '@internal/eslint-config': link:../../share/eslint-config @@ -2328,7 +2328,7 @@ packages: ajv: 6.12.6 debug: 4.3.4 espree: 9.6.1 - globals: 13.21.0 + globals: 13.22.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -3920,8 +3920,8 @@ packages: '@types/node': 20.6.3 dev: true - /@types/graceful-fs/4.1.6: - resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} + /@types/graceful-fs/4.1.7: + resolution: {integrity: sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==} dependencies: '@types/node': 20.6.3 dev: true @@ -4433,13 +4433,13 @@ packages: resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} dev: true - /@visactor/vdataset/0.16.0: - resolution: {integrity: sha512-D2RhWhguxbAiIqYkcws9latHB07aihvuEfpyldhqp7mgeO+1kyIAY8rfFGhgsRD/lEJHBSUYPJQjGkRTI/b/oA==} + /@visactor/vdataset/0.16.1: + resolution: {integrity: sha512-7CuXVuS6ujaIh+nIdKo5o2W5YTaptW6fcKRtDBY/Rug9+r2474Fr/hDDkyUYRFQQkjxJG+W2TFB9z2fT0A1eqQ==} dependencies: '@turf/flatten': 6.5.0 '@turf/helpers': 6.5.0 '@turf/rewind': 6.5.0 - '@visactor/vutils': 0.16.0 + '@visactor/vutils': 0.16.1 d3-dsv: 3.0.1 d3-geo: 1.12.1 d3-hexbin: 0.2.2 @@ -4459,19 +4459,19 @@ packages: resolution: {integrity: sha512-NRCmTQUZYBQAvACG16Usm7mCUTj29hSWJ6h7uYTMcQZSkQB4Hcr1GWQMKuEze1Bx41aTsB4jGfQ3za5+xufX1w==} dependencies: '@visactor/vgrammar-util': 0.7.3 - '@visactor/vutils': 0.16.0 + '@visactor/vutils': 0.16.1 dev: false /@visactor/vgrammar-core/0.7.3: resolution: {integrity: sha512-u6/1/HQvpQSI34MSGDc/jzc1DeZO/oGHPBNlWI3IBg87Ei9CbSPi+z/VoUGD8+FJZfxZG9s3FYIhjXp4fPDU9w==} dependencies: - '@visactor/vdataset': 0.16.0 + '@visactor/vdataset': 0.16.1 '@visactor/vgrammar-coordinate': 0.7.3 '@visactor/vgrammar-util': 0.7.3 - '@visactor/vrender': 0.15.2 - '@visactor/vrender-components': 0.15.2 - '@visactor/vscale': 0.16.0 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vrender-components': 0.15.3 + '@visactor/vscale': 0.16.1 + '@visactor/vutils': 0.16.1 dev: false /@visactor/vgrammar-hierarchy/0.7.3: @@ -4479,8 +4479,8 @@ packages: dependencies: '@visactor/vgrammar-core': 0.7.3 '@visactor/vgrammar-util': 0.7.3 - '@visactor/vrender': 0.15.2 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vutils': 0.16.1 dev: false /@visactor/vgrammar-projection/0.7.3: @@ -4488,7 +4488,7 @@ packages: dependencies: '@visactor/vgrammar-core': 0.7.3 '@visactor/vgrammar-util': 0.7.3 - '@visactor/vutils': 0.16.0 + '@visactor/vutils': 0.16.1 d3-geo: 1.12.1 dev: false @@ -4497,14 +4497,14 @@ packages: dependencies: '@visactor/vgrammar-core': 0.7.3 '@visactor/vgrammar-util': 0.7.3 - '@visactor/vrender': 0.15.2 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vutils': 0.16.1 dev: false /@visactor/vgrammar-util/0.7.3: resolution: {integrity: sha512-TwFKjZnDfwv1Yt7IckpX9flu4z2CPUbU4XH+eK2HwQpbZIjwcyzyeAC/Fo+qgdj6tmdzci+7KjFH9YUZu+Tlag==} dependencies: - '@visactor/vutils': 0.16.0 + '@visactor/vutils': 0.16.1 dev: false /@visactor/vgrammar-wordcloud-shape/0.7.3: @@ -4512,9 +4512,9 @@ packages: dependencies: '@visactor/vgrammar-core': 0.7.3 '@visactor/vgrammar-util': 0.7.3 - '@visactor/vrender': 0.15.2 - '@visactor/vscale': 0.16.0 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vscale': 0.16.1 + '@visactor/vutils': 0.16.1 dev: false /@visactor/vgrammar-wordcloud/0.7.3: @@ -4522,8 +4522,8 @@ packages: dependencies: '@visactor/vgrammar-core': 0.7.3 '@visactor/vgrammar-util': 0.7.3 - '@visactor/vrender': 0.15.2 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vutils': 0.16.1 dev: false /@visactor/vgrammar/0.7.3: @@ -4550,33 +4550,33 @@ packages: - encoding dev: false - /@visactor/vrender-components/0.15.2: - resolution: {integrity: sha512-6q6CJZEt02QJiyViQzZYffxmdw2ijSi7vvruGXtFZ207IecW5Cq7yxNH8oOoPu1hnjqhcdryo7JM0cEhbLUG/Q==} + /@visactor/vrender-components/0.15.3: + resolution: {integrity: sha512-i0Ts42Hi+iJr6BWr1gKOzhWXGqL/hwDitbj4RrpKd0pFsBgWcIBB8Va6UspBZTxNdUYW/SCZrbQ0D0YwfTRPiw==} dependencies: - '@visactor/vrender': 0.15.2 - '@visactor/vscale': 0.16.0 - '@visactor/vutils': 0.16.0 + '@visactor/vrender': 0.15.3 + '@visactor/vscale': 0.16.1 + '@visactor/vutils': 0.16.1 inversify: 6.0.1 dev: false - /@visactor/vrender/0.15.2: - resolution: {integrity: sha512-qKEIz/fBzXxVt2Fot8OWJpl18JZGC18UMiawNkmssvfOKVGlSsO+pVxf9qAWM1yyr2sXT430SmNcqjY0ZDLr8w==} + /@visactor/vrender/0.15.3: + resolution: {integrity: sha512-FjE8BDXMv2NoqaJt+2bJNEzYq2fFBZD5TXZ9+l40RC6x5SfVi2eaB8/xCa8xwtwjq3LPL77L5qFBLx82TfZbmQ==} dependencies: - '@visactor/vutils': 0.16.0 + '@visactor/vutils': 0.16.1 color-convert: 2.0.1 core-js: 3.31.1 fast-xml-parser: 4.2.7 inversify: 6.0.1 dev: false - /@visactor/vscale/0.16.0: - resolution: {integrity: sha512-WssJ7170st7d5NaloL2syVs4npZvjzYQfAY05rfYVVJ5Zqt2Bpo3edV41jkbmMrdpVU9Mt0XoZqhJQrOI2U8PQ==} + /@visactor/vscale/0.16.1: + resolution: {integrity: sha512-/+6Fyi0dvvYMAxLgDLamY6zIV9i2zzGw2MOiOeyRiL+uZLTxmLc5MIl7SjQlcgdMiFBRh2IJ7qU99Lv8Bl7D1g==} dependencies: - '@visactor/vutils': 0.16.0 + '@visactor/vutils': 0.16.1 dev: false - /@visactor/vutils/0.16.0: - resolution: {integrity: sha512-YvURVSm3uc3k98wS0YvzkWTE+CbLMVznxESmnBLABrnvqSgG2UJB6LIN72ZMrAPiu8o6i5yn5ABo2Gdr9rBcnQ==} + /@visactor/vutils/0.16.1: + resolution: {integrity: sha512-hYBwQO/sWr2v5EfszxKHYvWVDZYDsn0WSYSsP0okiwYIrz3Pa5eFrNzF3FC2/6P23pT8IPTG+ca/5/ECU3TP6g==} dependencies: '@turf/helpers': 6.5.0 '@turf/invariant': 6.5.0 @@ -6628,7 +6628,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001538 - electron-to-chromium: 1.4.525 + electron-to-chromium: 1.4.526 dev: true /browserslist/4.21.10: @@ -6637,9 +6637,9 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001538 - electron-to-chromium: 1.4.525 + electron-to-chromium: 1.4.526 node-releases: 2.0.13 - update-browserslist-db: 1.0.11_browserslist@4.21.10 + update-browserslist-db: 1.0.12_browserslist@4.21.10 /bs-logger/0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} @@ -8875,8 +8875,8 @@ packages: jake: 10.8.7 dev: true - /electron-to-chromium/1.4.525: - resolution: {integrity: sha512-GIZ620hDK4YmIqAWkscG4W6RwY6gOx1y5J6f4JUQwctiJrqH2oxZYU4mXHi35oV32tr630UcepBzSBGJ/WYcZA==} + /electron-to-chromium/1.4.526: + resolution: {integrity: sha512-tjjTMjmZAx1g6COrintLTa2/jcafYKxKoiEkdQOrVdbLaHh2wCt2nsAF8ZHweezkrP+dl/VG9T5nabcYoo0U5Q==} /electron/11.5.0: resolution: {integrity: sha512-WjNDd6lGpxyiNjE3LhnFCAk/D9GIj1rU3GSDealVShhkkkPR3Vh4q8ErXGDl1OAO/faomVa10KoFPUN/pLbNxg==} @@ -9816,7 +9816,7 @@ packages: file-entry-cache: 6.0.1 functional-red-black-tree: 1.0.1 glob-parent: 6.0.2 - globals: 13.21.0 + globals: 13.22.0 ignore: 5.2.4 import-fresh: 3.3.0 imurmurhash: 0.1.4 @@ -11244,8 +11244,8 @@ packages: type-fest: 0.8.1 dev: true - /globals/13.21.0: - resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==} + /globals/13.22.0: + resolution: {integrity: sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -13267,7 +13267,7 @@ packages: jest: ^24.0.0 dependencies: electron: 11.5.0 - jest: 26.6.3_xxvpynkn5i4ehycnunrxxsezu4 + jest: 26.6.3_ts-node@10.9.0 jest-haste-map: 24.9.0 jest-message-util: 24.9.0 jest-mock: 24.9.0 @@ -13390,7 +13390,7 @@ packages: engines: {node: '>= 10.14.2'} dependencies: '@jest/types': 26.6.2 - '@types/graceful-fs': 4.1.6 + '@types/graceful-fs': 4.1.7 '@types/node': 20.6.3 anymatch: 3.1.3 fb-watchman: 2.0.2 @@ -21215,8 +21215,8 @@ packages: resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==} engines: {node: '>=4'} - /update-browserslist-db/1.0.11_browserslist@4.21.10: - resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} + /update-browserslist-db/1.0.12_browserslist@4.21.10: + resolution: {integrity: sha512-tE1smlR58jxbFMtrMpFNRmsrOXlpNXss965T1CrpwuZUzUAg/TBQc94SpyhDLSzrqrJS9xTRBthnZAGcE1oaxg==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' diff --git a/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts b/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts index 7242a0c999..5602dc1068 100644 --- a/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts +++ b/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts @@ -10060,7 +10060,7 @@ const run = () => { hash: 'bac9588b1df4b39ecd241109d133d496' }; - const vChart = new VChart(spec1, { + const vChart = new VChart(spec2, { dom: document.getElementById('chart') as HTMLElement, mode: isMobile ? 'mobile-browser' : 'desktop-browser' }); diff --git a/packages/vchart/src/series/sankey/sankey.ts b/packages/vchart/src/series/sankey/sankey.ts index ca94c8e0f8..96b6e1f722 100644 --- a/packages/vchart/src/series/sankey/sankey.ts +++ b/packages/vchart/src/series/sankey/sankey.ts @@ -248,7 +248,7 @@ export class SankeySeries exten y: (datum: Datum) => datum.y0, y1: (datum: Datum) => datum.y1, fill: (datum: Datum) => { - const nodeName = datum.key ?? datum[this._spec.categoryField] ?? ''; + const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); } }, @@ -273,7 +273,11 @@ export class SankeySeries exten y1: (datum: Datum) => datum.y1, thickness: (datum: Datum) => datum.thickness, fill: (datum: Datum) => { - return this._spec.link?.style?.fill ?? this.getNodeOrdinalColorScale(datum.source); + const sourceName = + this._spec?.nameKey || this._rawData.latestData[0]?.nodes?.[0]?.children + ? datum.source + : this.getNodeList()[datum.source]; + return this._spec.link?.style?.fill ?? this.getNodeOrdinalColorScale(sourceName); }, direction: this._spec.direction ?? 'horizontal' }, @@ -346,7 +350,8 @@ export class SankeySeries exten return datum.y1; }, fill: (datum: Datum) => { - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(datum.key); + const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); }, text: (datum: Datum) => this._createText(datum), limit: this._labelLimit, @@ -415,7 +420,8 @@ export class SankeySeries exten x: (datum: Datum) => datum.x0, y: (datum: Datum) => (datum.y0 + datum.y1) / 2, fill: (datum: Datum) => { - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(datum.key); + const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); }, text: (datum: Datum) => this._createText(datum), limit: this._labelLimit, @@ -432,7 +438,8 @@ export class SankeySeries exten x: (datum: Datum) => datum.x1, y: (datum: Datum) => (datum.y0 + datum.y1) / 2, fill: (datum: Datum) => { - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(datum.key); + const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); }, text: (datum: Datum) => this._createText(datum), limit: this._labelLimit, @@ -454,7 +461,8 @@ export class SankeySeries exten }, y: (datum: Datum) => (datum.y0 + datum.y1) / 2, fill: (datum: Datum) => { - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(datum.key); + const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); }, text: (datum: Datum) => this._createText(datum), limit: this._labelLimit, @@ -1255,23 +1263,9 @@ export class SankeySeries exten } getNodeOrdinalColorScale(item: string) { - const colorDomain = - this._option.globalScale.getScale('color')?.domain() ?? - (this._rawData.latestData[0]?.nodes - ? this._rawData.latestData[0].nodes[0]?.children - ? Array.from(this.extractNamesFromTree(this._rawData.latestData[0].nodes, this._spec.categoryField)) - : this._rawData.latestData[0].nodes.map((datum: Datum, index: number) => { - if (this._spec.nodeKey) { - return datum[this._spec.categoryField]; - } - return index; - }) - : this._rawData.latestData[0]?.values.map((datum: Datum, index: number) => { - if (this._spec.nodeKey) { - return datum[this._spec.categoryField]; - } - return index; - })); + const colorDomain = !isNil(this._option.globalScale.getScale('color')?.domain()[0]) + ? this._option.globalScale.getScale('color')?.domain() + : this.getNodeList(); const colorRange = this._option.globalScale.getScale('color')?.range() ?? @@ -1284,6 +1278,20 @@ export class SankeySeries exten return ordinalScale.scale(item); } + getNodeList() { + const nodeList = this._rawData.latestData[0]?.nodes + ? this._rawData.latestData[0].nodes[0]?.children + ? Array.from(this.extractNamesFromTree(this._rawData.latestData[0].nodes, this._spec.categoryField)) + : this._rawData.latestData[0].nodes.map((datum: Datum, index: number) => { + return datum[this._spec.categoryField]; + }) + : this._rawData.latestData[0]?.values.map((datum: Datum, index: number) => { + return datum[this._spec.categoryField]; + }); + + return nodeList; + } + extractNamesFromTree(tree: any, categoryName: string) { // Set 用于存储唯一的 name 值 const uniqueNames = new Set(); From afe2198c005cdaf569cfcfe0b79a6ad013886dfe Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Thu, 21 Sep 2023 12:07:52 +0800 Subject: [PATCH 5/9] feat: rush update --- common/config/rush/pnpm-lock.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 84c65e07aa..a44a386f00 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -43,9 +43,9 @@ importers: '@arco-design/web-react': 2.46.1_cccfvuyjnmee77bwg4wjyn6zre '@visactor/vchart': link:../packages/vchart '@visactor/vgrammar': 0.7.3 - '@visactor/vmind': 1.0.6-alpha.2_7i2a3jlfudjwv4qjzxr3uxbiwi - '@visactor/vrender': 0.15.2 - '@visactor/vutils': 0.16.0 + '@visactor/vmind': 1.0.6-alpha.3_zek35pddvdjy2zglnyjcvmb6jq + '@visactor/vrender': 0.15.3 + '@visactor/vutils': 0.16.1 axios: 1.5.0 highlight.js: 11.8.0 markdown-it: 13.0.1 @@ -13270,7 +13270,7 @@ packages: jest: ^24.0.0 dependencies: electron: 11.5.0 - jest: 26.6.3_ts-node@10.9.0 + jest: 26.6.3_xxvpynkn5i4ehycnunrxxsezu4 jest-haste-map: 24.9.0 jest-message-util: 24.9.0 jest-mock: 24.9.0 @@ -15308,7 +15308,7 @@ packages: decamelize: 1.2.0 loud-rejection: 1.6.0 map-obj: 1.0.1 - minimist: 1.2.8 + minimist: 1.2.5 normalize-package-data: 2.5.0 object-assign: 4.1.1 read-pkg-up: 1.0.1 @@ -17707,7 +17707,7 @@ packages: dependencies: deep-extend: 0.6.0 ini: 1.3.8 - minimist: 1.2.8 + minimist: 1.2.5 strip-json-comments: 2.0.1 dev: true @@ -20681,7 +20681,7 @@ packages: bs-logger: 0.2.6 buffer-from: 1.1.2 fast-json-stable-stringify: 2.1.0 - jest: 26.6.3_xxvpynkn5i4ehycnunrxxsezu4 + jest: 26.6.3 jest-util: 26.6.2 json5: 2.2.3 lodash: 4.17.21 From e988b24955c263b2c7cbde1653876fe5319c2814 Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Thu, 21 Sep 2023 15:20:07 +0800 Subject: [PATCH 6/9] fix: json format data color range --- .../__tests__/runtime/browser/test-page/sankey.ts | 2 +- packages/vchart/src/series/sankey/sankey.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts b/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts index 5602dc1068..4b28f1f2cc 100644 --- a/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts +++ b/packages/vchart/__tests__/runtime/browser/test-page/sankey.ts @@ -10060,7 +10060,7 @@ const run = () => { hash: 'bac9588b1df4b39ecd241109d133d496' }; - const vChart = new VChart(spec2, { + const vChart = new VChart(spec4, { dom: document.getElementById('chart') as HTMLElement, mode: isMobile ? 'mobile-browser' : 'desktop-browser' }); diff --git a/packages/vchart/src/series/sankey/sankey.ts b/packages/vchart/src/series/sankey/sankey.ts index 96b6e1f722..c9d291bc95 100644 --- a/packages/vchart/src/series/sankey/sankey.ts +++ b/packages/vchart/src/series/sankey/sankey.ts @@ -1267,10 +1267,19 @@ export class SankeySeries exten ? this._option.globalScale.getScale('color')?.domain() : this.getNodeList(); - const colorRange = + let colorRange = this._option.globalScale.getScale('color')?.range() ?? getDataScheme(this._option.getTheme().colorScheme, this.type as any); + if ( + this._option.globalScale.getScale('color')?.domain().length === 0 || + isNil(this._option.globalScale.getScale('color')?.domain()[0]) + ) { + if (colorDomain.length > 10) { + colorRange = getDataScheme(this._option.getTheme().colorScheme, this.type as any)[1]?.scheme; + } + } + const ordinalScale = new ColorOrdinalScale(); ordinalScale.domain(colorDomain).range?.(colorRange); From c6a1131c1de5415492471a98682721eda19fef6a Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Thu, 21 Sep 2023 15:23:33 +0800 Subject: [PATCH 7/9] feat: type error --- packages/vchart/src/series/sankey/sankey.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vchart/src/series/sankey/sankey.ts b/packages/vchart/src/series/sankey/sankey.ts index c9d291bc95..86ec3910da 100644 --- a/packages/vchart/src/series/sankey/sankey.ts +++ b/packages/vchart/src/series/sankey/sankey.ts @@ -1276,7 +1276,7 @@ export class SankeySeries exten isNil(this._option.globalScale.getScale('color')?.domain()[0]) ) { if (colorDomain.length > 10) { - colorRange = getDataScheme(this._option.getTheme().colorScheme, this.type as any)[1]?.scheme; + colorRange = (getDataScheme(this._option.getTheme().colorScheme, this.type as any)[1] as any)?.scheme; } } From a26bbce26e82053c56cdf4138718b88cd9d651b2 Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Thu, 21 Sep 2023 16:38:14 +0800 Subject: [PATCH 8/9] feat: remove unnecessary protection --- packages/vchart/src/series/sankey/sankey.ts | 27 ++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/vchart/src/series/sankey/sankey.ts b/packages/vchart/src/series/sankey/sankey.ts index 86ec3910da..ef03dce5e0 100644 --- a/packages/vchart/src/series/sankey/sankey.ts +++ b/packages/vchart/src/series/sankey/sankey.ts @@ -248,8 +248,7 @@ export class SankeySeries exten y: (datum: Datum) => datum.y0, y1: (datum: Datum) => datum.y1, fill: (datum: Datum) => { - const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(this._getNodeNameFromData(datum)); } }, STATE_VALUE_ENUM.STATE_NORMAL, @@ -350,8 +349,7 @@ export class SankeySeries exten return datum.y1; }, fill: (datum: Datum) => { - const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(this._getNodeNameFromData(datum)); }, text: (datum: Datum) => this._createText(datum), limit: this._labelLimit, @@ -420,8 +418,7 @@ export class SankeySeries exten x: (datum: Datum) => datum.x0, y: (datum: Datum) => (datum.y0 + datum.y1) / 2, fill: (datum: Datum) => { - const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(this._getNodeNameFromData(datum)); }, text: (datum: Datum) => this._createText(datum), limit: this._labelLimit, @@ -438,8 +435,7 @@ export class SankeySeries exten x: (datum: Datum) => datum.x1, y: (datum: Datum) => (datum.y0 + datum.y1) / 2, fill: (datum: Datum) => { - const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(this._getNodeNameFromData(datum)); }, text: (datum: Datum) => this._createText(datum), limit: this._labelLimit, @@ -461,8 +457,7 @@ export class SankeySeries exten }, y: (datum: Datum) => (datum.y0 + datum.y1) / 2, fill: (datum: Datum) => { - const nodeName = datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; - return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(nodeName); + return this._spec.node?.style?.fill ?? this.getNodeOrdinalColorScale(this._getNodeNameFromData(datum)); }, text: (datum: Datum) => this._createText(datum), limit: this._labelLimit, @@ -1263,8 +1258,8 @@ export class SankeySeries exten } getNodeOrdinalColorScale(item: string) { - const colorDomain = !isNil(this._option.globalScale.getScale('color')?.domain()[0]) - ? this._option.globalScale.getScale('color')?.domain() + const colorDomain = !isNil(this._option.globalScale.getScale('color').domain()[0]) + ? this._option.globalScale.getScale('color').domain() : this.getNodeList(); let colorRange = @@ -1272,8 +1267,8 @@ export class SankeySeries exten getDataScheme(this._option.getTheme().colorScheme, this.type as any); if ( - this._option.globalScale.getScale('color')?.domain().length === 0 || - isNil(this._option.globalScale.getScale('color')?.domain()[0]) + this._option.globalScale.getScale('color').domain().length === 0 || + isNil(this._option.globalScale.getScale('color').domain()[0]) ) { if (colorDomain.length > 10) { colorRange = (getDataScheme(this._option.getTheme().colorScheme, this.type as any)[1] as any)?.scheme; @@ -1301,6 +1296,10 @@ export class SankeySeries exten return nodeList; } + _getNodeNameFromData(datum: Datum) { + return datum?.datum ? datum?.datum[this._spec.categoryField] : datum[this._spec.categoryField]; + } + extractNamesFromTree(tree: any, categoryName: string) { // Set 用于存储唯一的 name 值 const uniqueNames = new Set(); From 3a2830e9d48543c76187eae716396c117ec49b81 Mon Sep 17 00:00:00 2001 From: pairone <1063258712@qq.com> Date: Thu, 21 Sep 2023 19:10:17 +0800 Subject: [PATCH 9/9] feat: add protection where necessary --- packages/vchart/src/series/sankey/sankey.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vchart/src/series/sankey/sankey.ts b/packages/vchart/src/series/sankey/sankey.ts index ef03dce5e0..2b979cd607 100644 --- a/packages/vchart/src/series/sankey/sankey.ts +++ b/packages/vchart/src/series/sankey/sankey.ts @@ -1258,7 +1258,7 @@ export class SankeySeries exten } getNodeOrdinalColorScale(item: string) { - const colorDomain = !isNil(this._option.globalScale.getScale('color').domain()[0]) + const colorDomain = !isNil(this._option.globalScale.getScale('color')?.domain()?.[0]) ? this._option.globalScale.getScale('color').domain() : this.getNodeList(); @@ -1267,7 +1267,7 @@ export class SankeySeries exten getDataScheme(this._option.getTheme().colorScheme, this.type as any); if ( - this._option.globalScale.getScale('color').domain().length === 0 || + this._option.globalScale.getScale('color')?.domain().length === 0 || isNil(this._option.globalScale.getScale('color').domain()[0]) ) { if (colorDomain.length > 10) {