@ebiz/designer-components 0.0.47 → 0.0.49
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/designer-components.css +1 -1
- package/dist/index.mjs +33336 -107224
- package/package.json +1 -4
- package/src/apiService/simpleDataService.js +43 -43
- package/src/assets/styles/charts/main.less +0 -30
- package/src/components/Button.vue +3 -6
- package/src/components/EbizApproval.vue +327 -0
- package/src/components/EbizEmployeeSelector.vue +50 -15
- package/src/components/EbizFileUpload.vue +55 -18
- package/src/components/EbizRouteBreadcrumb.vue +9 -9
- package/src/components/EbizSelect.vue +52 -62
- package/src/components/EbizTabHeader.vue +29 -41
- package/src/components/senior/EbizSDialog/index.vue +4 -0
- package/src/index.js +4 -4
- package/src/router/index.js +7 -0
- package/src/views/EbizApprovalDemo.vue +77 -0
- package/src/views/EbizSDataDemo.vue +0 -1
- package/src/views/Home.vue +2 -1
- package/src/components/EbizMindmap/README.md +0 -8
- package/src/components/EbizMindmap/components/GridNode.vue +0 -102
- package/src/components/EbizMindmap/components/node.vue +0 -92
- package/src/components/EbizMindmap/components/vueNode.vue +0 -64
- package/src/components/EbizMindmap/index.vue +0 -383
- package/src/components/charts/chart.js +0 -47
- package/src/components/charts/components/AssembleBubbleChart/BaseOption.js +0 -50
- package/src/components/charts/components/AssembleBubbleChart/chartToken.js +0 -17
- package/src/components/charts/components/AssembleBubbleChart/handleOption.js +0 -66
- package/src/components/charts/components/AssembleBubbleChart/handleRootData.js +0 -165
- package/src/components/charts/components/AssembleBubbleChart/handleSeriesData.js +0 -70
- package/src/components/charts/components/AssembleBubbleChart/index.js +0 -65
- package/src/components/charts/components/AutonaviMapChart/index.js +0 -162
- package/src/components/charts/components/BaiduMapChart/index.js +0 -148
- package/src/components/charts/components/BarChart/barChartOption.js +0 -76
- package/src/components/charts/components/BarChart/chartToken.js +0 -17
- package/src/components/charts/components/BarChart/handleOptipn.js +0 -102
- package/src/components/charts/components/BarChart/handleSeries.js +0 -716
- package/src/components/charts/components/BarChart/handleVisualMap.js +0 -48
- package/src/components/charts/components/BarChart/index.js +0 -151
- package/src/components/charts/components/BaseChart/index.js +0 -122
- package/src/components/charts/components/BoxplotChart/chartToken.js +0 -17
- package/src/components/charts/components/BoxplotChart/handleOption.js +0 -64
- package/src/components/charts/components/BoxplotChart/handleSeries.js +0 -150
- package/src/components/charts/components/BoxplotChart/index.js +0 -47
- package/src/components/charts/components/BubbleChart/chartToken.js +0 -17
- package/src/components/charts/components/BubbleChart/handleData.js +0 -33
- package/src/components/charts/components/BubbleChart/handleOptipn.js +0 -63
- package/src/components/charts/components/BubbleChart/handleSeries.js +0 -86
- package/src/components/charts/components/BubbleChart/handleTrendLine.js +0 -119
- package/src/components/charts/components/BubbleChart/handleVisualMap.js +0 -50
- package/src/components/charts/components/BubbleChart/index.js +0 -96
- package/src/components/charts/components/BulletChart/bulletChartOption.js +0 -82
- package/src/components/charts/components/BulletChart/chartToken.js +0 -17
- package/src/components/charts/components/BulletChart/handleOptipn.js +0 -74
- package/src/components/charts/components/BulletChart/handleSeries.js +0 -143
- package/src/components/charts/components/BulletChart/index.js +0 -93
- package/src/components/charts/components/CandlestickChart/BaseOption.js +0 -44
- package/src/components/charts/components/CandlestickChart/chartToken.js +0 -17
- package/src/components/charts/components/CandlestickChart/hanleOption.js +0 -130
- package/src/components/charts/components/CandlestickChart/hanleSeries.js +0 -123
- package/src/components/charts/components/CandlestickChart/index.js +0 -68
- package/src/components/charts/components/CircleProcessChart/chartToken.js +0 -17
- package/src/components/charts/components/CircleProcessChart/handleOption.js +0 -68
- package/src/components/charts/components/CircleProcessChart/handleSeries.js +0 -127
- package/src/components/charts/components/CircleProcessChart/index.js +0 -63
- package/src/components/charts/components/FlowChart/Layout.js +0 -211
- package/src/components/charts/components/FlowChart/LineBezier.js +0 -120
- package/src/components/charts/components/FlowChart/LineDirect.js +0 -42
- package/src/components/charts/components/FlowChart/LineManager.js +0 -278
- package/src/components/charts/components/FlowChart/LineMode.js +0 -44
- package/src/components/charts/components/FlowChart/LineRound.js +0 -335
- package/src/components/charts/components/FlowChart/NodeManager.js +0 -185
- package/src/components/charts/components/FlowChart/dagre.js +0 -8829
- package/src/components/charts/components/FlowChart/frameworkFn.js +0 -38
- package/src/components/charts/components/FlowChart/index.js +0 -268
- package/src/components/charts/components/FlowChart/index.less +0 -90
- package/src/components/charts/components/FlowChart/insert.js +0 -40
- package/src/components/charts/components/FlowChart/util.js +0 -43
- package/src/components/charts/components/FunnelChart/chartToken.js +0 -17
- package/src/components/charts/components/FunnelChart/handleLegend.js +0 -44
- package/src/components/charts/components/FunnelChart/handleSeries.js +0 -77
- package/src/components/charts/components/FunnelChart/index.js +0 -44
- package/src/components/charts/components/GanttChart/CoordinateSystem.js +0 -358
- package/src/components/charts/components/GanttChart/TimeLine.js +0 -379
- package/src/components/charts/components/GanttChart/constant.js +0 -71
- package/src/components/charts/components/GanttChart/index.js +0 -51
- package/src/components/charts/components/GanttChart/index.less +0 -267
- package/src/components/charts/components/GanttChart/util.js +0 -335
- package/src/components/charts/components/GaugeChart/BaseOption.js +0 -22
- package/src/components/charts/components/GaugeChart/chartToken.js +0 -17
- package/src/components/charts/components/GaugeChart/handleOptipn.js +0 -22
- package/src/components/charts/components/GaugeChart/handleSeries.js +0 -504
- package/src/components/charts/components/GaugeChart/index.js +0 -53
- package/src/components/charts/components/GraphChart/index.js +0 -34
- package/src/components/charts/components/GraphTreeChart/BaseOption.js +0 -42
- package/src/components/charts/components/GraphTreeChart/handleData.js +0 -118
- package/src/components/charts/components/GraphTreeChart/handleOption.js +0 -142
- package/src/components/charts/components/GraphTreeChart/index.js +0 -65
- package/src/components/charts/components/GraphTreeChart/mixTree.js +0 -36
- package/src/components/charts/components/GraphTreeChart/utils.js +0 -75
- package/src/components/charts/components/HeatMapChart/BaseOption.js +0 -66
- package/src/components/charts/components/HeatMapChart/chartToken.js +0 -17
- package/src/components/charts/components/HeatMapChart/handleData.js +0 -138
- package/src/components/charts/components/HeatMapChart/handleOptipn.js +0 -227
- package/src/components/charts/components/HeatMapChart/handleSeries.js +0 -82
- package/src/components/charts/components/HeatMapChart/handleVisualMap.js +0 -91
- package/src/components/charts/components/HeatMapChart/index.js +0 -70
- package/src/components/charts/components/HillChart/baseOption.js +0 -50
- package/src/components/charts/components/HillChart/chartToken.js +0 -17
- package/src/components/charts/components/HillChart/handleOption.js +0 -193
- package/src/components/charts/components/HillChart/handleSeries.js +0 -39
- package/src/components/charts/components/HillChart/index.js +0 -96
- package/src/components/charts/components/HoneycombChart/NodeManager.js +0 -172
- package/src/components/charts/components/HoneycombChart/TipManager.js +0 -75
- package/src/components/charts/components/HoneycombChart/index.js +0 -117
- package/src/components/charts/components/HoneycombChart/index.less +0 -49
- package/src/components/charts/components/JadeJueChart/BaseOption.js +0 -40
- package/src/components/charts/components/JadeJueChart/chartToken.js +0 -17
- package/src/components/charts/components/JadeJueChart/handleOption.js +0 -262
- package/src/components/charts/components/JadeJueChart/handleSeries.js +0 -246
- package/src/components/charts/components/JadeJueChart/index.js +0 -71
- package/src/components/charts/components/JadeJueChart/labelFormatter.js +0 -131
- package/src/components/charts/components/LineChart/AreaChart/bottomArea.js +0 -177
- package/src/components/charts/components/LineChart/AreaChart/chartToken.js +0 -17
- package/src/components/charts/components/LineChart/AreaChart/index.js +0 -18
- package/src/components/charts/components/LineChart/AreaChart/topArea.js +0 -139
- package/src/components/charts/components/LineChart/chartToken.js +0 -17
- package/src/components/charts/components/LineChart/handleOptipn.js +0 -145
- package/src/components/charts/components/LineChart/handlePredict.js +0 -73
- package/src/components/charts/components/LineChart/handleSeries.js +0 -266
- package/src/components/charts/components/LineChart/handleVisualMap.js +0 -138
- package/src/components/charts/components/LineChart/index.js +0 -133
- package/src/components/charts/components/LiquidfillChart/chartToken.js +0 -17
- package/src/components/charts/components/LiquidfillChart/handleSeries.js +0 -170
- package/src/components/charts/components/LiquidfillChart/index.js +0 -43
- package/src/components/charts/components/LiquidfillChart/plugSeries.js +0 -78
- package/src/components/charts/components/LiquidfillChart/plugShape.js +0 -163
- package/src/components/charts/components/LiquidfillChart/plugView.js +0 -537
- package/src/components/charts/components/MilestoneChart/Layout.js +0 -183
- package/src/components/charts/components/MilestoneChart/Node.js +0 -319
- package/src/components/charts/components/MilestoneChart/assets/next.svg +0 -7
- package/src/components/charts/components/MilestoneChart/assets/prev.svg +0 -7
- package/src/components/charts/components/MilestoneChart/assets/prompt.svg +0 -9
- package/src/components/charts/components/MilestoneChart/index.js +0 -108
- package/src/components/charts/components/MilestoneChart/index.less +0 -244
- package/src/components/charts/components/MilestoneChart/insertDom.js +0 -32
- package/src/components/charts/components/MilestoneChart/insertIcon.js +0 -24
- package/src/components/charts/components/MilestoneChart/insertSvg.js +0 -109
- package/src/components/charts/components/OrganizationChart/NodeManager.js +0 -188
- package/src/components/charts/components/OrganizationChart/RotateManager.js +0 -349
- package/src/components/charts/components/OrganizationChart/index.js +0 -124
- package/src/components/charts/components/OrganizationChart/index.less +0 -112
- package/src/components/charts/components/PieChart/chartToken.js +0 -17
- package/src/components/charts/components/PieChart/handleLabel.js +0 -94
- package/src/components/charts/components/PieChart/handleMulti.js +0 -131
- package/src/components/charts/components/PieChart/handleSeries.js +0 -236
- package/src/components/charts/components/PieChart/index.js +0 -58
- package/src/components/charts/components/PolarBarChart/chartToken.js +0 -17
- package/src/components/charts/components/PolarBarChart/handleOption.js +0 -102
- package/src/components/charts/components/PolarBarChart/handleSeries.js +0 -127
- package/src/components/charts/components/PolarBarChart/index.js +0 -62
- package/src/components/charts/components/ProcessChart/BaseOption.js +0 -296
- package/src/components/charts/components/ProcessChart/chartToken.js +0 -17
- package/src/components/charts/components/ProcessChart/handleData.js +0 -156
- package/src/components/charts/components/ProcessChart/handleOption.js +0 -212
- package/src/components/charts/components/ProcessChart/handleSeries.js +0 -369
- package/src/components/charts/components/ProcessChart/index.js +0 -76
- package/src/components/charts/components/RadarChart/BaseOption.js +0 -248
- package/src/components/charts/components/RadarChart/GradientRadar/index.js +0 -421
- package/src/components/charts/components/RadarChart/chartToken.js +0 -17
- package/src/components/charts/components/RadarChart/handleOptipn.js +0 -316
- package/src/components/charts/components/RadarChart/handleSeries.js +0 -120
- package/src/components/charts/components/RadarChart/index.js +0 -77
- package/src/components/charts/components/RegionChart/chartToken.js +0 -17
- package/src/components/charts/components/RegionChart/handleOption.js +0 -29
- package/src/components/charts/components/RegionChart/index.js +0 -49
- package/src/components/charts/components/RiverChart/Belt.js +0 -181
- package/src/components/charts/components/RiverChart/Manager.js +0 -173
- package/src/components/charts/components/RiverChart/Node.js +0 -425
- package/src/components/charts/components/RiverChart/baseOption.js +0 -51
- package/src/components/charts/components/RiverChart/index.js +0 -79
- package/src/components/charts/components/RiverChart/index.less +0 -42
- package/src/components/charts/components/RiverChart/util.js +0 -160
- package/src/components/charts/components/SankeyChart/BaseOption.js +0 -74
- package/src/components/charts/components/SankeyChart/chartToken.js +0 -17
- package/src/components/charts/components/SankeyChart/handleOption.js +0 -258
- package/src/components/charts/components/SankeyChart/index.js +0 -111
- package/src/components/charts/components/SankeyChart/tooltip.js +0 -53
- package/src/components/charts/components/ScatterChart/chartToken.js +0 -17
- package/src/components/charts/components/ScatterChart/handleMarkPoint.js +0 -74
- package/src/components/charts/components/ScatterChart/handleOptipn.js +0 -66
- package/src/components/charts/components/ScatterChart/handleSeries.js +0 -48
- package/src/components/charts/components/ScatterChart/index.js +0 -60
- package/src/components/charts/components/SnowFlakeChart/BranchManager.js +0 -324
- package/src/components/charts/components/SnowFlakeChart/CommonConstant.js +0 -111
- package/src/components/charts/components/SnowFlakeChart/LeafManager.js +0 -76
- package/src/components/charts/components/SnowFlakeChart/NodeManager.js +0 -240
- package/src/components/charts/components/SnowFlakeChart/TagManager.js +0 -80
- package/src/components/charts/components/SnowFlakeChart/assets/down.svg +0 -8
- package/src/components/charts/components/SnowFlakeChart/assets/errorBg-leaf.png +0 -0
- package/src/components/charts/components/SnowFlakeChart/assets/errorBg.png +0 -0
- package/src/components/charts/components/SnowFlakeChart/assets/image2L.svg +0 -7
- package/src/components/charts/components/SnowFlakeChart/assets/image2R.svg +0 -7
- package/src/components/charts/components/SnowFlakeChart/assets/image5L.svg +0 -7
- package/src/components/charts/components/SnowFlakeChart/assets/image5R.svg +0 -7
- package/src/components/charts/components/SnowFlakeChart/assets/normalBg-leaf.png +0 -0
- package/src/components/charts/components/SnowFlakeChart/assets/normalBg.png +0 -0
- package/src/components/charts/components/SnowFlakeChart/assets/outerBorder.svg +0 -24
- package/src/components/charts/components/SnowFlakeChart/assets/outerBorderOverAll.svg +0 -18
- package/src/components/charts/components/SnowFlakeChart/assets/up.svg +0 -8
- package/src/components/charts/components/SnowFlakeChart/assets/warningBg-leaf.png +0 -0
- package/src/components/charts/components/SnowFlakeChart/assets/warningBg.png +0 -0
- package/src/components/charts/components/SnowFlakeChart/assets/wirelessL.svg +0 -7
- package/src/components/charts/components/SnowFlakeChart/assets/wirelessR.svg +0 -7
- package/src/components/charts/components/SnowFlakeChart/defaultOption.js +0 -285
- package/src/components/charts/components/SnowFlakeChart/index.js +0 -408
- package/src/components/charts/components/SnowFlakeChart/index.less +0 -503
- package/src/components/charts/components/SnowFlakeChart/line/LineArrow.js +0 -62
- package/src/components/charts/components/SnowFlakeChart/line/LineDashed.js +0 -29
- package/src/components/charts/components/SnowFlakeChart/line/LineDotted.js +0 -29
- package/src/components/charts/components/SnowFlakeChart/line/LineStraight.js +0 -28
- package/src/components/charts/components/SnowFlakeChart/line/index.js +0 -202
- package/src/components/charts/components/SnowFlakeChart/util.js +0 -430
- package/src/components/charts/components/SunburstChart/chartToken.js +0 -17
- package/src/components/charts/components/SunburstChart/handleSeries.js +0 -48
- package/src/components/charts/components/SunburstChart/index.js +0 -41
- package/src/components/charts/components/TerraceChart/defaultGradient.js +0 -116
- package/src/components/charts/components/TerraceChart/defaultPath.js +0 -30
- package/src/components/charts/components/TerraceChart/index.js +0 -276
- package/src/components/charts/components/TerraceChart/index.less +0 -171
- package/src/components/charts/components/TerraceChart/insert.js +0 -35
- package/src/components/charts/components/TerraceChart/loading.js +0 -34
- package/src/components/charts/components/TimelineChart/chartToken.js +0 -17
- package/src/components/charts/components/TimelineChart/index.js +0 -109
- package/src/components/charts/components/TimelineChart/index.less +0 -152
- package/src/components/charts/components/TimelineChart/insertDom.js +0 -45
- package/src/components/charts/components/TimelineChart/timeline.js +0 -461
- package/src/components/charts/components/TreeChart/chartToken.js +0 -17
- package/src/components/charts/components/TreeChart/handleOptipn.js +0 -101
- package/src/components/charts/components/TreeChart/handleSeries.js +0 -148
- package/src/components/charts/components/TreeChart/index.js +0 -50
- package/src/components/charts/components/TreeMapChart/handleOptipn.js +0 -57
- package/src/components/charts/components/TreeMapChart/handleSeries.js +0 -57
- package/src/components/charts/components/TreeMapChart/handleVisualMap.js +0 -31
- package/src/components/charts/components/TreeMapChart/index.js +0 -56
- package/src/components/charts/components/WaveChart/chartToken.js +0 -17
- package/src/components/charts/components/WaveChart/index.js +0 -418
- package/src/components/charts/components/WaveChart/index.less +0 -77
- package/src/components/charts/components/WaveChart/insert.js +0 -38
- package/src/components/charts/components/WaveChart/loading.js +0 -34
- package/src/components/charts/components/WordCloudChart/BaseOption.js +0 -19
- package/src/components/charts/components/WordCloudChart/chartToken.js +0 -17
- package/src/components/charts/components/WordCloudChart/handleOptipn.js +0 -20
- package/src/components/charts/components/WordCloudChart/handleSeries.js +0 -106
- package/src/components/charts/components/WordCloudChart/index.js +0 -67
- package/src/components/charts/core.js +0 -386
- package/src/components/charts/feature/adaptive/index.js +0 -46
- package/src/components/charts/feature/adaptive/series/AssembleBubbleChart.js +0 -22
- package/src/components/charts/feature/adaptive/series/BarChart.js +0 -27
- package/src/components/charts/feature/adaptive/series/BoxplotChart.js +0 -26
- package/src/components/charts/feature/adaptive/series/BubbleChart.js +0 -26
- package/src/components/charts/feature/adaptive/series/BulletChart.js +0 -27
- package/src/components/charts/feature/adaptive/series/CircleProcessChart.js +0 -25
- package/src/components/charts/feature/adaptive/series/FunnelChart.js +0 -22
- package/src/components/charts/feature/adaptive/series/HeatMapChart.js +0 -26
- package/src/components/charts/feature/adaptive/series/JadeJueChart.js +0 -24
- package/src/components/charts/feature/adaptive/series/LineChart.js +0 -26
- package/src/components/charts/feature/adaptive/series/LiquidfillChart.js +0 -26
- package/src/components/charts/feature/adaptive/series/PieChart.js +0 -25
- package/src/components/charts/feature/adaptive/series/PolarBarChart.js +0 -22
- package/src/components/charts/feature/adaptive/series/ScatterChart.js +0 -26
- package/src/components/charts/feature/adaptive/series/SunburstChart.js +0 -25
- package/src/components/charts/feature/adaptive/utils/axis.js +0 -26
- package/src/components/charts/feature/adaptive/utils/label.js +0 -30
- package/src/components/charts/feature/adaptive/utils/legend.js +0 -30
- package/src/components/charts/feature/adaptive/utils/title.js +0 -30
- package/src/components/charts/feature/adaptive/utils/tooltip.js +0 -30
- package/src/components/charts/feature/axistip/index.js +0 -116
- package/src/components/charts/feature/card/chartToken.js +0 -17
- package/src/components/charts/feature/card/index.js +0 -225
- package/src/components/charts/feature/card/index.less +0 -166
- package/src/components/charts/feature/drag/index.js +0 -353
- package/src/components/charts/feature/drag/index.less +0 -53
- package/src/components/charts/feature/equalLabel/index.js +0 -63
- package/src/components/charts/feature/expandLegend/constants.js +0 -22
- package/src/components/charts/feature/expandLegend/index.js +0 -190
- package/src/components/charts/feature/expandLegend/index.less +0 -1044
- package/src/components/charts/feature/expandLegend/mutiSelect/constants.js +0 -40
- package/src/components/charts/feature/expandLegend/mutiSelect/index.js +0 -157
- package/src/components/charts/feature/expandLegend/mutiSelect/item.js +0 -133
- package/src/components/charts/feature/expandLegend/mutiSelect/position.js +0 -44
- package/src/components/charts/feature/expandLegend/mutiSelect/search.js +0 -79
- package/src/components/charts/feature/expandLegend/mutiSelectLegend/constants.js +0 -41
- package/src/components/charts/feature/expandLegend/mutiSelectLegend/group.js +0 -112
- package/src/components/charts/feature/expandLegend/mutiSelectLegend/index.js +0 -97
- package/src/components/charts/feature/expandLegend/mutiSelectLegend/item.js +0 -115
- package/src/components/charts/feature/expandLegend/mutiSelectLegend/more.js +0 -101
- package/src/components/charts/feature/expandLegend/mutiSelectLegend/paging.js +0 -103
- package/src/components/charts/feature/expandLegend/mutiSelectLegend/scroll.js +0 -33
- package/src/components/charts/feature/expandLegend/mutiSelectList/constants.js +0 -34
- package/src/components/charts/feature/expandLegend/mutiSelectList/index.js +0 -181
- package/src/components/charts/feature/expandLegend/mutiSelectList/statisticList.js +0 -146
- package/src/components/charts/feature/expandLegend/singleSelect/constants.js +0 -40
- package/src/components/charts/feature/expandLegend/singleSelect/index.js +0 -170
- package/src/components/charts/feature/expandLegend/singleSelect/item.js +0 -74
- package/src/components/charts/feature/expandLegend/singleSelect/position.js +0 -34
- package/src/components/charts/feature/expandLegend/singleSelect/search.js +0 -76
- package/src/components/charts/feature/expandLegend/singleSelectLegend/constants.js +0 -41
- package/src/components/charts/feature/expandLegend/singleSelectLegend/group.js +0 -116
- package/src/components/charts/feature/expandLegend/singleSelectLegend/index.js +0 -97
- package/src/components/charts/feature/expandLegend/singleSelectLegend/item.js +0 -113
- package/src/components/charts/feature/expandLegend/singleSelectLegend/more.js +0 -40
- package/src/components/charts/feature/expandLegend/singleSelectLegend/scroll.js +0 -33
- package/src/components/charts/feature/expandLegend/tips/constants.js +0 -21
- package/src/components/charts/feature/expandLegend/tips/index.js +0 -168
- package/src/components/charts/feature/fluctuation/index.js +0 -65
- package/src/components/charts/feature/linter/dialog/index.js +0 -111
- package/src/components/charts/feature/linter/index.js +0 -131
- package/src/components/charts/feature/linter/lints/charts/Bar.js +0 -46
- package/src/components/charts/feature/linter/lints/charts/Line.js +0 -31
- package/src/components/charts/feature/linter/lints/charts/Pie.js +0 -39
- package/src/components/charts/feature/linter/lints/charts/Radar.js +0 -38
- package/src/components/charts/feature/linter/lints/charts/index.js +0 -37
- package/src/components/charts/feature/linter/lints/modules/angleAxis.js +0 -47
- package/src/components/charts/feature/linter/lints/modules/color.js +0 -19
- package/src/components/charts/feature/linter/lints/modules/dataZoom.js +0 -52
- package/src/components/charts/feature/linter/lints/modules/index.js +0 -64
- package/src/components/charts/feature/linter/lints/modules/legend.js +0 -64
- package/src/components/charts/feature/linter/lints/modules/radar.js +0 -59
- package/src/components/charts/feature/linter/lints/modules/radiusAxis.js +0 -49
- package/src/components/charts/feature/linter/lints/modules/title.js +0 -44
- package/src/components/charts/feature/linter/lints/modules/tooltip.js +0 -29
- package/src/components/charts/feature/linter/lints/modules/util.js +0 -97
- package/src/components/charts/feature/linter/lints/modules/xAxis.js +0 -52
- package/src/components/charts/feature/linter/lints/modules/yAxis.js +0 -52
- package/src/components/charts/feature/mediaScreen/index.js +0 -95
- package/src/components/charts/feature/mini/miniBarChart.js +0 -58
- package/src/components/charts/feature/mini/miniCircleProcessChart.js +0 -32
- package/src/components/charts/feature/mini/miniLineChart.js +0 -58
- package/src/components/charts/feature/mini/miniProcessChart.js +0 -64
- package/src/components/charts/feature/nodeRender/angular-node.js +0 -100
- package/src/components/charts/feature/nodeRender/index.js +0 -31
- package/src/components/charts/feature/nodeRender/react-node.js +0 -83
- package/src/components/charts/feature/nodeRender/vue-node.js +0 -109
- package/src/components/charts/feature/performance/lttb.js +0 -85
- package/src/components/charts/feature/readScreen/index.js +0 -19
- package/src/components/charts/feature/token/color/bpit/dark.js +0 -67
- package/src/components/charts/feature/token/color/bpit/index.js +0 -20
- package/src/components/charts/feature/token/color/bpit/light.js +0 -66
- package/src/components/charts/feature/token/color/cloud/board-dark.js +0 -260
- package/src/components/charts/feature/token/color/cloud/board.js +0 -276
- package/src/components/charts/feature/token/color/cloud/dark.js +0 -78
- package/src/components/charts/feature/token/color/cloud/index.js +0 -20
- package/src/components/charts/feature/token/color/cloud/light.js +0 -77
- package/src/components/charts/feature/token/color/hdesign/board.js +0 -204
- package/src/components/charts/feature/token/color/hdesign/dark.js +0 -78
- package/src/components/charts/feature/token/color/hdesign/index.js +0 -20
- package/src/components/charts/feature/token/color/hdesign/light.js +0 -79
- package/src/components/charts/feature/token/color/ict/board.js +0 -190
- package/src/components/charts/feature/token/color/ict/dark.js +0 -61
- package/src/components/charts/feature/token/color/ict/index.js +0 -20
- package/src/components/charts/feature/token/color/ict/light.js +0 -62
- package/src/components/charts/feature/token/color/index.js +0 -29
- package/src/components/charts/feature/token/color/util.js +0 -42
- package/src/components/charts/feature/token/factory/chartsToken/AreaChart.js +0 -20
- package/src/components/charts/feature/token/factory/chartsToken/AssembleBubbleChart.js +0 -26
- package/src/components/charts/feature/token/factory/chartsToken/BarChart.js +0 -27
- package/src/components/charts/feature/token/factory/chartsToken/BoxplotChart.js +0 -27
- package/src/components/charts/feature/token/factory/chartsToken/BubbleChart.js +0 -22
- package/src/components/charts/feature/token/factory/chartsToken/BulletChart.js +0 -23
- package/src/components/charts/feature/token/factory/chartsToken/CandlestickChart.js +0 -20
- package/src/components/charts/feature/token/factory/chartsToken/ChartCard.js +0 -33
- package/src/components/charts/feature/token/factory/chartsToken/CircleProcessChart.js +0 -23
- package/src/components/charts/feature/token/factory/chartsToken/FunnelChart.js +0 -26
- package/src/components/charts/feature/token/factory/chartsToken/GaugeChart.js +0 -27
- package/src/components/charts/feature/token/factory/chartsToken/HeatMapChart.js +0 -21
- package/src/components/charts/feature/token/factory/chartsToken/HillChart.js +0 -21
- package/src/components/charts/feature/token/factory/chartsToken/JadeJueChart.js +0 -28
- package/src/components/charts/feature/token/factory/chartsToken/LineChart.js +0 -36
- package/src/components/charts/feature/token/factory/chartsToken/LiquidfillChart.js +0 -22
- package/src/components/charts/feature/token/factory/chartsToken/PieChart.js +0 -49
- package/src/components/charts/feature/token/factory/chartsToken/PolarBarChart.js +0 -22
- package/src/components/charts/feature/token/factory/chartsToken/ProcessChart.js +0 -40
- package/src/components/charts/feature/token/factory/chartsToken/RadarChart.js +0 -36
- package/src/components/charts/feature/token/factory/chartsToken/RegionChart.js +0 -20
- package/src/components/charts/feature/token/factory/chartsToken/SankeyChart.js +0 -22
- package/src/components/charts/feature/token/factory/chartsToken/ScatterChart.js +0 -21
- package/src/components/charts/feature/token/factory/chartsToken/SunburstChart.js +0 -22
- package/src/components/charts/feature/token/factory/chartsToken/TimelineChart.js +0 -21
- package/src/components/charts/feature/token/factory/chartsToken/TreeChart.js +0 -21
- package/src/components/charts/feature/token/factory/chartsToken/WaveChart.js +0 -23
- package/src/components/charts/feature/token/factory/chartsToken/WordCloudChart.js +0 -21
- package/src/components/charts/feature/token/factory/chartsToken/index.js +0 -79
- package/src/components/charts/feature/token/factory/getAliasToken.js +0 -41
- package/src/components/charts/feature/token/factory/getExportColors.js +0 -46
- package/src/components/charts/feature/token/factory/getGlobalToken.js +0 -25
- package/src/components/charts/feature/token/factory/getModelToken.js +0 -389
- package/src/components/charts/feature/token/factory/getSceneToken.js +0 -41
- package/src/components/charts/feature/token/factory/globalToken/border.js +0 -21
- package/src/components/charts/feature/token/factory/globalToken/borderRadius.js +0 -22
- package/src/components/charts/feature/token/factory/globalToken/font.js +0 -26
- package/src/components/charts/feature/token/factory/globalToken/index.js +0 -28
- package/src/components/charts/feature/token/factory/globalToken/lineType.js +0 -19
- package/src/components/charts/feature/token/factory/globalToken/size.js +0 -22
- package/src/components/charts/feature/token/factory/globalToken/space.js +0 -25
- package/src/components/charts/feature/token/factory/index.js +0 -39
- package/src/components/charts/feature/token/factory/mergeToken.js +0 -72
- package/src/components/charts/feature/token/index.js +0 -176
- package/src/components/charts/feature/token/readme.md +0 -11
- package/src/components/charts/feature/token/theme/bpit/index.js +0 -19
- package/src/components/charts/feature/token/theme/cloud/getAliasToken.js +0 -247
- package/src/components/charts/feature/token/theme/cloud/getSceneToken.js +0 -74
- package/src/components/charts/feature/token/theme/cloud/index.js +0 -19
- package/src/components/charts/feature/token/theme/hdesign/getAliasToken.js +0 -249
- package/src/components/charts/feature/token/theme/hdesign/getSceneToken.js +0 -75
- package/src/components/charts/feature/token/theme/hdesign/index.js +0 -19
- package/src/components/charts/feature/token/theme/ict/getAliasToken.js +0 -249
- package/src/components/charts/feature/token/theme/ict/getSceneToken.js +0 -72
- package/src/components/charts/feature/token/theme/ict/index.js +0 -19
- package/src/components/charts/feature/wcag/index.js +0 -335
- package/src/components/charts/feature/xss/index.js +0 -52
- package/src/components/charts/framework/charts/CircleArcChart/index.js +0 -142
- package/src/components/charts/framework/charts/CircleChart/index.js +0 -140
- package/src/components/charts/framework/charts/CustomizeChart/index.js +0 -166
- package/src/components/charts/framework/charts/ForceDirectedChart/index.js +0 -141
- package/src/components/charts/framework/charts/ForceDirectedChart/initDom.js +0 -20
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/Node.js +0 -148
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/center.js +0 -71
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/collide.js +0 -151
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/constant.js +0 -17
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/dispatch.js +0 -95
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/index.js +0 -19
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/jiggle.js +0 -16
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/lcg.js +0 -23
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/link.js +0 -128
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/manyBody.js +0 -127
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/quadtree.js +0 -393
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/radial.js +0 -68
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/simulation.js +0 -171
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/timer.js +0 -121
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/x.js +0 -52
- package/src/components/charts/framework/charts/ForceDirectedChart/libs/y.js +0 -52
- package/src/components/charts/framework/charts/GridChart/index.js +0 -174
- package/src/components/charts/framework/charts/LinearArcChart/index.js +0 -143
- package/src/components/charts/framework/charts/MindmapChart/index.js +0 -166
- package/src/components/charts/framework/charts/MindmapChart/index.less +0 -85
- package/src/components/charts/framework/core/Base.js +0 -53
- package/src/components/charts/framework/core/Relation.js +0 -78
- package/src/components/charts/framework/module/animation/Animate.js +0 -434
- package/src/components/charts/framework/module/animation/Animation.js +0 -76
- package/src/components/charts/framework/module/animation/AnimationGroup.js +0 -137
- package/src/components/charts/framework/module/animation/Easing.js +0 -225
- package/src/components/charts/framework/module/animation/Interpolation.js +0 -88
- package/src/components/charts/framework/module/animation/index.js +0 -20
- package/src/components/charts/framework/module/arrow/Manager.js +0 -133
- package/src/components/charts/framework/module/arrow/index.js +0 -96
- package/src/components/charts/framework/module/canvas/grid.js +0 -288
- package/src/components/charts/framework/module/canvas/index.js +0 -434
- package/src/components/charts/framework/module/canvas/index.less +0 -102
- package/src/components/charts/framework/module/canvas/initDom.js +0 -66
- package/src/components/charts/framework/module/canvas/tool.js +0 -62
- package/src/components/charts/framework/module/connector/Manager.js +0 -103
- package/src/components/charts/framework/module/connector/index.js +0 -99
- package/src/components/charts/framework/module/connector/index.less +0 -36
- package/src/components/charts/framework/module/connector/type/dot.js +0 -21
- package/src/components/charts/framework/module/connector/type/expand.js +0 -211
- package/src/components/charts/framework/module/contextmenu/index.js +0 -149
- package/src/components/charts/framework/module/contextmenu/index.less +0 -40
- package/src/components/charts/framework/module/data/Manager.js +0 -56
- package/src/components/charts/framework/module/data/index.js +0 -0
- package/src/components/charts/framework/module/legend/Item.js +0 -218
- package/src/components/charts/framework/module/legend/constants.js +0 -14
- package/src/components/charts/framework/module/legend/getSymbol.js +0 -86
- package/src/components/charts/framework/module/legend/index.js +0 -119
- package/src/components/charts/framework/module/legend/util.js +0 -81
- package/src/components/charts/framework/module/line/Animation.js +0 -125
- package/src/components/charts/framework/module/line/Manager.js +0 -299
- package/src/components/charts/framework/module/line/Tag.js +0 -61
- package/src/components/charts/framework/module/line/bufferRender.js +0 -74
- package/src/components/charts/framework/module/line/cross/pathPoints.js +0 -233
- package/src/components/charts/framework/module/line/cross/vectorUtil.js +0 -67
- package/src/components/charts/framework/module/line/customize.js +0 -29
- package/src/components/charts/framework/module/line/index.js +0 -260
- package/src/components/charts/framework/module/line/index.less +0 -24
- package/src/components/charts/framework/module/line/type/Bezier.js +0 -90
- package/src/components/charts/framework/module/line/type/Circle.js +0 -38
- package/src/components/charts/framework/module/line/type/Direct.js +0 -23
- package/src/components/charts/framework/module/line/type/Ellipse.js +0 -88
- package/src/components/charts/framework/module/line/type/Round.js +0 -245
- package/src/components/charts/framework/module/lineLayout/CircleShape/calculate.js +0 -71
- package/src/components/charts/framework/module/lineLayout/CircleShape/index.js +0 -32
- package/src/components/charts/framework/module/lineLayout/CircleShape/init.js +0 -34
- package/src/components/charts/framework/module/lineLayout/RectShape/calculate.js +0 -174
- package/src/components/charts/framework/module/lineLayout/RectShape/index.js +0 -43
- package/src/components/charts/framework/module/lineLayout/RectShape/init.js +0 -79
- package/src/components/charts/framework/module/lineLayout/RectShape/sharing.js +0 -57
- package/src/components/charts/framework/module/lineLayout/index.js +0 -30
- package/src/components/charts/framework/module/node/Manager.js +0 -190
- package/src/components/charts/framework/module/node/bufferRender.js +0 -73
- package/src/components/charts/framework/module/node/convertData/index.js +0 -24
- package/src/components/charts/framework/module/node/convertData/returnSelf.js +0 -16
- package/src/components/charts/framework/module/node/convertData/transform.js +0 -24
- package/src/components/charts/framework/module/node/convertData/treeToLink.js +0 -36
- package/src/components/charts/framework/module/node/index.js +0 -187
- package/src/components/charts/framework/module/nodeLayout/circle/excute.js +0 -270
- package/src/components/charts/framework/module/nodeLayout/circle/index.js +0 -24
- package/src/components/charts/framework/module/nodeLayout/customize/index.js +0 -16
- package/src/components/charts/framework/module/nodeLayout/defaults/excute.js +0 -27
- package/src/components/charts/framework/module/nodeLayout/defaults/index.js +0 -20
- package/src/components/charts/framework/module/nodeLayout/grid/excute.js +0 -392
- package/src/components/charts/framework/module/nodeLayout/grid/index.js +0 -20
- package/src/components/charts/framework/module/nodeLayout/index.js +0 -27
- package/src/components/charts/framework/module/nodeLayout/linearArc/index.js +0 -34
- package/src/components/charts/framework/module/nodeLayout/nonLayeredTidyTree/NodeBox.js +0 -165
- package/src/components/charts/framework/module/nodeLayout/nonLayeredTidyTree/algorithm.js +0 -261
- package/src/components/charts/framework/module/nodeLayout/nonLayeredTidyTree/index.js +0 -278
- package/src/components/charts/framework/module/readme.js +0 -127
- package/src/components/charts/index.js +0 -65
- package/src/components/charts/index.less +0 -29
- package/src/components/charts/option/PolarSys/index.js +0 -43
- package/src/components/charts/option/RectSys/index.js +0 -58
- package/src/components/charts/option/base/index.js +0 -25
- package/src/components/charts/option/config/angleAxis/base.js +0 -56
- package/src/components/charts/option/config/angleAxis/index.js +0 -43
- package/src/components/charts/option/config/animation/index.js +0 -64
- package/src/components/charts/option/config/datazoom/base.js +0 -123
- package/src/components/charts/option/config/datazoom/index.js +0 -61
- package/src/components/charts/option/config/grid/base.js +0 -22
- package/src/components/charts/option/config/grid/index.js +0 -32
- package/src/components/charts/option/config/legend/base.js +0 -80
- package/src/components/charts/option/config/legend/icon.js +0 -21
- package/src/components/charts/option/config/legend/index.js +0 -63
- package/src/components/charts/option/config/legend/itemStyle.js +0 -17
- package/src/components/charts/option/config/legend/ldata.js +0 -29
- package/src/components/charts/option/config/legend/pageIcon.js +0 -54
- package/src/components/charts/option/config/legend/position.js +0 -19
- package/src/components/charts/option/config/legend/size.js +0 -17
- package/src/components/charts/option/config/legend/textStyle.js +0 -16
- package/src/components/charts/option/config/mark/index.js +0 -74
- package/src/components/charts/option/config/polar/base.js +0 -30
- package/src/components/charts/option/config/polar/index.js +0 -36
- package/src/components/charts/option/config/polarTitle/base.js +0 -40
- package/src/components/charts/option/config/polarTitle/index.js +0 -52
- package/src/components/charts/option/config/polarTitle/subtextStyle.js +0 -21
- package/src/components/charts/option/config/polarTitle/textStyle.js +0 -22
- package/src/components/charts/option/config/radiusAxis/base.js +0 -55
- package/src/components/charts/option/config/radiusAxis/index.js +0 -41
- package/src/components/charts/option/config/rectTitle/base.js +0 -31
- package/src/components/charts/option/config/rectTitle/index.js +0 -53
- package/src/components/charts/option/config/toolbox/base.js +0 -42
- package/src/components/charts/option/config/toolbox/index.js +0 -12
- package/src/components/charts/option/config/tooltip/axisPointer.js +0 -31
- package/src/components/charts/option/config/tooltip/base.js +0 -62
- package/src/components/charts/option/config/tooltip/formatter.js +0 -64
- package/src/components/charts/option/config/tooltip/index.js +0 -41
- package/src/components/charts/option/config/visualMap/index.js +0 -91
- package/src/components/charts/option/config/xAxis/axisLabel.js +0 -35
- package/src/components/charts/option/config/xAxis/axisLine.js +0 -29
- package/src/components/charts/option/config/xAxis/axisMargin.js +0 -31
- package/src/components/charts/option/config/xAxis/base.js +0 -66
- package/src/components/charts/option/config/xAxis/boundaryGap.js +0 -17
- package/src/components/charts/option/config/xAxis/index.js +0 -52
- package/src/components/charts/option/config/xAxis/name.js +0 -18
- package/src/components/charts/option/config/xAxis/xdata.js +0 -23
- package/src/components/charts/option/config/xAxis/xkey.js +0 -21
- package/src/components/charts/option/config/yAxis/axisOptimization.js +0 -32
- package/src/components/charts/option/config/yAxis/base.js +0 -59
- package/src/components/charts/option/config/yAxis/index.js +0 -68
- package/src/components/charts/option/config/yAxis/ydata.js +0 -28
- package/src/components/charts/option/init/index.js +0 -204
- package/src/components/charts/register.js +0 -178
- package/src/components/charts/theme.js +0 -62
- package/src/components/charts/util/Sequence.js +0 -21
- package/src/components/charts/util/centerDom.js +0 -92
- package/src/components/charts/util/cloneDeep.js +0 -29
- package/src/components/charts/util/color.js +0 -193
- package/src/components/charts/util/constants.js +0 -125
- package/src/components/charts/util/convert.js +0 -49
- package/src/components/charts/util/debounce.js +0 -24
- package/src/components/charts/util/defendXSS.js +0 -81
- package/src/components/charts/util/dom.js +0 -90
- package/src/components/charts/util/equal.js +0 -62
- package/src/components/charts/util/event.js +0 -25
- package/src/components/charts/util/hashMap.js +0 -111
- package/src/components/charts/util/init/insert.js +0 -165
- package/src/components/charts/util/math.js +0 -183
- package/src/components/charts/util/merge.js +0 -78
- package/src/components/charts/util/paint.js +0 -98
- package/src/components/charts/util/sort/max.js +0 -64
- package/src/components/charts/util/sort/min.js +0 -64
- package/src/components/charts/util/throttle.js +0 -34
- package/src/components/charts/util/tips.js +0 -25
- package/src/components/charts/util/type.js +0 -46
@@ -1,103 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2024 - present OpenTiny HUICharts Authors.
|
3
|
-
* Copyright (c) 2024 - present Huawei Cloud Computing Technologies Co., Ltd.
|
4
|
-
*
|
5
|
-
* Use of this source code is governed by an MIT-style license.
|
6
|
-
*
|
7
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
8
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
9
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
import Connector from './index';
|
13
|
-
|
14
|
-
class ConnectorManager{
|
15
|
-
constructor(chartInstance, lineData, option){
|
16
|
-
// 所有数据
|
17
|
-
this.data = {};
|
18
|
-
// 所有实例
|
19
|
-
this.instances = {};
|
20
|
-
// 连接点所有数据
|
21
|
-
lineData.forEach(line => {
|
22
|
-
let {startConnector,endConnector} = line;
|
23
|
-
this.data[startConnector.id] = startConnector;
|
24
|
-
this.data[endConnector.id] = endConnector;
|
25
|
-
});
|
26
|
-
this.createInstance(option,chartInstance,this.data);
|
27
|
-
}
|
28
|
-
|
29
|
-
//创建连接点实例对象
|
30
|
-
createInstance(option, chartInstance,data) {
|
31
|
-
let showConnector = option?.connector?.show || false;
|
32
|
-
Object.keys(data).forEach(key => {
|
33
|
-
let item = this.data[key];
|
34
|
-
if(showConnector) {
|
35
|
-
this.instances[item.id] = new Connector(item, option, chartInstance,data);
|
36
|
-
}
|
37
|
-
})
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
// exist(connector){
|
42
|
-
// return connector.index > 0;
|
43
|
-
// }
|
44
|
-
|
45
|
-
getData(){
|
46
|
-
return this.data;
|
47
|
-
}
|
48
|
-
|
49
|
-
getInstances(){
|
50
|
-
return this.instances;
|
51
|
-
}
|
52
|
-
|
53
|
-
reCreate(chartInstance, lineData, option) {
|
54
|
-
Object.keys(this.instances).forEach(key => {
|
55
|
-
let item = this.instances[key];
|
56
|
-
item.uninstall(key);
|
57
|
-
})
|
58
|
-
//连接点所有数据
|
59
|
-
lineData.forEach(line => {
|
60
|
-
let {startConnector,endConnector} = line;
|
61
|
-
this.data[startConnector.id] = startConnector;
|
62
|
-
this.data[endConnector.id] = endConnector;
|
63
|
-
});
|
64
|
-
this.createInstance(option,chartInstance,this.data);
|
65
|
-
}
|
66
|
-
|
67
|
-
refresh(chartInstance, lineData, option){
|
68
|
-
let showConnector = option?.connector?.show || false;
|
69
|
-
if(showConnector) {
|
70
|
-
// 旧连接点数据
|
71
|
-
let oldData = this.data;
|
72
|
-
// 新连接点数据
|
73
|
-
let newData = [];
|
74
|
-
lineData.forEach(line => {
|
75
|
-
let {startConnector,endConnector} = line;
|
76
|
-
newData[startConnector.id] = startConnector;
|
77
|
-
newData[endConnector.id] = endConnector;
|
78
|
-
});
|
79
|
-
// 更新连接点
|
80
|
-
Object.keys(newData).forEach(key => {
|
81
|
-
// 新增的连接点处理
|
82
|
-
if(!oldData[key]) {
|
83
|
-
this.createInstance(option,chartInstance,newData[key]);
|
84
|
-
}
|
85
|
-
// 对连接点进行更新处理
|
86
|
-
this.instances[key] && this.instances[key].update(key,newData[key],option);
|
87
|
-
|
88
|
-
})
|
89
|
-
// 删除的连接点处理
|
90
|
-
Object.keys(this.data).forEach(key => {
|
91
|
-
if(!newData[key]) {
|
92
|
-
this.instances[key] && this.instances[key].uninstall(key,this.instances);
|
93
|
-
}
|
94
|
-
})
|
95
|
-
}
|
96
|
-
}
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}
|
102
|
-
|
103
|
-
export default ConnectorManager;
|
@@ -1,99 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2024 - present OpenTiny HUICharts Authors.
|
3
|
-
* Copyright (c) 2024 - present Huawei Cloud Computing Technologies Co., Ltd.
|
4
|
-
*
|
5
|
-
* Use of this source code is governed by an MIT-style license.
|
6
|
-
*
|
7
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
8
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
9
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
import dot from './type/dot';
|
13
|
-
import expand from './type/expand';
|
14
|
-
|
15
|
-
const DOT = 'dot';// 圆点样式
|
16
|
-
const EXPAND= 'expand';// 展开样式
|
17
|
-
|
18
|
-
const CONNECTOR = {
|
19
|
-
[DOT]: dot,
|
20
|
-
[EXPAND]: expand,
|
21
|
-
};
|
22
|
-
|
23
|
-
class Connector{
|
24
|
-
constructor(data, option, chartInstance){
|
25
|
-
// 连接点数据
|
26
|
-
this.data = data;
|
27
|
-
// 绘画连接点
|
28
|
-
this.render(option, chartInstance);
|
29
|
-
this.chartInstance = chartInstance;
|
30
|
-
}
|
31
|
-
|
32
|
-
// 绘画节点
|
33
|
-
render(option,chartInstance) {
|
34
|
-
const data = this.data;
|
35
|
-
const nodeDom = document.getElementById(data.nodeId);
|
36
|
-
const render = option.connector?.render;
|
37
|
-
let connectorType = Object.assign({type: 'dot'},option.connector);
|
38
|
-
let connectorStyle = connectorType.style;
|
39
|
-
let connectorDom;
|
40
|
-
let dom = document.createElement('div');
|
41
|
-
dom.id = data.id;
|
42
|
-
dom.setAttribute('class', 'connector-con');
|
43
|
-
dom.setAttribute('style', `left: ${data.x}px; top: ${data.y}px;`)
|
44
|
-
if(render && render(data)) {
|
45
|
-
let parser = new DOMParser();
|
46
|
-
let doc = parser.parseFromString(render(data), "text/html");
|
47
|
-
connectorDom = doc.body.firstChild;
|
48
|
-
} else {
|
49
|
-
let connectorIns = new CONNECTOR[connectorType.type]();
|
50
|
-
if(option.layout) {
|
51
|
-
connectorDom = connectorIns.render(data, chartInstance);
|
52
|
-
}
|
53
|
-
}
|
54
|
-
connectorStyle && connectorDom && Object.keys(connectorStyle).forEach(item => {
|
55
|
-
connectorDom.style[item] = connectorStyle[item]
|
56
|
-
})
|
57
|
-
if(connectorDom) {
|
58
|
-
dom.appendChild(connectorDom);
|
59
|
-
}
|
60
|
-
nodeDom && nodeDom.appendChild(dom);
|
61
|
-
// 绑定事件
|
62
|
-
this.clickEvent(dom,data,option);
|
63
|
-
}
|
64
|
-
|
65
|
-
// 绑定click事件
|
66
|
-
clickEvent(dom,data,option) {
|
67
|
-
let onClick = option.connector?.onClick;
|
68
|
-
dom.addEventListener("click", function() {
|
69
|
-
onClick && onClick(data);
|
70
|
-
})
|
71
|
-
}
|
72
|
-
|
73
|
-
// 卸载节点
|
74
|
-
uninstall(id,instances){
|
75
|
-
let element = document.getElementById(id);
|
76
|
-
element && element.remove();
|
77
|
-
instances[id] && delete instances[id];
|
78
|
-
this.Alldata[id] && delete this.Alldata[id];
|
79
|
-
}
|
80
|
-
|
81
|
-
// 更新节点信息
|
82
|
-
update(id,data,option){
|
83
|
-
let dom = document.getElementById(id);
|
84
|
-
if(dom) {
|
85
|
-
dom.setAttribute('style', `left: ${data.x}px; top: ${data.y}px;`);
|
86
|
-
let connectorStyle = option?.connector?.style;
|
87
|
-
connectorStyle && Object.keys(connectorStyle).forEach(item => {
|
88
|
-
dom.style[item] = connectorStyle[item]
|
89
|
-
})
|
90
|
-
}
|
91
|
-
}
|
92
|
-
|
93
|
-
|
94
|
-
}
|
95
|
-
|
96
|
-
|
97
|
-
export default Connector;
|
98
|
-
|
99
|
-
|
@@ -1,36 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2024 - present OpenTiny HUICharts Authors.
|
3
|
-
* Copyright (c) 2024 - present Huawei Cloud Computing Technologies Co., Ltd.
|
4
|
-
*
|
5
|
-
* Use of this source code is governed by an MIT-style license.
|
6
|
-
*
|
7
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
8
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
9
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
.connector-con{
|
13
|
-
position: absolute;
|
14
|
-
display: flex;
|
15
|
-
justify-content: center;
|
16
|
-
align-items: center;
|
17
|
-
transform: translate(-50%, -50%);
|
18
|
-
.connector-dot {
|
19
|
-
width: 6px;
|
20
|
-
height: 6px;
|
21
|
-
position: absolute;
|
22
|
-
border: 1px solid #d9d9d9;
|
23
|
-
background: #fff;
|
24
|
-
border-radius: 50%
|
25
|
-
}
|
26
|
-
.connector-expand {
|
27
|
-
width: 16px;
|
28
|
-
height: 16px;
|
29
|
-
border-radius: 50%;
|
30
|
-
background: #fff;
|
31
|
-
box-shadow: 1px 1px 5px rgba(0,0,0,0.25);
|
32
|
-
z-index: 10;
|
33
|
-
text-align: center;
|
34
|
-
line-height: 16px;
|
35
|
-
}
|
36
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2024 - present OpenTiny HUICharts Authors.
|
3
|
-
* Copyright (c) 2024 - present Huawei Cloud Computing Technologies Co., Ltd.
|
4
|
-
*
|
5
|
-
* Use of this source code is governed by an MIT-style license.
|
6
|
-
*
|
7
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
8
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
9
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
// 渲染空心圆点样式
|
13
|
-
export default class Dot {
|
14
|
-
constructor() {}
|
15
|
-
|
16
|
-
render() {
|
17
|
-
let dom = document.createElement('div');
|
18
|
-
dom.setAttribute('class', `connector-dot`);
|
19
|
-
return dom;
|
20
|
-
}
|
21
|
-
}
|
@@ -1,211 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2024 - present OpenTiny HUICharts Authors.
|
3
|
-
* Copyright (c) 2024 - present Huawei Cloud Computing Technologies Co., Ltd.
|
4
|
-
*
|
5
|
-
* Use of this source code is governed by an MIT-style license.
|
6
|
-
*
|
7
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
8
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
9
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
import { AnimationGroup } from '../../animation/index';
|
13
|
-
|
14
|
-
function getIcon(isOpen){
|
15
|
-
const iconKey = isOpen ? 'open' : 'close';
|
16
|
-
const Icon = {
|
17
|
-
open: 'M20,11.25 C20.4142136,11.25 20.75,11.5857864 20.75,12 C20.75,12.3796958 20.4678461,12.693491 20.1017706,12.7431534 L20,12.75 L4,12.75 C3.58578644,12.75 3.25,12.4142136 3.25,12 C3.25,11.6203042 3.53215388,11.306509 3.89822944,11.2568466 L4,11.25 L20,11.25 Z',
|
18
|
-
close: 'M12,3.25 C12.3796958,3.25 12.693491,3.53215388 12.7431534,3.89822944 L12.75,4 L12.75,11.25 L20,11.25 C20.4142136,11.25 20.75,11.5857864 20.75,12 C20.75,12.3796958 20.4678461,12.693491 20.1017706,12.7431534 L20,12.75 L12.75,12.75 L12.75,20 C12.75,20.4142136 12.4142136,20.75 12,20.75 C11.6203042,20.75 11.306509,20.4678461 11.2568466,20.1017706 L11.25,20 L11.25,12.75 L4,12.75 C3.58578644,12.75 3.25,12.4142136 3.25,12 C3.25,11.6203042 3.53215388,11.306509 3.89822944,11.2568466 L4,11.25 L11.25,11.25 L11.25,4 C11.25,3.58578644 11.5857864,3.25 12,3.25 Z',
|
19
|
-
}
|
20
|
-
const expandIcon = `
|
21
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" viewBox="0 0 24 24" version="1.1">
|
22
|
-
<g stroke-width="1" fill="none" fill-rule="evenodd">
|
23
|
-
<g>
|
24
|
-
<rect fill="#191919" opacity="0" x="0" y="0" width="16" height="16"></rect>
|
25
|
-
<path d="${Icon[iconKey]}" id="形状结合" fill="#191919"></path>
|
26
|
-
</g>
|
27
|
-
</g>
|
28
|
-
</svg>`;
|
29
|
-
return expandIcon;
|
30
|
-
}
|
31
|
-
|
32
|
-
export default class Expand {
|
33
|
-
// connector数据
|
34
|
-
data;
|
35
|
-
// 是否展开
|
36
|
-
isOpen= true;
|
37
|
-
// 图表实例
|
38
|
-
chartInstance;
|
39
|
-
|
40
|
-
constructor(data, chartInstance) {}
|
41
|
-
|
42
|
-
render(data, chartInstance) {
|
43
|
-
this.data = data;
|
44
|
-
this.chartInstance = chartInstance;
|
45
|
-
let canExpand = this.hasChildren(chartInstance.nodeManager.getData().edges, data.nodeId);
|
46
|
-
if (data.port === 'start' && canExpand) {
|
47
|
-
this.dom = document.createElement('div');
|
48
|
-
this.dom.setAttribute('class', `connector-expand`);
|
49
|
-
this.dom.innerHTML = getIcon(this.isOpen)
|
50
|
-
this.dom.addEventListener("click", ()=>{
|
51
|
-
this.toggleIcon();
|
52
|
-
this.setAnimation();
|
53
|
-
})
|
54
|
-
}
|
55
|
-
return this.dom;
|
56
|
-
}
|
57
|
-
|
58
|
-
// 切换图标
|
59
|
-
toggleIcon() {
|
60
|
-
this.isOpen = !this.isOpen;
|
61
|
-
this.dom.innerHTML = getIcon(this.isOpen);
|
62
|
-
}
|
63
|
-
|
64
|
-
// 执行展开收起动画
|
65
|
-
setAnimation() {
|
66
|
-
let { lineManager, nodeManager } = this.chartInstance;
|
67
|
-
let nodesData = nodeManager.getData();
|
68
|
-
let edges = nodesData.edges;
|
69
|
-
let startNode = nodeManager.getNodeData(this.data.nodeId);
|
70
|
-
let animateNodes = [];
|
71
|
-
this.findAnimateNodes(this.data.id, edges, animateNodes);
|
72
|
-
const group = new AnimationGroup();
|
73
|
-
|
74
|
-
let updateStartConnector = (animateLine,params,isOpen) => {
|
75
|
-
for (const lineId in edges) {
|
76
|
-
const line = edges[lineId];
|
77
|
-
if (line.start === animateLine.end) {
|
78
|
-
line.startConnector.absolute.x = (!isOpen ? animateLine.startConnector.x : line.startConnector.x) + params.left;
|
79
|
-
line.startConnector.absolute.y = (!isOpen ? animateLine.startConnector.y : line.startConnector.y) + params.top;
|
80
|
-
}
|
81
|
-
}
|
82
|
-
};
|
83
|
-
for (let index = 0; index < animateNodes.length; index++) {
|
84
|
-
const id = animateNodes[index];
|
85
|
-
// 需要位移的节点
|
86
|
-
let endNode = nodeManager.getNodeData(id);
|
87
|
-
let endNodeDom = nodeManager.getDom(id);
|
88
|
-
// 以该节点为end的连线
|
89
|
-
let endLine = edges.filter(obj => obj.end === id)[0];
|
90
|
-
let nodeStart = {
|
91
|
-
left: this.isOpen ? startNode.x : endNode.x,
|
92
|
-
top: this.isOpen ? startNode.y : endNode.y,
|
93
|
-
opacity: this.isOpen || endNode.fold ? 0 : 1
|
94
|
-
}
|
95
|
-
// 记录该次折叠信息
|
96
|
-
this.collapseRecord(startNode, endNode, this.data);
|
97
|
-
// 如果折叠状态不存在,初次操作时为折叠---用于后续设置 透明度 和 样式 ‘pointer-events’
|
98
|
-
if (endNode.fold == undefined) endNode.fold = true;
|
99
|
-
// actionsId 记录初次操作折叠的节点id
|
100
|
-
// 如果操作id与actionsId相同,且isOpen为true,则该节点已展开至记录的起始位置;删除节点状态 fold和actionsId
|
101
|
-
if (this.isOpen && endNode.actionsId == this.data.nodeId) {
|
102
|
-
delete endNode.fold;
|
103
|
-
delete endNode.actionsId;
|
104
|
-
}else if (!endNode.actionsId) {
|
105
|
-
endNode.actionsId = this.data.nodeId;
|
106
|
-
}
|
107
|
-
// 根据isOpen使用折叠信息记录的起始位置
|
108
|
-
let nodeEnd = {
|
109
|
-
left: this.isOpen ? endNode.actions[this.data.nodeId].start.x : endNode.actions[this.data.nodeId].end.x,
|
110
|
-
top: this.isOpen ? endNode.actions[this.data.nodeId].start.y : endNode.actions[this.data.nodeId].end.y,
|
111
|
-
opacity: this.isOpen && !endNode.actions[this.data.nodeId].fold && !endNode.fold ? 1 : 0
|
112
|
-
}
|
113
|
-
group.add(endNodeDom, {
|
114
|
-
start: nodeStart,
|
115
|
-
end: nodeEnd,
|
116
|
-
duration: lineManager.RE_CREATE_TIME,
|
117
|
-
onAfterUpdate: (params, elapsed, element)=> {
|
118
|
-
let animateLine = Object.assign({},endLine)
|
119
|
-
animateLine.endConnector.absolute.x = animateLine.endConnector.x + params.left;
|
120
|
-
animateLine.endConnector.absolute.y = animateLine.endConnector.y + params.top;
|
121
|
-
updateStartConnector(animateLine, params, this.isOpen);
|
122
|
-
lineManager.update(animateLine);
|
123
|
-
},
|
124
|
-
onFinish: () => {
|
125
|
-
endNode.x = nodeEnd.left;
|
126
|
-
endNode.y = nodeEnd.top;
|
127
|
-
!this.isOpen && lineManager.hide(endLine);
|
128
|
-
if (endNodeDom) endNodeDom.style['pointer-events'] = this.isOpen ? 'auto' : 'none';
|
129
|
-
if (this.isOpen && !endNode.actions[this.data.nodeId]?.fold && endNode.fold && endNodeDom) endNodeDom.style['pointer-events'] = 'none';
|
130
|
-
//折叠完成,删除该次折叠信息
|
131
|
-
if (this.isOpen) delete endNode.actions[this.data.nodeId];
|
132
|
-
}
|
133
|
-
});
|
134
|
-
}
|
135
|
-
group.start();
|
136
|
-
}
|
137
|
-
|
138
|
-
// 查找所有需要展开收起的节点的id集合
|
139
|
-
findAnimateNodes(id, edges, animateNodes, endId) {
|
140
|
-
edges.forEach(item => {
|
141
|
-
let splitID = item.id.split("-to-");
|
142
|
-
if (item.start == endId || splitID[0] == id) {
|
143
|
-
animateNodes.push(item.end);
|
144
|
-
this.findAnimateNodes(splitID[1], edges, animateNodes, item.end);
|
145
|
-
}
|
146
|
-
});
|
147
|
-
}
|
148
|
-
|
149
|
-
//递归查找子节点
|
150
|
-
childId(id, edgeData, childIdArr){
|
151
|
-
edgeData.forEach(item => {
|
152
|
-
if(item.start == id) {
|
153
|
-
childIdArr.push(item.end);
|
154
|
-
this.childId(item.end, edgeData, childIdArr);
|
155
|
-
}
|
156
|
-
})
|
157
|
-
}
|
158
|
-
|
159
|
-
// 查询节点是否存在子节点
|
160
|
-
hasChildren(edgeData, id) {
|
161
|
-
let childIdArr = [];
|
162
|
-
// 获取所有节点id下面的子节点,放到childIdArr
|
163
|
-
this.childId(id, edgeData, childIdArr);
|
164
|
-
// 去除相同的节点
|
165
|
-
childIdArr = [...new Set(childIdArr)];
|
166
|
-
if(childIdArr.length > 0) {
|
167
|
-
let singleNum = 0;// 只有一个父节点的数量
|
168
|
-
childIdArr.forEach(child => {
|
169
|
-
let num = 0;
|
170
|
-
for (let k = 0; k < edgeData.length; k++) {
|
171
|
-
if(edgeData[k].end === child) {
|
172
|
-
num++;
|
173
|
-
}
|
174
|
-
// 子节点的父节点数量大于1,则终止循环
|
175
|
-
if(num > 1){
|
176
|
-
break
|
177
|
-
}
|
178
|
-
if(k == edgeData.length - 1) {
|
179
|
-
singleNum++
|
180
|
-
}
|
181
|
-
}
|
182
|
-
})
|
183
|
-
// 如果所有的子节点的父节点都是唯一的
|
184
|
-
if(singleNum == childIdArr.length) {
|
185
|
-
return true;
|
186
|
-
} else {
|
187
|
-
return false;
|
188
|
-
}
|
189
|
-
}
|
190
|
-
}
|
191
|
-
|
192
|
-
// 记录折叠信息,折叠操作的id,起始坐标, 节点对于该操作记录的折叠状态
|
193
|
-
collapseRecord(startNode, endNode, data) {
|
194
|
-
if (!endNode.actions) endNode.actions = {};
|
195
|
-
if (!endNode.actions[data.nodeId]) {
|
196
|
-
endNode.actions[data.nodeId] = {
|
197
|
-
fold: true,
|
198
|
-
start: {
|
199
|
-
x: endNode.x,
|
200
|
-
y: endNode.y
|
201
|
-
},
|
202
|
-
end: {
|
203
|
-
x: startNode.x,
|
204
|
-
y: startNode.y
|
205
|
-
}
|
206
|
-
}
|
207
|
-
} else {
|
208
|
-
endNode.actions[data.nodeId].fold = false;
|
209
|
-
}
|
210
|
-
}
|
211
|
-
}
|
@@ -1,149 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2024 - present OpenTiny HUICharts Authors.
|
3
|
-
* Copyright (c) 2024 - present Huawei Cloud Computing Technologies Co., Ltd.
|
4
|
-
*
|
5
|
-
* Use of this source code is governed by an MIT-style license.
|
6
|
-
*
|
7
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
8
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
9
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
const TRIGGER_CLASSNAMES = ['huicharts-node', 'huicharts-line-wrap', 'huicharts-legend-itemContainer', 'huicharts-container'];
|
13
|
-
const IGNORE_CONTAINER_CLASS = 'huicharts-legend-container';
|
14
|
-
|
15
|
-
export default class Contextmenu {
|
16
|
-
constructor(context, menuOption) {
|
17
|
-
this.showMenu = false;
|
18
|
-
this.context = context;
|
19
|
-
this.menuOption = menuOption; // 配置对象
|
20
|
-
this.handleShow = this.updateMenu.bind(this);
|
21
|
-
this.handleClose = this.closeContextmenu.bind(this);
|
22
|
-
this.bindEvent();
|
23
|
-
}
|
24
|
-
|
25
|
-
bindEvent () {
|
26
|
-
this.context.root.addEventListener('contextmenu', this.handleShow)
|
27
|
-
}
|
28
|
-
|
29
|
-
uninstall() {
|
30
|
-
this.showMenu = false;
|
31
|
-
this.context.root.removeEventListener('click', this.handleClose)
|
32
|
-
document.removeEventListener('click', this.handleClose)
|
33
|
-
this.context.root.removeEventListener('contextmenu', this.handleShow)
|
34
|
-
}
|
35
|
-
|
36
|
-
updateMenu (event) {
|
37
|
-
event.preventDefault();
|
38
|
-
// 判断触发器的class集合
|
39
|
-
const clsNames = new Set(TRIGGER_CLASSNAMES);
|
40
|
-
const { menuOption } = this;
|
41
|
-
const targetEl = event.target;
|
42
|
-
let currentEl = event.target;
|
43
|
-
let targetCls = '';
|
44
|
-
while (currentEl) {
|
45
|
-
const currClsNames = currentEl.getAttribute("class")?.split(' ') || [];
|
46
|
-
targetCls = currClsNames.filter(name => clsNames.has(name))[0];
|
47
|
-
if (targetCls || currentEl === document.body) {
|
48
|
-
break;
|
49
|
-
}
|
50
|
-
if (currClsNames.some(name => name === IGNORE_CONTAINER_CLASS)) {
|
51
|
-
this.closeContextmenu(event);
|
52
|
-
return false; // 右键在图例的空白区域
|
53
|
-
}
|
54
|
-
currentEl = currentEl.parentNode;
|
55
|
-
}
|
56
|
-
let menu = undefined;
|
57
|
-
let targetId = undefined;
|
58
|
-
if (targetCls === 'huicharts-node') {
|
59
|
-
menu = menuOption.node;
|
60
|
-
targetId = currentEl.getAttribute('id');
|
61
|
-
} else if (targetCls === 'huicharts-line-wrap') {
|
62
|
-
menu = menuOption.line;
|
63
|
-
targetId = currentEl.children[0]?.getAttribute('id');
|
64
|
-
} else if (targetCls === 'huicharts-legend-itemContainer') {
|
65
|
-
menu = menuOption.legend;
|
66
|
-
targetId = currentEl.getAttribute('id');
|
67
|
-
} else if (targetCls === 'huicharts-container') {
|
68
|
-
menu = menuOption.canvas;
|
69
|
-
targetId = 'huicharts-container';
|
70
|
-
}
|
71
|
-
|
72
|
-
if (menu) {
|
73
|
-
this.closeContextmenu(event)
|
74
|
-
this.context.root.addEventListener('click', this.handleClose)
|
75
|
-
document.addEventListener('click', this.handleClose)
|
76
|
-
this.createMenuElement(event, menu, targetId);
|
77
|
-
this.showMenu = true;
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
// 创建menu元素
|
82
|
-
createMenuElement (event, menuObj, targetId) {
|
83
|
-
const ulElement = document.createElement("ul");
|
84
|
-
ulElement.classList.add("huicharts-contextmenu");
|
85
|
-
if (Array.isArray(menuObj.data)) {
|
86
|
-
for (let item of menuObj.data) {
|
87
|
-
const liElement = document.createElement("li");
|
88
|
-
if (menuObj.itemRender) {
|
89
|
-
const renderElement = menuObj.itemRender(item, targetId);
|
90
|
-
if (renderElement instanceof Node) {
|
91
|
-
liElement.appendChild(renderElement);
|
92
|
-
} else {
|
93
|
-
liElement.innerHTML = renderElement;
|
94
|
-
}
|
95
|
-
} else {
|
96
|
-
if (item.icon) {
|
97
|
-
liElement.innerHTML = `<img class="menu-icon" src="${item.icon}" alt="" />`;
|
98
|
-
}
|
99
|
-
liElement.innerHTML += `<span class="menu-text">${item.label}</span> `;
|
100
|
-
}
|
101
|
-
liElement.classList.add("huicharts-contextmenu-item");
|
102
|
-
liElement.onclick = (event) => {
|
103
|
-
event.stopPropagation()
|
104
|
-
menuObj.onclick?.(item, targetId, event)
|
105
|
-
this.closeContextmenu(event)
|
106
|
-
};
|
107
|
-
ulElement.appendChild(liElement);
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
this.context.root.appendChild(ulElement);
|
112
|
-
this.adjustMenuPosition(event, ulElement);
|
113
|
-
}
|
114
|
-
|
115
|
-
// 调整menu展示的位置
|
116
|
-
adjustMenuPosition (event, menuContainerEl) {
|
117
|
-
const { root } = this.context; // 图表根容器
|
118
|
-
const { width: rootWidth, height: rootHeight, left: rootLeft, top: rootTop } = root.getBoundingClientRect();
|
119
|
-
const { offsetWidth: menuWidth, offsetHeight: menuHeight } = menuContainerEl;
|
120
|
-
const [offsetX = 4, offsetY = 4] = this.menuOption.offset || [4, 4]; // 菜单容器偏移量
|
121
|
-
let left = event.clientX - rootLeft + offsetX;
|
122
|
-
let top = event.clientY - rootTop + offsetY;
|
123
|
-
if (left + menuWidth > rootWidth) { // 右侧超出,向左移位
|
124
|
-
left = rootWidth - menuWidth - offsetX;
|
125
|
-
}
|
126
|
-
if (top + menuHeight > rootHeight) { // 底部超出,向上移位
|
127
|
-
top = rootHeight - menuHeight - offsetY;
|
128
|
-
}
|
129
|
-
menuContainerEl.setAttribute('style', `position: absolute; top: ${top}px; left: ${left}px;`);
|
130
|
-
}
|
131
|
-
|
132
|
-
closeContextmenu (event) {
|
133
|
-
if (!this.showMenu) {
|
134
|
-
return
|
135
|
-
}
|
136
|
-
event?.stopPropagation();
|
137
|
-
this.showMenu = false;
|
138
|
-
const contextmenu = this.context.root.querySelectorAll('.huicharts-contextmenu');
|
139
|
-
contextmenu.forEach((el) => {
|
140
|
-
el.parentNode.removeChild(el);
|
141
|
-
});
|
142
|
-
this.context.root.removeEventListener('click', this.handleClose);
|
143
|
-
document.removeEventListener('click', this.handleClose);
|
144
|
-
}
|
145
|
-
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
@@ -1,40 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2024 - present OpenTiny HUICharts Authors.
|
3
|
-
* Copyright (c) 2024 - present Huawei Cloud Computing Technologies Co., Ltd.
|
4
|
-
*
|
5
|
-
* Use of this source code is governed by an MIT-style license.
|
6
|
-
*
|
7
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
8
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
9
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
.huicharts-contextmenu {
|
13
|
-
position: absolute;
|
14
|
-
z-index: 10000;
|
15
|
-
padding: 8px 10px;
|
16
|
-
border-radius: 4px;
|
17
|
-
box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.18);
|
18
|
-
background: #fff;
|
19
|
-
|
20
|
-
.huicharts-contextmenu-item {
|
21
|
-
display: flex;
|
22
|
-
align-items: center;
|
23
|
-
justify-content: flex-start;
|
24
|
-
padding: 4px 6px;
|
25
|
-
margin: 2px 0;
|
26
|
-
font-size: 12px;
|
27
|
-
|
28
|
-
.menu-icon {
|
29
|
-
width: 20px;
|
30
|
-
height: 20px;
|
31
|
-
margin-right: 6px;
|
32
|
-
}
|
33
|
-
|
34
|
-
&:hover {
|
35
|
-
background-color: #d9d9d9;
|
36
|
-
border-radius: 2px;
|
37
|
-
cursor: default;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
}
|