hydro-graph 1.0.0

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/style.css ADDED
@@ -0,0 +1 @@
1
+ .box[data-v-bae20fc6]{position:relative;width:100%;height:100%;display:flex;flex-direction:column}.box .title[data-v-bae20fc6]{color:red;font-size:25px;font-weight:700;text-align:center;height:25px;line-height:25px}.box .subTitle[data-v-bae20fc6]{color:#3a4ce1;font-size:14px;font-weight:700;text-align:center;height:25px;line-height:25px}.box .legend-box[data-v-bae20fc6]{margin-left:33px;z-index:10;display:flex;align-items:center;flex-wrap:wrap}.box .legend-box>.el-checkbox[data-v-bae20fc6]{margin-right:8px}.box .legend-box[data-v-bae20fc6] .el-dropdown{margin-right:8px}.box .legend-box[data-v-bae20fc6] .el-dropdown .el-tooltip__trigger{display:flex;align-items:center}.box .mychart[data-v-bae20fc6]{flex:1;position:relative}.box .mychart[data-v-bae20fc6] .line-name-tooltip-style{position:absolute;padding:8px;background:rgba(255,255,255,.95);border-radius:4px;box-shadow:0 4px 12px #0000001a;font-size:14px;pointer-events:none;opacity:0;transform:translate(-100%,-120%);transition:all .25s cubic-bezier(.4,0,.2,1);z-index:1000}[data-v-bae20fc6] .el-checkbox .el-checkbox__label{color:var(--fill-color);display:flex;align-items:center;padding-left:3px}[data-v-bae20fc6] .el-checkbox .el-checkbox__input.is-checked .el-checkbox__inner,[data-v-bae20fc6] .el-checkbox .el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--fill-color);border-color:var(--fill-color)!important}[data-v-bae20fc6] .el-checkbox .el-checkbox__input.is-focus .el-checkbox__inner,[data-v-bae20fc6] .el-checkbox .el-checkbox__inner:hover{border-color:var(--fill-color)!important}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "hydro-graph",
3
+ "version": "1.0.0",
4
+ "description": "A Vue 3 component for hydrograph visualization using ECharts",
5
+ "main": "dist/hydro-graph.umd.js",
6
+ "module": "dist/hydro-graph.es.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "src"
11
+ ],
12
+ "scripts": {
13
+ "build": "vite build",
14
+ "dev": "vite",
15
+ "prepare": "npm run build"
16
+ },
17
+ "dependencies": {
18
+ "echarts": "^5.4.3",
19
+ "dayjs": "^1.11.10",
20
+ "element-plus": "^2.4.4",
21
+ "vue": "^3.3.4"
22
+ },
23
+ "devDependencies": {
24
+ "@vitejs/plugin-vue": "^4.2.3",
25
+ "typescript": "^5.0.2",
26
+ "vite": "^4.3.9"
27
+ },
28
+ "keywords": [
29
+ "vue",
30
+ "echarts",
31
+ "hydrograph",
32
+ "visualization"
33
+ ],
34
+ "author": "",
35
+ "license": "MIT"
36
+ }
package/src/App.vue ADDED
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <div class="app">
3
+ <h1>HydroGraph 组件测试</h1>
4
+ <div class="chart-container">
5
+ <HydroGraph
6
+ :chartOption="chartOption"
7
+ :legendList="legendList"
8
+ width="100%"
9
+ height="500px"
10
+ />
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <script setup>
16
+ import HydroGraph from './HydroGraph.vue'
17
+
18
+ const chartOption = {
19
+ title: '水位流量关系图',
20
+ xAxis: [
21
+ {
22
+ type: 'time',
23
+ name: '时间',
24
+ gridIndex: 0
25
+ }
26
+ ],
27
+ yAxis: [
28
+ {
29
+ type: 'value',
30
+ name: '水位 (m)',
31
+ gridIndex: 0,
32
+ position: 'left'
33
+ },
34
+ {
35
+ type: 'value',
36
+ name: '流量 (m³/s)',
37
+ gridIndex: 0,
38
+ position: 'right'
39
+ }
40
+ ],
41
+ series: [
42
+ {
43
+ name: '实测水位',
44
+ type: 'line',
45
+ yAxisIndex: 0,
46
+ data: [
47
+ ['2024-01-01 00:00', 10.2],
48
+ ['2024-01-01 01:00', 10.5],
49
+ ['2024-01-01 02:00', 10.8],
50
+ ['2024-01-01 03:00', 11.0],
51
+ ['2024-01-01 04:00', 11.2],
52
+ ['2024-01-01 05:00', 11.5],
53
+ ['2024-01-01 06:00', 11.8],
54
+ ['2024-01-01 07:00', 12.0]
55
+ ]
56
+ },
57
+ {
58
+ name: '流量',
59
+ type: 'bar',
60
+ yAxisIndex: 1,
61
+ data: [
62
+ ['2024-01-01 00:00', 120],
63
+ ['2024-01-01 01:00', 150],
64
+ ['2024-01-01 02:00', 180],
65
+ ['2024-01-01 03:00', 200],
66
+ ['2024-01-01 04:00', 220],
67
+ ['2024-01-01 05:00', 250],
68
+ ['2024-01-01 06:00', 280],
69
+ ['2024-01-01 07:00', 300]
70
+ ]
71
+ }
72
+ ]
73
+ }
74
+
75
+ const legendList = [
76
+ {
77
+ name: '实测水位',
78
+ isSelected: true
79
+ },
80
+ {
81
+ name: '流量',
82
+ isSelected: true
83
+ }
84
+ ]
85
+ </script>
86
+
87
+ <style>
88
+ .app {
89
+ width: 100%;
90
+ max-width: 1200px;
91
+ margin: 0 auto;
92
+ padding: 20px;
93
+ }
94
+
95
+ .chart-container {
96
+ width: 100%;
97
+ height: 500px;
98
+ margin-top: 20px;
99
+ border: 1px solid #e0e0e0;
100
+ border-radius: 4px;
101
+ padding: 20px;
102
+ }
103
+ </style>