@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,174 +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 { percentToDecimal } from '../../../../util/math';
|
13
|
-
import { hashString } from'../../../../util/math';
|
14
|
-
|
15
|
-
// 连接点均分模式
|
16
|
-
const SHARING_TYPE = {
|
17
|
-
MERGE: 'merge',
|
18
|
-
SHARING:'sharing',
|
19
|
-
STRICT:'strict'
|
20
|
-
};
|
21
|
-
|
22
|
-
//根据均分类型计算对应坐标
|
23
|
-
function countCoordinate(sideLength,pointData) {
|
24
|
-
let coordinate;
|
25
|
-
let {sharingType, length, index} = pointData;
|
26
|
-
if(sharingType === SHARING_TYPE.SHARING) { // 均分模式
|
27
|
-
coordinate = sideLength / (length * 2) * ((index-1) * 2 + 1);
|
28
|
-
}
|
29
|
-
else if (sharingType === SHARING_TYPE.STRICT) { // 严格均分模式
|
30
|
-
coordinate = sideLength / (length + 1) * index;
|
31
|
-
}
|
32
|
-
else { // 默认模式,不均分连接点位于中间位置
|
33
|
-
coordinate = sideLength / 2;
|
34
|
-
}
|
35
|
-
// 保留一位小数点
|
36
|
-
coordinate = Math.floor(coordinate * 10) / 10
|
37
|
-
return coordinate;
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
// 计算连接点位置
|
42
|
-
function calculate(itemData,allConnectorData,option,nodeObj){
|
43
|
-
|
44
|
-
let {startConnector,endConnector} = itemData;
|
45
|
-
if(!nodeObj[itemData.start] || !nodeObj[itemData.end]) return;
|
46
|
-
let startNode = nodeObj[itemData.start];
|
47
|
-
let endNode = nodeObj[itemData.end];
|
48
|
-
let startSharing = option?.connector?.startSharing;
|
49
|
-
let endSharing = option?.connector?.endSharing;
|
50
|
-
countPoint(startConnector,startNode,allConnectorData,startSharing);
|
51
|
-
countPoint(endConnector,endNode,allConnectorData,endSharing);
|
52
|
-
return itemData;
|
53
|
-
}
|
54
|
-
|
55
|
-
// 计算连接点X,Y坐标
|
56
|
-
function countPoint(connector,node,data,sharing) {
|
57
|
-
const {width,height} = node; //
|
58
|
-
const position = connector.position; // 连接点位置
|
59
|
-
const sharingType = sharing; // 连接点分离类型,默认不分离
|
60
|
-
const args = connector.args; // 连接点其他配置信息
|
61
|
-
const length = data[connector.nodeId][position].number; // 同一方向上连接点数量
|
62
|
-
const index = connector.index; // 同一方向上第几个连接点
|
63
|
-
let X,Y; // 连接点的坐标
|
64
|
-
let pointData = {length,index,sharingType};
|
65
|
-
switch (position) {
|
66
|
-
case 'top':
|
67
|
-
X = countCoordinate(width,pointData);
|
68
|
-
Y = 0;
|
69
|
-
break;
|
70
|
-
case 'bottom':
|
71
|
-
X = countCoordinate(width,pointData);
|
72
|
-
Y = height;
|
73
|
-
break;
|
74
|
-
case 'left':
|
75
|
-
X = 0;
|
76
|
-
Y = countCoordinate(height,pointData);
|
77
|
-
break;
|
78
|
-
case 'right':
|
79
|
-
X = width;
|
80
|
-
Y = countCoordinate(height,pointData);
|
81
|
-
break;
|
82
|
-
case 'absolute':
|
83
|
-
X = args.x.indexOf('%') == -1 ? width * percentToDecimal(args.x) : args.x;
|
84
|
-
Y = args.y.indexOf('%') == -1 ? height * percentToDecimal(args.y) : args.y;
|
85
|
-
}
|
86
|
-
let deviateX = 0; // X轴偏移量
|
87
|
-
let deviateY = 0; // Y轴偏移量
|
88
|
-
if(connector.args) {
|
89
|
-
deviateX = connector.args.dx ? connector.args.dx : 0;
|
90
|
-
deviateY = connector.args.dy ? connector.args.dy : 0;
|
91
|
-
}
|
92
|
-
connector.x = X + deviateX;
|
93
|
-
connector.y = Y + deviateY;
|
94
|
-
connector.id = connector.id || hashString();
|
95
|
-
}
|
96
|
-
|
97
|
-
//根据均分类型计算对应坐标
|
98
|
-
function update(lineData,option) {
|
99
|
-
const type = option?.connector?.sharing;
|
100
|
-
const direction = option.layout?.direction;
|
101
|
-
// 按照相同的起始连接点整理连接数据
|
102
|
-
let lineDataByStart = {};
|
103
|
-
let newLineData = [];
|
104
|
-
// 非默认模式下,将线段数据按相同的起始节点归类
|
105
|
-
if(type === 'sharing' || type === 'strict'){
|
106
|
-
lineData.forEach(item => {
|
107
|
-
let nodeId = item.startNode.id;
|
108
|
-
if(lineDataByStart[nodeId] && lineDataByStart[nodeId].length){
|
109
|
-
lineDataByStart[nodeId].push(item);
|
110
|
-
} else {
|
111
|
-
lineDataByStart[nodeId] = [];
|
112
|
-
lineDataByStart[nodeId].push(item);
|
113
|
-
}
|
114
|
-
});
|
115
|
-
|
116
|
-
Object.keys(lineDataByStart).forEach(key => {
|
117
|
-
let nodeData = lineDataByStart[key];
|
118
|
-
let connectorAllCoordinate = [];
|
119
|
-
// 按照末端节点排序
|
120
|
-
if(direction === 'TB') {
|
121
|
-
nodeData.sort((a, b) => a.endNode.x - b.endNode.x);
|
122
|
-
} else {
|
123
|
-
nodeData.sort((a, b) => a.endNode.y - b.endNode.y);
|
124
|
-
}
|
125
|
-
// 以节点坐标位置,更新连接点坐标,
|
126
|
-
nodeData.forEach(item => {
|
127
|
-
let startConnector = item.startConnector;
|
128
|
-
// 获取一个节点的所有起点连接点坐标
|
129
|
-
connectorAllCoordinate.push({x: startConnector.x,y: startConnector.y});
|
130
|
-
if(connectorAllCoordinate.length === nodeData.length) {
|
131
|
-
// 按照连接点坐标排序
|
132
|
-
if(direction === 'TB') {
|
133
|
-
connectorAllCoordinate.sort((a, b) => a.x - b.x);
|
134
|
-
} else {
|
135
|
-
connectorAllCoordinate.sort((a, b) => a.y - b.y);
|
136
|
-
}
|
137
|
-
// 更新连接点起始坐标
|
138
|
-
connectorAllCoordinate.forEach((connector,index) => {
|
139
|
-
nodeData[index].startConnector.x = connector.x;
|
140
|
-
nodeData[index].startConnector.y = connector.y;
|
141
|
-
newLineData.push(nodeData[index]);
|
142
|
-
})
|
143
|
-
|
144
|
-
}
|
145
|
-
})
|
146
|
-
|
147
|
-
})
|
148
|
-
lineData = newLineData;
|
149
|
-
}
|
150
|
-
}
|
151
|
-
|
152
|
-
// 相同位置的连接点用同一id
|
153
|
-
function someId(edges) {
|
154
|
-
let connectorArr = [];
|
155
|
-
edges.forEach(item => {
|
156
|
-
if(item.startConnector) {
|
157
|
-
connectorArr.push(item.startConnector)
|
158
|
-
}
|
159
|
-
if(item.endConnector) {
|
160
|
-
connectorArr.push(item.endConnector)
|
161
|
-
}
|
162
|
-
})
|
163
|
-
connectorArr.forEach((item,index) => {
|
164
|
-
let remainArr = connectorArr.slice(index + 1);
|
165
|
-
remainArr.forEach(connector => {
|
166
|
-
if(item.x == connector.x && item.y === connector.y && item.nodeId === connector.nodeId) {
|
167
|
-
connector.id = item.id;
|
168
|
-
}
|
169
|
-
})
|
170
|
-
})
|
171
|
-
}
|
172
|
-
|
173
|
-
|
174
|
-
export { calculate , update, someId};
|
@@ -1,43 +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 init from './init';
|
13
|
-
import sharing from './sharing';
|
14
|
-
import {calculate, update, someId} from './calculate';
|
15
|
-
|
16
|
-
// 矩形节点的连线位置
|
17
|
-
class RectShape{
|
18
|
-
constructor(data, option){
|
19
|
-
// 节点对象
|
20
|
-
let nodeObj = {};
|
21
|
-
data.nodes.forEach(item => {
|
22
|
-
nodeObj[item.id] = item;
|
23
|
-
})
|
24
|
-
// 初始连线数据
|
25
|
-
init(data, option, nodeObj);
|
26
|
-
// 获取所有连接点的数量位置信息
|
27
|
-
let connectorData = sharing(data.edges, option);
|
28
|
-
// 开始计算连线位置信息
|
29
|
-
data.edges.forEach(item => {
|
30
|
-
return calculate(item, connectorData, option, nodeObj);
|
31
|
-
});
|
32
|
-
// 如果连接点的位置,则修改为同一id
|
33
|
-
someId(data.edges);
|
34
|
-
// 根据节点位置更新连接点坐标
|
35
|
-
update(data.edges, option);
|
36
|
-
}
|
37
|
-
}
|
38
|
-
|
39
|
-
export default RectShape;
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
@@ -1,79 +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 VDirection = ['TB', 'BT', 'V'];
|
13
|
-
const HDirection = ['LR', 'RL', 'H'];
|
14
|
-
const START = 'start';
|
15
|
-
const END = 'end';
|
16
|
-
const Direction = {
|
17
|
-
'T': 'top',
|
18
|
-
'L': 'left',
|
19
|
-
'R': 'right',
|
20
|
-
'B': 'bottom'
|
21
|
-
};
|
22
|
-
|
23
|
-
function countPosition(startNode,endNode,direction){
|
24
|
-
let startNodeStartPoint,startNodeEndPoint,endNodeStartPoint,endNodeEndPoint;
|
25
|
-
if(direction === 'H') {
|
26
|
-
startNodeStartPoint = startNode.x;
|
27
|
-
startNodeEndPoint = startNode.x + startNode.width;
|
28
|
-
endNodeStartPoint = endNode.x;
|
29
|
-
endNodeEndPoint = endNode.x + endNode.width;
|
30
|
-
} else {
|
31
|
-
startNodeStartPoint = startNode.y;
|
32
|
-
startNodeEndPoint = startNode.y + startNode.height;
|
33
|
-
endNodeStartPoint = endNode.y;
|
34
|
-
endNodeEndPoint = endNode.y + endNode.height;
|
35
|
-
}
|
36
|
-
// 起始节点左右分别与终止节点左右的距离
|
37
|
-
let distanceArr = [Math.abs(startNodeStartPoint - endNodeStartPoint),Math.abs(startNodeStartPoint - endNodeEndPoint),Math.abs(startNodeEndPoint - endNodeStartPoint),Math.abs(startNodeEndPoint - endNodeEndPoint)];
|
38
|
-
// 获取最小距离
|
39
|
-
let minDistance = Math.min(...distanceArr);
|
40
|
-
let positionArrH = [{start: 'left',end: 'left'},{start: 'left',end: 'right'},{start: 'right',end: 'left'},{start: 'right',end: 'right'}];
|
41
|
-
let positionArrV = [{start: 'top',end: 'top'},{start: 'top',end: 'bottom'},{start: 'bottom',end: 'top'},{start: 'bottom',end: 'bottom'}];
|
42
|
-
let positionArr = direction === 'H' ? positionArrH : positionArrV;
|
43
|
-
return positionArr[distanceArr.indexOf(minDistance)];
|
44
|
-
}
|
45
|
-
|
46
|
-
function init(data, option, nodeObj){
|
47
|
-
let originalDirection;
|
48
|
-
let direction = originalDirection = option?.layout?.direction || VDirection[0];
|
49
|
-
if(direction === VDirection[2]) direction = VDirection[0];
|
50
|
-
if(direction === HDirection[2]) direction = HDirection[0];
|
51
|
-
let startPosition = Direction[direction[0]];
|
52
|
-
let endPosition = Direction[direction[1]];
|
53
|
-
|
54
|
-
// let initLineData = [];
|
55
|
-
data.edges.forEach(edge => {
|
56
|
-
if(!edge.start || !edge.end) return;
|
57
|
-
|
58
|
-
edge.startConnector = edge.startConnector || {
|
59
|
-
port: START,
|
60
|
-
nodeId: edge.start,
|
61
|
-
position: endPosition,
|
62
|
-
};
|
63
|
-
edge.endConnector = edge.endConnector || {
|
64
|
-
port: END,
|
65
|
-
nodeId: edge.end,
|
66
|
-
position: startPosition,
|
67
|
-
};
|
68
|
-
if(originalDirection === 'H' || originalDirection === 'V'){
|
69
|
-
let startNode = nodeObj[edge.start];
|
70
|
-
let endNode = nodeObj[edge.end];
|
71
|
-
let positions = countPosition(startNode,endNode,originalDirection);
|
72
|
-
edge.startConnector.position = positions.start;
|
73
|
-
edge.endConnector.position = positions.end;
|
74
|
-
}
|
75
|
-
});
|
76
|
-
}
|
77
|
-
|
78
|
-
|
79
|
-
export default init ;
|
@@ -1,57 +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
|
-
const SHARING_TYPE = {
|
14
|
-
MERGE: 'merge',
|
15
|
-
SHARING:'sharing',
|
16
|
-
STRICT:'strict'
|
17
|
-
};
|
18
|
-
|
19
|
-
// 统计节点每个方向的连接点数据
|
20
|
-
function statistics(connectorData,item,direction,separate) {
|
21
|
-
const nodeName = direction === 'start' ? 'start' : 'end';
|
22
|
-
const connectorName = direction === 'start' ? 'startConnector' : 'endConnector';
|
23
|
-
// 连接点数据
|
24
|
-
let nodeData = connectorData[item[nodeName]] || {};
|
25
|
-
// 连接点位置
|
26
|
-
let position = item[connectorName].position;
|
27
|
-
// 分离模式下number同一方向连接点数量,index为连接点标识,逐次加1
|
28
|
-
if(nodeData[position]) {
|
29
|
-
nodeData[position].number = separate ? nodeData[position].number + 1: 1;
|
30
|
-
//默认模式下,同一方向有多个连线的,第一个连接点index为1,其他置为-1做标识,代表不用生成连接点dom
|
31
|
-
item[connectorName].index = separate ? nodeData[position].number : -1;
|
32
|
-
} else {
|
33
|
-
nodeData[position] = {number:1};
|
34
|
-
item[connectorName].index = 1;
|
35
|
-
}
|
36
|
-
return nodeData;
|
37
|
-
}
|
38
|
-
|
39
|
-
// 获取节点的所有连接点,如果是均分模式或者是严格均分,统计同一方向上的连接点数量,并在原始数据逐次添加连接点数量index标识
|
40
|
-
function sharing(data, option) {
|
41
|
-
const connectorData = {}
|
42
|
-
const startSharing = option?.connector?.startSharing; // 连接点模式
|
43
|
-
const endSharing = option?.connector?.startSharing; // 连接点模式
|
44
|
-
const startSeparate = startSharing === SHARING_TYPE.SHARING || startSharing === SHARING_TYPE.STRICT; // 是否为分离模式
|
45
|
-
const endSeparate = endSharing === SHARING_TYPE.SHARING || endSharing === SHARING_TYPE.STRICT;
|
46
|
-
data.forEach(item => {
|
47
|
-
if(item.start && item.startConnector) {
|
48
|
-
connectorData[item.start] = statistics(connectorData,item,'start',startSeparate);
|
49
|
-
}
|
50
|
-
if(item.end && item.endConnector) {
|
51
|
-
connectorData[item.end] = statistics(connectorData,item,'end',endSeparate);
|
52
|
-
}
|
53
|
-
})
|
54
|
-
return connectorData
|
55
|
-
|
56
|
-
}
|
57
|
-
export default sharing
|
@@ -1,30 +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 RectShape from './RectShape';
|
13
|
-
import CircleShape from './CircleShape';
|
14
|
-
|
15
|
-
const NodeShape = {
|
16
|
-
rect: RectShape,
|
17
|
-
circle: CircleShape
|
18
|
-
}
|
19
|
-
|
20
|
-
class LineLayout{
|
21
|
-
|
22
|
-
constructor(data, option){
|
23
|
-
let nodeShape = option.layout?.nodeShape || 'rect';
|
24
|
-
// 根据节点形状,计算连线的开始和结束坐标
|
25
|
-
new NodeShape[nodeShape](data, option);
|
26
|
-
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
export default LineLayout;
|
@@ -1,190 +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 Node from './index';
|
13
|
-
import nodeLayout from '../nodeLayout';
|
14
|
-
import convertData from './convertData';
|
15
|
-
import bufferRender from './bufferRender';
|
16
|
-
|
17
|
-
export default class NodeManager {
|
18
|
-
// nodes + edges 数组格式数据, 即 relationData
|
19
|
-
data;
|
20
|
-
// 节点数据
|
21
|
-
nodes;
|
22
|
-
// 节点关系
|
23
|
-
edges;
|
24
|
-
// 布局名称
|
25
|
-
layoutName;
|
26
|
-
// 节点理器工厂
|
27
|
-
instance = {};
|
28
|
-
|
29
|
-
constructor(option, container) {
|
30
|
-
this.option = option;
|
31
|
-
this.container = container;
|
32
|
-
this.canvasContainter = this.container.parentNode;
|
33
|
-
}
|
34
|
-
|
35
|
-
// option.layout.algorithm 为自定义布局算法
|
36
|
-
init(option) {
|
37
|
-
if (option?.layout?.algorithm) {
|
38
|
-
this.layoutName = 'customize';
|
39
|
-
} else {
|
40
|
-
this.layoutName = option?.layout?.type || 'defaults';
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
// 计算布局
|
45
|
-
layout() {
|
46
|
-
this.init(this.option);
|
47
|
-
let layoutClass = nodeLayout[this.layoutName];
|
48
|
-
let containerRect = this.container.getBoundingClientRect();
|
49
|
-
new layoutClass(this.option.data, containerRect, this.option);
|
50
|
-
// 将 optionData 转成 relationData
|
51
|
-
|
52
|
-
this.data = convertData[this.layoutName](this.option.data);
|
53
|
-
|
54
|
-
|
55
|
-
}
|
56
|
-
|
57
|
-
relayout(option) {
|
58
|
-
this.init(option);
|
59
|
-
let layoutClass = nodeLayout[this.layoutName];
|
60
|
-
let containerRect = this.container.getBoundingClientRect();
|
61
|
-
new layoutClass(option.data, containerRect, option);
|
62
|
-
// 将 optionData 转成 relationData
|
63
|
-
this.data = convertData[this.layoutName](option.data);
|
64
|
-
}
|
65
|
-
|
66
|
-
render() {
|
67
|
-
this.instance = {};
|
68
|
-
let containerRect = this.container.getBoundingClientRect();
|
69
|
-
this.canvasContainterRect = this.canvasContainter.getBoundingClientRect();
|
70
|
-
this.containerCenter = {
|
71
|
-
x: containerRect.width / 2,
|
72
|
-
y: containerRect.height / 2
|
73
|
-
};
|
74
|
-
if (this.option.layout?.bufferRender) {
|
75
|
-
// 执行局部渲染方法
|
76
|
-
console.log("局部渲染")
|
77
|
-
this.data.nodes.forEach(node => {
|
78
|
-
this.bufferRenderNode(node, this.option);
|
79
|
-
});
|
80
|
-
} else {
|
81
|
-
console.log("全局渲染",this.data)
|
82
|
-
// 执行全局渲染方法
|
83
|
-
this.data.nodes.forEach(node => {
|
84
|
-
this.renderNode(node, this.option);
|
85
|
-
});
|
86
|
-
|
87
|
-
}
|
88
|
-
|
89
|
-
}
|
90
|
-
|
91
|
-
// 全局渲染
|
92
|
-
renderNode(node, option) {
|
93
|
-
let nodeInstance = new Node(node, option, this.container);
|
94
|
-
console.log("renderNode",nodeInstance)
|
95
|
-
|
96
|
-
let nodeDom = nodeInstance.render();
|
97
|
-
this.container.appendChild(nodeDom);
|
98
|
-
this.instance[node.id] = nodeInstance;
|
99
|
-
}
|
100
|
-
|
101
|
-
// 局部渲染
|
102
|
-
bufferRenderNode(node, option) {
|
103
|
-
let nodeInstance = new Node(node, option, this.container);
|
104
|
-
// 使用初始偏移 (0, 0) 进行首次渲染
|
105
|
-
bufferRender(nodeInstance, {
|
106
|
-
scale: 1,
|
107
|
-
lastScale: 1,
|
108
|
-
offset: { x: 0, y: 0 },
|
109
|
-
center: this.containerCenter
|
110
|
-
}, this.container, this.canvasContainterRect);// TODO 初始渲染可能缩放值不是1
|
111
|
-
this.instance[node.id] = nodeInstance;
|
112
|
-
}
|
113
|
-
|
114
|
-
// 外部触发局部渲染回调
|
115
|
-
onBufferRender(params) {
|
116
|
-
if (!this.option.layout?.bufferRender) return;
|
117
|
-
for (let id in this.instance) {
|
118
|
-
bufferRender(this.instance[id], params, this.container, this.canvasContainterRect);
|
119
|
-
};
|
120
|
-
};
|
121
|
-
|
122
|
-
// 刷新所有节点,并执行位移动画, this.data为新数据, this.instance为旧数据
|
123
|
-
refresh(option) {
|
124
|
-
let newIds = [];
|
125
|
-
let oldIds = [];
|
126
|
-
this.data.nodes.forEach(newNode => {
|
127
|
-
newIds.push(newNode.id);
|
128
|
-
if (this.isExist(newNode.id)) {
|
129
|
-
this.instance[newNode.id].refresh(newNode);
|
130
|
-
} else {
|
131
|
-
if (option.layout?.bufferRender) {
|
132
|
-
// 执行局部渲染方法
|
133
|
-
this.bufferRenderNode(newNode, option);
|
134
|
-
} else {
|
135
|
-
// 执行全局渲染方法
|
136
|
-
this.renderNode(newNode, option);
|
137
|
-
}
|
138
|
-
}
|
139
|
-
});
|
140
|
-
oldIds = Object.keys(this.instance);
|
141
|
-
oldIds.forEach(id => {
|
142
|
-
if (newIds.indexOf(id) == -1) {
|
143
|
-
this.unmount(id);
|
144
|
-
}
|
145
|
-
})
|
146
|
-
}
|
147
|
-
|
148
|
-
getNodeData(id) {
|
149
|
-
return this.instance[id]?.getData();
|
150
|
-
}
|
151
|
-
|
152
|
-
getNode(id) {
|
153
|
-
return this.instance[id];
|
154
|
-
}
|
155
|
-
|
156
|
-
// 保存节点的实时位置+大小,用于做动效
|
157
|
-
getCurrentPosition() {
|
158
|
-
let current = {};
|
159
|
-
Object.keys(this.instance).forEach(id => {
|
160
|
-
current[id] = this.instance[id].getCurrentPosition()
|
161
|
-
});
|
162
|
-
return current;
|
163
|
-
}
|
164
|
-
|
165
|
-
getData() {
|
166
|
-
return this.data;// nodes, edges
|
167
|
-
}
|
168
|
-
|
169
|
-
getDom(id){
|
170
|
-
return this.instance[id]?.getDom();
|
171
|
-
}
|
172
|
-
|
173
|
-
isExist(id) {
|
174
|
-
return this.instance[id];
|
175
|
-
}
|
176
|
-
|
177
|
-
update(id, data) {
|
178
|
-
this.instance[id].update(data);
|
179
|
-
}
|
180
|
-
|
181
|
-
// 指定节点添加事件
|
182
|
-
addEventListener(id, eventName, eventCallBack){
|
183
|
-
this.getNode(id).addEventListener(eventName, eventCallBack);
|
184
|
-
}
|
185
|
-
|
186
|
-
unmount(id) {
|
187
|
-
this.instance[id].unmount();
|
188
|
-
delete this.instance[id];
|
189
|
-
}
|
190
|
-
}
|
@@ -1,73 +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
|
-
function bufferRender(nodeInstance, params, container, canvasContainterRect) {
|
14
|
-
if (nodeInstance.hasRender) return;
|
15
|
-
if (isInBuffer(nodeInstance, params, canvasContainterRect)) {
|
16
|
-
let nodeDom = nodeInstance.render();
|
17
|
-
container.appendChild(nodeDom);
|
18
|
-
};
|
19
|
-
};
|
20
|
-
|
21
|
-
// 判断节点是否在缓冲区内
|
22
|
-
function isInBuffer(node, params, canvasContainterRect) {
|
23
|
-
let { offset, scale, lastScale, center, type } = params;
|
24
|
-
// TODO 之后可以放到option里面
|
25
|
-
const buffer = 1.3; // 缓冲区是容器大小的1.5倍
|
26
|
-
// 缓冲区的长宽
|
27
|
-
const bufferWidth = canvasContainterRect.width * buffer;
|
28
|
-
const bufferHeight = canvasContainterRect.height * buffer;
|
29
|
-
|
30
|
-
// 缓冲区的边界
|
31
|
-
const bufferLeft = (canvasContainterRect.width - bufferWidth) / 2;
|
32
|
-
const bufferTop = (canvasContainterRect.height - bufferHeight) / 2;
|
33
|
-
const bufferRight = bufferLeft + bufferWidth;
|
34
|
-
const bufferBottom = bufferTop + bufferHeight;
|
35
|
-
|
36
|
-
let { x, y, width, height, nodeRealY, nodeRealX } = node.data;
|
37
|
-
|
38
|
-
if (type === 'move') lastScale = scale;
|
39
|
-
|
40
|
-
// 计算节点相当于上一个节点的偏移量
|
41
|
-
let nodeOffset = {
|
42
|
-
x: offset.x + ((nodeRealX || x) - center.x) / lastScale * (scale - lastScale),
|
43
|
-
y: offset.y + ((nodeRealY || y) - center.y) / lastScale * (scale - lastScale),
|
44
|
-
};
|
45
|
-
|
46
|
-
nodeRealX = (nodeRealX || x) + nodeOffset.x;
|
47
|
-
nodeRealY = (nodeRealY || y) + nodeOffset.y;
|
48
|
-
|
49
|
-
// 存储节点坐标 方便下次使用
|
50
|
-
node.data.nodeRealX = nodeRealX;
|
51
|
-
node.data.nodeRealY = nodeRealY;
|
52
|
-
|
53
|
-
// 计算节点的四个角的坐标(基于当前偏移和缩放)
|
54
|
-
const topLeftX = nodeRealX;
|
55
|
-
const topLeftY = nodeRealY;
|
56
|
-
const topRightX = nodeRealX + width * scale;
|
57
|
-
const topRightY = nodeRealY;
|
58
|
-
const bottomLeftX = nodeRealX;
|
59
|
-
const bottomLeftY = nodeRealY + height * scale;
|
60
|
-
const bottomRightX = nodeRealX + width * scale;
|
61
|
-
const bottomRightY = nodeRealY + height * scale;
|
62
|
-
|
63
|
-
// 检查四个角是不是都在缓冲区
|
64
|
-
const allCornersOutside = (
|
65
|
-
(topLeftX < bufferLeft || topLeftX > bufferRight || topLeftY < bufferTop || topLeftY > bufferBottom) &&
|
66
|
-
(topRightX < bufferLeft || topRightX > bufferRight || topRightY < bufferTop || topRightY > bufferBottom) &&
|
67
|
-
(bottomLeftX < bufferLeft || bottomLeftX > bufferRight || bottomLeftY < bufferTop || bottomLeftY > bufferBottom) &&
|
68
|
-
(bottomRightX < bufferLeft || bottomRightX > bufferRight || bottomRightY < bufferTop || bottomRightY > bufferBottom)
|
69
|
-
);
|
70
|
-
return !allCornersOutside;
|
71
|
-
}
|
72
|
-
|
73
|
-
export default bufferRender;
|
@@ -1,24 +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 treeToLink from './treeToLink';
|
13
|
-
import returnSelf from './returnSelf';
|
14
|
-
import transform from './transform';
|
15
|
-
|
16
|
-
// 将不同算法的输入数据格式转换成nodes + edges格式
|
17
|
-
export default {
|
18
|
-
'grid': returnSelf,
|
19
|
-
'circle': returnSelf,
|
20
|
-
'linearArc': returnSelf,
|
21
|
-
'customize': returnSelf,
|
22
|
-
'mindmap': treeToLink,
|
23
|
-
'defaults': transform
|
24
|
-
}
|
@@ -1,16 +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
|
-
function returnSelf(data){
|
13
|
-
return data;
|
14
|
-
}
|
15
|
-
|
16
|
-
export default returnSelf;
|