kd-lane-chart-v3 0.0.1

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/README.md ADDED
@@ -0,0 +1,170 @@
1
+ # kd-lane-chart
2
+
3
+ 泳道图(KdLaneContainer)+ 实时曲线(frameLayout)Vue 2 组件包。
4
+
5
+ > **注意:** 旧包 `kd-lane-container` 和 `kd-curve-v2` 已不再推荐使用,请迁移至此统一包。
6
+
7
+ ---
8
+
9
+ ## 安装
10
+
11
+ ```bash
12
+ npm install kd-lane-chart
13
+ ```
14
+
15
+ ### 依赖
16
+
17
+ | 依赖 | 版本 |
18
+ |---|---|
19
+ | vue | ^2.6.0 |
20
+ | element-ui | ^2.15.14 |
21
+ | echarts | * |
22
+ | vuedraggable | ^2.24.3 |
23
+ | v-click-outside | ^2.1.3 |
24
+ | resize-detector | ^0.3.0 |
25
+ | lodash-es | ^4.18.1 |
26
+
27
+ ---
28
+
29
+ ## 快速开始
30
+
31
+ ```js
32
+ import Vue from "vue";
33
+ import { KdLaneContainer, frameLayout } from "kd-lane-chart";
34
+
35
+ // 全局注册(也可按需单独注册)
36
+ Vue.use(KdLaneContainer);
37
+ Vue.use(frameLayout);
38
+ ```
39
+
40
+ 或在组件内局部使用:
41
+
42
+ ```js
43
+ import { KdLaneContainer, frameLayout } from "kd-lane-chart";
44
+
45
+ export default {
46
+ components: {
47
+ KdLaneContainer,
48
+ frameLayout,
49
+ },
50
+ };
51
+ ```
52
+
53
+ ---
54
+
55
+ ## KdLaneContainer(泳道图)
56
+
57
+ 泳道图组件,用于展示钻井相关的车道数据。
58
+
59
+ ### 基本用法
60
+
61
+ ```vue
62
+ <template>
63
+ <kd-lane-container
64
+ :config="config"
65
+ :datas="datas"
66
+ theme-name="dark"
67
+ />
68
+ </template>
69
+
70
+ <script>
71
+ export default {
72
+ data() {
73
+ return {
74
+ config: { /* 泳道图配置 */ },
75
+ datas: { /* 数据 */ },
76
+ };
77
+ },
78
+ };
79
+ </script>
80
+ ```
81
+
82
+ ### Props
83
+
84
+ | 参数 | 类型 | 说明 |
85
+ |---|---|---|
86
+ | config | Object | 泳道图配置 |
87
+ | datas | Object | 数据 |
88
+ | themeName | String | 主题:`white` / `dark` / `gray` |
89
+
90
+ ---
91
+
92
+ ## frameLayout(实时曲线)
93
+
94
+ 实时曲线图表容器,支持井深/时间两种曲线类型、实时/历史数据、多主题、滚动加载等。
95
+
96
+ ### 基本用法
97
+
98
+ ```vue
99
+ <template>
100
+ <frame-layout
101
+ ref="frameLayout"
102
+ :depthConfig="depthConfig"
103
+ :timeConfig="timeConfig"
104
+ :curveDatas="curveDatas"
105
+ :themeName="themeName"
106
+ :toolBarConfig="toolBarConfig"
107
+ :parameterPanelConfig="parameterPanelConfig"
108
+ :WellBitDepthTimePlotConfig="WellBitDepthTimePlotConfig"
109
+ :warningData="warningData"
110
+ @template-change="onTemplateChange"
111
+ @line-change="onLineChange"
112
+ @chart-scroll="onChartScroll"
113
+ @updateSettings="onUpdateSettings"
114
+ @visibleDataChange="onVisibleDataChange"
115
+ @dialogFunction="onDialog"
116
+ @refresh="onRefresh"
117
+ >
118
+ <template v-for="lane in headerSlotName" :slot="lane.laneId">
119
+ <div class="header-slot">{{ lane.laneName }}</div>
120
+ </template>
121
+ <template v-for="lane in contentSlotName" :slot="lane.laneId">
122
+ <div class="content-slot">
123
+ <resizeEcharts autoresize :options="contentSlotOptions[lane.contentKey]" />
124
+ </div>
125
+ </template>
126
+ </frame-layout>
127
+ </template>
128
+ ```
129
+
130
+ ### Props
131
+
132
+ | 参数 | 类型 | 说明 |
133
+ |---|---|---|
134
+ | depthConfig | Object | 井深配置(templates、params) |
135
+ | timeConfig | Object | 时间配置(templates、params) |
136
+ | curveDatas | Object | 曲线数据,`{ type: "replace" / "append", data: [...] }` |
137
+ | themeName | String | 主题:`white` / `dark` / `gray` |
138
+ | toolBarConfig | Object | 工具栏配置 |
139
+ | parameterPanelConfig | Object | 参数面板配置 |
140
+ | WellBitDepthTimePlotConfig | Object | 井深-钻头-时间曲线面板配置 |
141
+ | warningData | Array | 预警数据 |
142
+
143
+ ### 事件
144
+
145
+ | 事件 | 参数 | 说明 |
146
+ |---|---|---|
147
+ | @template-change | data | 模板变更 |
148
+ | @line-change | line | 曲线变更 |
149
+ | @chart-scroll | { direction, currentData } | 图表滚动(方向 top/bottom) |
150
+ | @updateSettings | { key, value, settings } | 设置变更 |
151
+ | @visibleDataChange | { firstValue, lastValue } | 可见数据范围变更 |
152
+ | @dialogFunction | { type, start, end } | 弹窗(1-井深段,2-时间段,3-导出) |
153
+ | @refresh | — | 刷新 |
154
+ | @onCustomMenuClicked | — | 自定义菜单点击 |
155
+
156
+ ### 曲线数据格式
157
+
158
+ ```js
159
+ // 初始化/替换数据
160
+ curveDatas: { type: "replace", data: [...] }
161
+
162
+ // 追加数据(实时更新)
163
+ curveDatas: { type: "append", data: generator() }
164
+ ```
165
+
166
+ ---
167
+
168
+ ## License
169
+
170
+ MIT