@gadmin2n/schematics 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/prisma/job.prisma +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/prisma/system.prisma +0 -21
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/prisma/workflow.prisma +171 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/AgendaJob.ts +60 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/Event.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/WorkflowEventOutbox.ts +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/WorkflowNodeInstance.ts +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/WorkflowNodeType.ts +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/.env +5 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/package.json +5 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/prisma.config.ts +14 -7
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/index.ts +4 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/permissions.ts +49 -3
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/workflow-node-types.ts +746 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/workflows.ts +786 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agenda/agenda.controller.ts +6 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agenda/agenda.service.ts +79 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agendaJob/agendaJob.controller.spec.ts +20 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agendaJob/agendaJob.controller.ts +145 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agendaJob/agendaJob.module.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/{canvas/canvas.service.spec.ts → agendaJob/agendaJob.service.spec.ts} +71 -65
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agendaJob/agendaJob.service.ts +83 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/index.ts +2 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/temporal.module.ts +9 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/temporal.service.ts +100 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-execution.dto.ts +19 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-export.dto.ts +43 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-export.service.ts +317 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-node-type.controller.ts +16 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-node-type.service.ts +13 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.controller.ts +220 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.dto.ts +82 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.module.ts +16 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.service.ts +505 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.controller.spec.ts +22 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.controller.ts +147 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.module.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.service.spec.ts +356 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowEventOutbox/workflowEventOutbox.service.ts +110 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.controller.spec.ts +22 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.controller.ts +216 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.module.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.service.spec.ts +356 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.service.ts +168 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.controller.spec.ts +22 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.controller.ts +199 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.module.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.service.spec.ts +348 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.service.ts +106 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/yarn.lock +579 -1082
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/README.md +278 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/config/development-sql.yaml +5 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/docker-compose.yml +25 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/package.json +13 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/sql/create-event-trigger.sql +87 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/.env +7 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/SANDBOX.md +122 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/package-lock.json +4285 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/package.json +28 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/__tests__/activities/code-execute.test.ts +44 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/__tests__/activities/http-request.test.ts +87 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/__tests__/helpers.test.ts +225 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/__tests__/node-type-consistency.test.ts +101 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/code-execute.ts +51 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/db-execute.ts +85 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/db-query.ts +35 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/http-request.ts +54 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/index.ts +6 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/reporting.ts +62 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/activities/send-notification.ts +47 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/config.ts +13 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/condition.ts +101 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/context.ts +58 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/graph.ts +184 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/helpers.ts +133 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/node-types.ts +57 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/dsl/types.ts +77 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/index.ts +36 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/outbox-poller.ts +226 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/src/workflows/dsl-workflow.ts +411 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/tsconfig.json +19 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/vitest.config.ts +8 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/temporal/worker/yarn.lock +1905 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/package-lock.json +17555 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/package.json +5 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/App.tsx +1 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/layout/sider.tsx +5 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/layout/title.tsx +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/config/routeRegistry.tsx +63 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/dev-shell/DevShell.tsx +91 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/list.tsx +48 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/helpers/show.tsx +43 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/locales/en/common.json +14 -9
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/locales/zh_CN/common.json +14 -9
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agenda/index.tsx +309 -56
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agenda/show.tsx +1 -3
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/create.tsx +108 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/edit.tsx +124 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/index.tsx +4 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/list.tsx +245 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agendaJob/show.tsx +70 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CanvasListPage.tsx +0 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CanvasPage.tsx +160 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CanvasToolbar.tsx +120 -148
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CodeFloatWindow.tsx +74 -181
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/LivePreview.tsx +15 -13
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/canvasConfigRegistry.tsx +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/canvasContextMenuRegistry.tsx +338 -3
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/canvasDefaults.ts +18 -17
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/BarChartDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/LineChartDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/{ChartViewerConfigModal.tsx → MultiChartConfigModal.tsx} +30 -18
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/MultiChartDataSourceModal.tsx +427 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/NumCardDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/PromptModal.tsx +6 -14
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/RadarChartDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/TableDataSourceModal.tsx +10 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/components/canvasModalProps.ts +24 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/demos.ts +45 -63
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/CustomNode.tsx +99 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/ExportModal.tsx +87 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/FlowRenderer.tsx +322 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/ImportModal.tsx +175 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/NodeEditModal.tsx +60 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/NodePropertyPanel.tsx +1150 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/RunWorkflowModal.tsx +101 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/StatusCards.tsx +198 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/VersionPanel.tsx +81 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/editor.tsx +566 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/hooks/useWorkflowAgent.ts +224 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/index.tsx +524 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/instance-detail.tsx +343 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/instances.tsx +243 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/components/CreateNodeInstanceModal.tsx +363 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/components/DynamicConfigForm.tsx +154 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/components/NodeInstanceForm.tsx +176 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/create.tsx +77 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/edit.tsx +112 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/index.tsx +305 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/show.tsx +282 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/show.tsx +469 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/types.ts +92 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/create.tsx +111 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/edit.tsx +127 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/index.tsx +4 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/list.tsx +254 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflowEventOutbox/show.tsx +74 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/yarn.lock +1501 -1199
- package/package.json +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/app.controller.spec.ts +0 -22
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/BarChart/index.tsx +0 -896
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/ChartSwitcher/index.tsx +0 -219
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/ChartViewer/index.tsx +0 -159
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/Filter/index.tsx +0 -192
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/LineChart/index.tsx +0 -1034
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/NumCard/NumCard.module.css +0 -8
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/NumCard/index.tsx +0 -509
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/NumLineCard/index.tsx +0 -66
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/PieChart/index.tsx +0 -552
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/RadarChart/index.tsx +0 -263
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/Section/index.tsx +0 -35
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/Table/index.tsx +0 -207
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/TreemapChart/index.tsx +0 -382
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/WorldMap/index.tsx +0 -135
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/chart-constants.ts +0 -53
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/icon/InfoIcon.tsx +0 -8
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/icon/index.ts +0 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/map/config.ts +0 -31
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/map/nameMap.json +0 -9
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/map/world.geo.json +0 -39349
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/metric-info-tooltip/index.tsx +0 -19
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import { Spin, Empty } from 'antd';
|
|
3
|
-
import type * as echarts from 'echarts';
|
|
4
|
-
import { useECharts } from '@/hooks/useECharts';
|
|
5
|
-
|
|
6
|
-
// ─── Types ────────────────────────────────────────────────────────────────────
|
|
7
|
-
|
|
8
|
-
export interface TreemapDataItem {
|
|
9
|
-
/** 方块名称,显示在方块内部 */
|
|
10
|
-
name: string;
|
|
11
|
-
/** 方块大小(数值越大占的面积越大) */
|
|
12
|
-
value: number;
|
|
13
|
-
/** 自定义颜色,不传则使用 ECharts 默认色板 */
|
|
14
|
-
color?: string;
|
|
15
|
-
/** 子节点(支持嵌套分组,外层方块作为分组容器) */
|
|
16
|
-
children?: TreemapDataItem[];
|
|
17
|
-
/** 附加字段,可在 tooltip formatter 中使用 */
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface TreemapChartProps {
|
|
22
|
-
/** 数据,支持扁平和嵌套两种结构(自动检测,无需手动指定)
|
|
23
|
-
* - 扁平:`{ name, value, color? }[]` → 按色相排序,相近颜色聚集
|
|
24
|
-
* - 嵌套:`{ name, children: [...] }[]` → 同组方块聚集,顶层颜色区分分组
|
|
25
|
-
*/
|
|
26
|
-
data: TreemapDataItem[];
|
|
27
|
-
/**
|
|
28
|
-
* 图表标题,渲染在图表上方。
|
|
29
|
-
* - 字符串:套默认样式(居中、12px、bold、#515151)
|
|
30
|
-
* - ReactNode:直接渲染,样式由调用方控制
|
|
31
|
-
* height 只指图表区域高度,标题额外占空间。
|
|
32
|
-
*/
|
|
33
|
-
title?: React.ReactNode;
|
|
34
|
-
/** 图表容器高度,默认 400。推荐传数字,弹性布局才用字符串 */
|
|
35
|
-
height?: number | string;
|
|
36
|
-
/** 透传至 ECharts option 的配置,与基准配置浅合并。
|
|
37
|
-
* 可覆盖 tooltip(含 formatter)、series 等字段 */
|
|
38
|
-
chartProps?: Record<string, any>;
|
|
39
|
-
/** 是否显示图例(仅嵌套数据有效),默认 true */
|
|
40
|
-
legendShow?: boolean;
|
|
41
|
-
loading?: boolean;
|
|
42
|
-
/** 强制显示空态。未传时组件根据 data.length === 0 自动判断 */
|
|
43
|
-
empty?: boolean;
|
|
44
|
-
style?: React.CSSProperties;
|
|
45
|
-
className?: string;
|
|
46
|
-
/** 渲染为 data-testid,必须填写 */
|
|
47
|
-
testId: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// ─── Default colors ───────────────────────────────────────────────────────────
|
|
51
|
-
|
|
52
|
-
const DEFAULT_COLORS = [
|
|
53
|
-
'#3889f3',
|
|
54
|
-
'#0db46c',
|
|
55
|
-
'#f5a623',
|
|
56
|
-
'#9b59b6',
|
|
57
|
-
'#e74c3c',
|
|
58
|
-
'#1abc9c',
|
|
59
|
-
'#e67e22',
|
|
60
|
-
'#2980b9',
|
|
61
|
-
'#8e44ad',
|
|
62
|
-
'#27ae60',
|
|
63
|
-
'#d35400',
|
|
64
|
-
'#16a085',
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
// ─── Color utils ─────────────────────────────────────────────────────────────
|
|
68
|
-
|
|
69
|
-
/** hex → hue (0–360),用于按色相排序 */
|
|
70
|
-
function hexToHue(hex: string): number {
|
|
71
|
-
const clean = hex.replace('#', '');
|
|
72
|
-
const r = parseInt(clean.slice(0, 2), 16) / 255;
|
|
73
|
-
const g = parseInt(clean.slice(2, 4), 16) / 255;
|
|
74
|
-
const b = parseInt(clean.slice(4, 6), 16) / 255;
|
|
75
|
-
const max = Math.max(r, g, b);
|
|
76
|
-
const min = Math.min(r, g, b);
|
|
77
|
-
const d = max - min;
|
|
78
|
-
if (d === 0) return 0;
|
|
79
|
-
let h = 0;
|
|
80
|
-
if (max === r) h = ((g - b) / d + 6) % 6;
|
|
81
|
-
else if (max === g) h = (b - r) / d + 2;
|
|
82
|
-
else h = (r - g) / d + 4;
|
|
83
|
-
return h * 60;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ─── Flatten nested data ─────────────────────────────────────────────────────
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 将嵌套 TreemapDataItem 展平为一层,子节点继承父节点颜色。
|
|
90
|
-
* tooltip 中通过 `groupName` 字段显示所属分组。
|
|
91
|
-
*/
|
|
92
|
-
function flattenTreemapData(data: TreemapDataItem[]): TreemapDataItem[] {
|
|
93
|
-
const result: TreemapDataItem[] = [];
|
|
94
|
-
for (const parent of data) {
|
|
95
|
-
if (parent.children && parent.children.length > 0) {
|
|
96
|
-
for (const child of parent.children) {
|
|
97
|
-
result.push({
|
|
98
|
-
...child,
|
|
99
|
-
color: child.color ?? parent.color,
|
|
100
|
-
groupName: parent.name,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
result.push(parent);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return result;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// ─── Option Builder ───────────────────────────────────────────────────────────
|
|
111
|
-
|
|
112
|
-
function buildTreemapOption(
|
|
113
|
-
data: TreemapDataItem[],
|
|
114
|
-
chartProps: Record<string, any>,
|
|
115
|
-
): echarts.EChartsOption {
|
|
116
|
-
const { series: _s, tooltip = {}, ...restChartProps } = chartProps;
|
|
117
|
-
|
|
118
|
-
// 判断是否为扁平数据(无 children)
|
|
119
|
-
const isFlat = data.every((d) => !d.children || d.children.length === 0);
|
|
120
|
-
|
|
121
|
-
let processedData: TreemapDataItem[];
|
|
122
|
-
|
|
123
|
-
if (isFlat) {
|
|
124
|
-
// 扁平数据:自动分配不重复颜色,按色相排序使相近颜色聚集
|
|
125
|
-
const assignedColors = data.map((item, i) => ({
|
|
126
|
-
...item,
|
|
127
|
-
_color: item.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length],
|
|
128
|
-
}));
|
|
129
|
-
processedData = assignedColors
|
|
130
|
-
.sort((a, b) => hexToHue(a._color) - hexToHue(b._color))
|
|
131
|
-
.map((item) => ({
|
|
132
|
-
...item,
|
|
133
|
-
itemStyle: { color: item._color },
|
|
134
|
-
}));
|
|
135
|
-
} else {
|
|
136
|
-
// 嵌套数据:顶层节点注入颜色,子节点由 colorSaturation 处理
|
|
137
|
-
processedData = data.map((item, i) => ({
|
|
138
|
-
...item,
|
|
139
|
-
itemStyle: {
|
|
140
|
-
color: item.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length],
|
|
141
|
-
},
|
|
142
|
-
}));
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return {
|
|
146
|
-
tooltip: {
|
|
147
|
-
formatter: (params: any) => {
|
|
148
|
-
const { name, value, treePathInfo } = params;
|
|
149
|
-
const group = treePathInfo?.length > 2 ? treePathInfo[1]?.name : null;
|
|
150
|
-
return group
|
|
151
|
-
? `<div style="font-weight:bold">${group} · ${name}</div><div>数量:${Number(value).toLocaleString()}</div>`
|
|
152
|
-
: `<div style="font-weight:bold">${name}</div><div>数量:${Number(value).toLocaleString()}</div>`;
|
|
153
|
-
},
|
|
154
|
-
...tooltip,
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
series: [
|
|
158
|
-
{
|
|
159
|
-
type: 'treemap',
|
|
160
|
-
data: processedData,
|
|
161
|
-
top: 4,
|
|
162
|
-
bottom: 4,
|
|
163
|
-
left: 4,
|
|
164
|
-
right: 4,
|
|
165
|
-
roam: false,
|
|
166
|
-
nodeClick: false,
|
|
167
|
-
breadcrumb: { show: false },
|
|
168
|
-
colorSaturation: undefined,
|
|
169
|
-
colorLightness: undefined,
|
|
170
|
-
colorMappingBy: undefined,
|
|
171
|
-
levels: isFlat
|
|
172
|
-
? [
|
|
173
|
-
{
|
|
174
|
-
itemStyle: { borderWidth: 1, borderColor: '#fff', gapWidth: 1 },
|
|
175
|
-
label: {
|
|
176
|
-
show: true,
|
|
177
|
-
fontSize: 12,
|
|
178
|
-
color: '#fff',
|
|
179
|
-
formatter: (p: any) => p.name,
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
]
|
|
183
|
-
: [
|
|
184
|
-
// 顶层(BG 分组):不显示任何文字和 header,只用较宽的白边与其他 BG 分隔
|
|
185
|
-
{
|
|
186
|
-
itemStyle: {
|
|
187
|
-
borderWidth: 4,
|
|
188
|
-
borderColor: '#fff',
|
|
189
|
-
gapWidth: 4,
|
|
190
|
-
},
|
|
191
|
-
upperLabel: { show: false },
|
|
192
|
-
label: { show: false },
|
|
193
|
-
},
|
|
194
|
-
// 叶子节点:显示名称
|
|
195
|
-
{
|
|
196
|
-
itemStyle: {
|
|
197
|
-
borderWidth: 1,
|
|
198
|
-
borderColor: 'rgba(255,255,255,0.5)',
|
|
199
|
-
gapWidth: 1,
|
|
200
|
-
},
|
|
201
|
-
label: {
|
|
202
|
-
show: true,
|
|
203
|
-
fontSize: 12,
|
|
204
|
-
color: '#fff',
|
|
205
|
-
formatter: (params: any) => params.name,
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
...(_s ?? {}),
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
|
|
213
|
-
...restChartProps,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// ─── Component ────────────────────────────────────────────────────────────────
|
|
218
|
-
|
|
219
|
-
export const TreemapChart: React.FC<TreemapChartProps> = ({
|
|
220
|
-
data,
|
|
221
|
-
title,
|
|
222
|
-
height = 400,
|
|
223
|
-
chartProps = {},
|
|
224
|
-
legendShow = true,
|
|
225
|
-
loading = false,
|
|
226
|
-
empty,
|
|
227
|
-
style,
|
|
228
|
-
className,
|
|
229
|
-
testId,
|
|
230
|
-
}) => {
|
|
231
|
-
const [activeGroup, setActiveGroup] = useState<string | null>(null);
|
|
232
|
-
|
|
233
|
-
const groups = useMemo(
|
|
234
|
-
() => data.filter((d) => d.children && d.children.length > 0),
|
|
235
|
-
[data],
|
|
236
|
-
);
|
|
237
|
-
const hasGroups = groups.length > 0;
|
|
238
|
-
|
|
239
|
-
const filteredData = useMemo(() => {
|
|
240
|
-
if (!hasGroups || activeGroup === null) return data;
|
|
241
|
-
return data.filter((d) => d.name === activeGroup);
|
|
242
|
-
}, [data, activeGroup, hasGroups]);
|
|
243
|
-
|
|
244
|
-
const option = useMemo(
|
|
245
|
-
() => buildTreemapOption(filteredData, chartProps),
|
|
246
|
-
[filteredData, chartProps],
|
|
247
|
-
);
|
|
248
|
-
|
|
249
|
-
const { domRef } = useECharts({ option });
|
|
250
|
-
|
|
251
|
-
const isEmpty = empty !== undefined ? empty : data.length === 0;
|
|
252
|
-
|
|
253
|
-
const titleNode = title ? (
|
|
254
|
-
typeof title === 'string' ? (
|
|
255
|
-
<div
|
|
256
|
-
style={{
|
|
257
|
-
textAlign: 'center',
|
|
258
|
-
fontSize: 13,
|
|
259
|
-
fontWeight: 'bold',
|
|
260
|
-
color: '#515151',
|
|
261
|
-
marginTop: 12,
|
|
262
|
-
marginBottom: 4,
|
|
263
|
-
}}
|
|
264
|
-
>
|
|
265
|
-
{title}
|
|
266
|
-
</div>
|
|
267
|
-
) : (
|
|
268
|
-
title
|
|
269
|
-
)
|
|
270
|
-
) : null;
|
|
271
|
-
|
|
272
|
-
return (
|
|
273
|
-
<div
|
|
274
|
-
className={className}
|
|
275
|
-
style={{
|
|
276
|
-
width: '100%',
|
|
277
|
-
...(titleNode
|
|
278
|
-
? {
|
|
279
|
-
display: 'flex',
|
|
280
|
-
flexDirection: 'column',
|
|
281
|
-
height: typeof height === 'number' ? `${height}px` : height,
|
|
282
|
-
}
|
|
283
|
-
: {}),
|
|
284
|
-
...style,
|
|
285
|
-
}}
|
|
286
|
-
data-testid={testId}
|
|
287
|
-
>
|
|
288
|
-
{titleNode}
|
|
289
|
-
<div
|
|
290
|
-
style={{
|
|
291
|
-
width: '100%',
|
|
292
|
-
...(titleNode
|
|
293
|
-
? { flex: 1, minHeight: 0 }
|
|
294
|
-
: { height: typeof height === 'number' ? `${height}px` : height }),
|
|
295
|
-
display: 'flex',
|
|
296
|
-
flexDirection: 'column',
|
|
297
|
-
}}
|
|
298
|
-
>
|
|
299
|
-
{isEmpty ? (
|
|
300
|
-
<div
|
|
301
|
-
style={{
|
|
302
|
-
flex: 1,
|
|
303
|
-
display: 'flex',
|
|
304
|
-
alignItems: 'center',
|
|
305
|
-
justifyContent: 'center',
|
|
306
|
-
}}
|
|
307
|
-
>
|
|
308
|
-
<Empty
|
|
309
|
-
description="No Data"
|
|
310
|
-
styles={{ image: { height: 45 }, description: { fontSize: 12 } }}
|
|
311
|
-
/>
|
|
312
|
-
</div>
|
|
313
|
-
) : (
|
|
314
|
-
<>
|
|
315
|
-
{/* 图表区 */}
|
|
316
|
-
<div style={{ flex: 1, minHeight: 0, position: 'relative' }}>
|
|
317
|
-
<Spin
|
|
318
|
-
spinning={loading}
|
|
319
|
-
size="large"
|
|
320
|
-
style={{ position: 'absolute', inset: 0 }}
|
|
321
|
-
/>
|
|
322
|
-
<div ref={domRef} style={{ width: '100%', height: '100%' }} />
|
|
323
|
-
</div>
|
|
324
|
-
{/* 图例 */}
|
|
325
|
-
{hasGroups && legendShow && (
|
|
326
|
-
<div
|
|
327
|
-
style={{
|
|
328
|
-
display: 'flex',
|
|
329
|
-
flexWrap: 'wrap',
|
|
330
|
-
justifyContent: 'center',
|
|
331
|
-
gap: 8,
|
|
332
|
-
padding: '8px 4px 4px',
|
|
333
|
-
flexShrink: 0,
|
|
334
|
-
}}
|
|
335
|
-
>
|
|
336
|
-
{groups.map((g, i) => {
|
|
337
|
-
const color =
|
|
338
|
-
g.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length];
|
|
339
|
-
const isActive = activeGroup === g.name;
|
|
340
|
-
const dimmed = activeGroup !== null && !isActive;
|
|
341
|
-
return (
|
|
342
|
-
<div
|
|
343
|
-
key={g.name}
|
|
344
|
-
onClick={() => setActiveGroup(isActive ? null : g.name)}
|
|
345
|
-
style={{
|
|
346
|
-
display: 'flex',
|
|
347
|
-
alignItems: 'center',
|
|
348
|
-
gap: 5,
|
|
349
|
-
cursor: 'pointer',
|
|
350
|
-
padding: '2px 8px',
|
|
351
|
-
borderRadius: 4,
|
|
352
|
-
border: `1px solid ${isActive ? color : 'transparent'}`,
|
|
353
|
-
background: isActive ? `${color}18` : 'transparent',
|
|
354
|
-
transition: 'all 0.2s',
|
|
355
|
-
fontSize: 12,
|
|
356
|
-
color: dimmed ? '#bfbfbf' : '#515151',
|
|
357
|
-
}}
|
|
358
|
-
>
|
|
359
|
-
<span
|
|
360
|
-
style={{
|
|
361
|
-
width: 10,
|
|
362
|
-
height: 10,
|
|
363
|
-
borderRadius: 2,
|
|
364
|
-
flexShrink: 0,
|
|
365
|
-
background: dimmed ? '#e0e0e0' : color,
|
|
366
|
-
transition: 'background 0.2s',
|
|
367
|
-
}}
|
|
368
|
-
/>
|
|
369
|
-
{g.name}
|
|
370
|
-
</div>
|
|
371
|
-
);
|
|
372
|
-
})}
|
|
373
|
-
</div>
|
|
374
|
-
)}
|
|
375
|
-
</>
|
|
376
|
-
)}
|
|
377
|
-
</div>
|
|
378
|
-
</div>
|
|
379
|
-
);
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
export default TreemapChart;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useImperativeHandle, forwardRef } from 'react';
|
|
2
|
-
import { Spin } from 'antd';
|
|
3
|
-
import * as echarts from 'echarts';
|
|
4
|
-
import nameMap from '@/components/canvas/map/nameMap.json';
|
|
5
|
-
import WorldGeoJson from '@/components/canvas/map/world.geo.json';
|
|
6
|
-
import { areaTop30Geo } from '@/components/canvas/map/config';
|
|
7
|
-
import { useECharts } from '@/hooks/useECharts';
|
|
8
|
-
|
|
9
|
-
echarts.registerMap('world', WorldGeoJson as any);
|
|
10
|
-
|
|
11
|
-
// ─── 标准 geo 基准配置(统一首页样式)────────────────────────────────────────
|
|
12
|
-
|
|
13
|
-
export const STANDARD_GEO_BASE = {
|
|
14
|
-
map: 'world',
|
|
15
|
-
nameMap: nameMap.world,
|
|
16
|
-
aspectScale: 1, // 必须为 1:world.geo.json 使用 Highcharts 预投影坐标系
|
|
17
|
-
zoom: 1.2,
|
|
18
|
-
roam: false,
|
|
19
|
-
select: { disabled: true },
|
|
20
|
-
itemStyle: {
|
|
21
|
-
areaColor: '#d8dae4',
|
|
22
|
-
borderColor: '#fff',
|
|
23
|
-
borderWidth: 0,
|
|
24
|
-
},
|
|
25
|
-
emphasis: {
|
|
26
|
-
disabled: false,
|
|
27
|
-
itemStyle: { areaColor: '#cacee2' },
|
|
28
|
-
label: { color: '#333' },
|
|
29
|
-
},
|
|
30
|
-
label: {
|
|
31
|
-
show: false,
|
|
32
|
-
fontSize: 10,
|
|
33
|
-
color: '#333',
|
|
34
|
-
formatter: (params: any) =>
|
|
35
|
-
areaTop30Geo.includes(params.name) ? params.name.toUpperCase() : '',
|
|
36
|
-
},
|
|
37
|
-
} as const;
|
|
38
|
-
|
|
39
|
-
// ─── 类型 ─────────────────────────────────────────────────────────────────────
|
|
40
|
-
|
|
41
|
-
export interface WorldMapHandle {
|
|
42
|
-
/** 访问底层 ECharts 实例,用于 dispatchAction / convertToPixel 等操作。 */
|
|
43
|
-
chart: echarts.ECharts | null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface WorldMapProps {
|
|
47
|
-
/**
|
|
48
|
-
* ECharts option。
|
|
49
|
-
* - `series`、`visualMap`、`tooltip` 等字段直接透传。
|
|
50
|
-
* - `geo` 会与标准基准配置**浅合并**,调用方只传需要覆盖/追加的字段
|
|
51
|
-
* (常见:`regions`、`tooltip.formatter`、`center`、`zoom`)。
|
|
52
|
-
* - 若不需要 geo(纯 `series[type=map]` 场景),不传 `geo` 即可。
|
|
53
|
-
*/
|
|
54
|
-
option: echarts.EChartsCoreOption;
|
|
55
|
-
|
|
56
|
-
loading?: boolean;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 地图容器样式,**必须通过 height 指定高度**(默认 600px)。
|
|
60
|
-
* - 固定高度:`style={{ height: 600 }}`
|
|
61
|
-
* - 响应式:`style={{ aspectRatio: "4/3", minHeight: 400 }}`
|
|
62
|
-
* - flex 填充:`style={{ flex: 1 }}`(父级需设高度)
|
|
63
|
-
*/
|
|
64
|
-
style?: React.CSSProperties;
|
|
65
|
-
|
|
66
|
-
/** ECharts 事件绑定(click、mousemove 等)。 */
|
|
67
|
-
onEvents?: Record<string, (params: any, chart: echarts.ECharts) => void>;
|
|
68
|
-
|
|
69
|
-
/** data-testid,用于 E2E 测试和 AI agent inspect。 */
|
|
70
|
-
testId: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// ─── 组件 ─────────────────────────────────────────────────────────────────────
|
|
74
|
-
|
|
75
|
-
const WorldMapInner: React.ForwardRefRenderFunction<
|
|
76
|
-
WorldMapHandle,
|
|
77
|
-
WorldMapProps
|
|
78
|
-
> = ({ option, loading = false, style, onEvents, testId }, ref) => {
|
|
79
|
-
const mergedOption = useMemo(() => {
|
|
80
|
-
const rawGeo: any = Array.isArray((option as any).geo)
|
|
81
|
-
? (option as any).geo[0]
|
|
82
|
-
: (option as any).geo;
|
|
83
|
-
|
|
84
|
-
if (rawGeo === undefined) return option;
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
...option,
|
|
88
|
-
geo: {
|
|
89
|
-
...STANDARD_GEO_BASE,
|
|
90
|
-
...rawGeo,
|
|
91
|
-
itemStyle: {
|
|
92
|
-
...STANDARD_GEO_BASE.itemStyle,
|
|
93
|
-
...rawGeo?.itemStyle,
|
|
94
|
-
},
|
|
95
|
-
emphasis: {
|
|
96
|
-
...STANDARD_GEO_BASE.emphasis,
|
|
97
|
-
...rawGeo?.emphasis,
|
|
98
|
-
itemStyle: {
|
|
99
|
-
...STANDARD_GEO_BASE.emphasis.itemStyle,
|
|
100
|
-
...rawGeo?.emphasis?.itemStyle,
|
|
101
|
-
},
|
|
102
|
-
label: {
|
|
103
|
-
...STANDARD_GEO_BASE.emphasis.label,
|
|
104
|
-
...rawGeo?.emphasis?.label,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
label: {
|
|
108
|
-
...STANDARD_GEO_BASE.label,
|
|
109
|
-
...rawGeo?.label,
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
}, [option]);
|
|
114
|
-
|
|
115
|
-
const { domRef, chartRef } = useECharts({ option: mergedOption, onEvents });
|
|
116
|
-
|
|
117
|
-
useImperativeHandle(ref, () => ({
|
|
118
|
-
get chart() {
|
|
119
|
-
return chartRef.current;
|
|
120
|
-
},
|
|
121
|
-
}));
|
|
122
|
-
|
|
123
|
-
return (
|
|
124
|
-
<Spin spinning={loading}>
|
|
125
|
-
<div
|
|
126
|
-
ref={domRef}
|
|
127
|
-
style={{ width: '100%', height: 600, ...style }}
|
|
128
|
-
data-testid={testId}
|
|
129
|
-
/>
|
|
130
|
-
</Spin>
|
|
131
|
-
);
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export const WorldMap = forwardRef(WorldMapInner);
|
|
135
|
-
export default WorldMap;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// ─── 共享 ECharts 常量 ────────────────────────────────────────────────────────
|
|
2
|
-
|
|
3
|
-
/** 通用横向滚动图例基准(BarChart / LineChart / RadarChart) */
|
|
4
|
-
export const LEGEND_BASE = {
|
|
5
|
-
type: 'scroll' as const,
|
|
6
|
-
show: true,
|
|
7
|
-
bottom: 10,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
/** PieChart 横向图例(居中对齐) */
|
|
11
|
-
export const LEGEND_HORIZONTAL = {
|
|
12
|
-
type: 'scroll' as const,
|
|
13
|
-
orient: 'horizontal' as const,
|
|
14
|
-
left: 'center',
|
|
15
|
-
bottom: 10,
|
|
16
|
-
show: true,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/** PieChart 竖向图例(右侧对齐) */
|
|
20
|
-
export const LEGEND_VERTICAL = {
|
|
21
|
-
type: 'scroll' as const,
|
|
22
|
-
orient: 'vertical' as const,
|
|
23
|
-
right: 10,
|
|
24
|
-
top: 20,
|
|
25
|
-
bottom: 20,
|
|
26
|
-
show: true,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/** 纵向柱状图 / 折线图(bar、stackBar、line、stackLine、stackArea) */
|
|
30
|
-
export const GRID_VERTICAL = {
|
|
31
|
-
left: 60,
|
|
32
|
-
right: 60,
|
|
33
|
-
bottom: 60,
|
|
34
|
-
containLabel: true,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/** 横向柱状图(direction="horizontal") */
|
|
38
|
-
export const GRID_HORIZONTAL = {
|
|
39
|
-
left: 20,
|
|
40
|
-
right: 80,
|
|
41
|
-
top: 20,
|
|
42
|
-
bottom: 60,
|
|
43
|
-
containLabel: true,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/** 双 Y 轴混合图(dualYAxis) */
|
|
47
|
-
export const GRID_DUAL_Y = {
|
|
48
|
-
left: 50,
|
|
49
|
-
right: 50,
|
|
50
|
-
top: 36,
|
|
51
|
-
bottom: 60,
|
|
52
|
-
containLabel: true,
|
|
53
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { InfoCircleFilled } from '@ant-design/icons';
|
|
2
|
-
import { Tooltip } from 'antd';
|
|
3
|
-
|
|
4
|
-
export const InfoIcon = ({ message }: { message: string }) => (
|
|
5
|
-
<Tooltip placement="right" title={message}>
|
|
6
|
-
<InfoCircleFilled style={{ color: '#d8dae4' }} />
|
|
7
|
-
</Tooltip>
|
|
8
|
-
);
|
package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/icon/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './InfoIcon';
|
package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/canvas/map/config.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Stub: map/config.ts — canvas 版,移除 continent geojson 依赖
|
|
2
|
-
export const areaTop30Geo = [
|
|
3
|
-
'Russia',
|
|
4
|
-
'Canada',
|
|
5
|
-
'US',
|
|
6
|
-
'China',
|
|
7
|
-
'Brazil',
|
|
8
|
-
'Australia',
|
|
9
|
-
'India',
|
|
10
|
-
'Argentina',
|
|
11
|
-
'Kazakhstan',
|
|
12
|
-
'Algeria',
|
|
13
|
-
'Greenland',
|
|
14
|
-
'Indonesia',
|
|
15
|
-
'Sudan',
|
|
16
|
-
'Libya',
|
|
17
|
-
'Iran',
|
|
18
|
-
'Mongolia',
|
|
19
|
-
'Peru',
|
|
20
|
-
'Chad',
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
export const threeRegionCountryMap = {
|
|
24
|
-
APAC: [] as string[],
|
|
25
|
-
EMEA: [] as string[],
|
|
26
|
-
AMER: [] as string[],
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const getAreaByCountry = (_country: string): string | undefined =>
|
|
30
|
-
undefined;
|
|
31
|
-
export const continentCountryMap: Record<string, string[]> = {};
|