-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
327 lines (315 loc) · 15.2 KB
/
Copy pathindex.html
File metadata and controls
327 lines (315 loc) · 15.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>VizForm Studio</title>
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<main class="app-shell">
<aside class="sidebar" aria-label="visualization controls">
<div class="brand-block">
<p class="eyebrow">VizForm Studio</p>
<h1>上传数据,直接生成可视化表单</h1>
<p>支持 Excel 解析和截图预览,选择 ECharts 表达方式与样式后即时输出。</p>
</div>
<section class="control-group">
<div class="group-head">
<span>01</span>
<h2>输入</h2>
</div>
<label class="upload-zone" for="fileInput">
<input id="fileInput" type="file" accept=".xlsx,.xls,.csv,image/*" />
<span class="upload-icon" aria-hidden="true">+</span>
<strong>上传 Excel / CSV / 截图</strong>
<small id="fileMeta">也可以先使用示例数据</small>
</label>
<label class="upload-zone mockup-upload" for="mockupInput">
<input id="mockupInput" type="file" accept="image/*" />
<span class="upload-icon" aria-hidden="true">□</span>
<strong>上传高保真页面</strong>
<small id="mockupMeta">页面会常驻在右侧无限画布中</small>
</label>
<div class="button-row">
<button class="secondary" id="sampleSales" type="button">销售数据</button>
<button class="secondary" id="sampleOps" type="button">运营指标</button>
<button class="secondary" id="sampleEcom" type="button">电商指标</button>
</div>
</section>
<section class="control-group">
<div class="group-head">
<span>02</span>
<h2>电商指标库</h2>
</div>
<div class="metric-library" id="metricLibrary">
<div>
<p>经营结果</p>
<button class="metric-chip is-active" data-metric="GMV" type="button">GMV</button>
<button class="metric-chip" data-metric="订单量" type="button">订单量</button>
<button class="metric-chip" data-metric="客单价" type="button">客单价</button>
<button class="metric-chip" data-metric="毛利率" type="button">毛利率</button>
</div>
<div>
<p>流量转化</p>
<button class="metric-chip" data-metric="UV" type="button">UV</button>
<button class="metric-chip" data-metric="PV" type="button">PV</button>
<button class="metric-chip" data-metric="支付转化率" type="button">支付转化率</button>
<button class="metric-chip" data-metric="点击率" type="button">点击率</button>
</div>
<div>
<p>订单履约</p>
<button class="metric-chip" data-metric="退款率" type="button">退款率</button>
<button class="metric-chip" data-metric="发货时长" type="button">发货时长</button>
<button class="metric-chip" data-metric="履约率" type="button">履约率</button>
</div>
<div>
<p>商品和用户</p>
<button class="metric-chip" data-metric="售罄率" type="button">售罄率</button>
<button class="metric-chip" data-metric="库存周转" type="button">库存周转</button>
<button class="metric-chip" data-metric="复购率" type="button">复购率</button>
<button class="metric-chip" data-metric="留存率" type="button">留存率</button>
</div>
</div>
</section>
<section class="control-group">
<div class="group-head">
<span>03</span>
<h2>表达形式</h2>
</div>
<div class="template-grid" role="listbox" aria-label="ECharts templates">
<button class="template-card is-active" data-template="bar" type="button">
<span class="mini-chart bars"><i></i><i></i><i></i></span>
<strong>基础柱状</strong>
<small>类目对比</small>
</button>
<button class="template-card" data-template="stacked-bar" type="button">
<span class="mini-chart stacked"><i></i><i></i><i></i></span>
<strong>堆叠柱状</strong>
<small>分组构成</small>
</button>
<button class="template-card" data-template="line" type="button">
<span class="mini-chart line"><i></i></span>
<strong>平滑折线</strong>
<small>趋势变化</small>
</button>
<button class="template-card" data-template="area-line" type="button">
<span class="mini-chart area"><i></i></span>
<strong>面积折线</strong>
<small>趋势体量</small>
</button>
<button class="template-card" data-template="pie" type="button">
<span class="mini-chart pie"></span>
<strong>环形饼图</strong>
<small>占比结构</small>
</button>
<button class="template-card" data-template="rose" type="button">
<span class="mini-chart rose"></span>
<strong>南丁格尔</strong>
<small>占比强调</small>
</button>
<button class="template-card" data-template="scatter" type="button">
<span class="mini-chart scatter"><i></i><i></i><i></i><i></i></span>
<strong>散点分布</strong>
<small>关系分布</small>
</button>
<button class="template-card" data-template="effectScatter" type="button">
<span class="mini-chart scatter"><i></i><i></i><i></i><i></i></span>
<strong>涟漪散点</strong>
<small>重点标记</small>
</button>
<button class="template-card" data-template="radar" type="button">
<span class="mini-chart radar-icon"></span>
<strong>雷达图</strong>
<small>多指标画像</small>
</button>
<button class="template-card" data-template="heatmap" type="button">
<span class="mini-chart heatmap-icon"><i></i><i></i><i></i><i></i></span>
<strong>热力图</strong>
<small>二维密度</small>
</button>
<button class="template-card" data-template="funnel" type="button">
<span class="mini-chart funnel-icon"><i></i><i></i><i></i></span>
<strong>漏斗图</strong>
<small>转化路径</small>
</button>
<button class="template-card" data-template="gauge" type="button">
<span class="mini-chart gauge-icon"></span>
<strong>仪表盘</strong>
<small>单指标状态</small>
</button>
<button class="template-card" data-template="treemap" type="button">
<span class="mini-chart treemap-icon"><i></i><i></i><i></i></span>
<strong>矩形树图</strong>
<small>层级占比</small>
</button>
<button class="template-card" data-template="sunburst" type="button">
<span class="mini-chart sunburst-icon"></span>
<strong>旭日图</strong>
<small>层级结构</small>
</button>
<button class="template-card" data-template="boxplot" type="button">
<span class="mini-chart boxplot-icon"><i></i></span>
<strong>箱线图</strong>
<small>分布离散</small>
</button>
<button class="template-card" data-template="candlestick" type="button">
<span class="mini-chart candle-icon"><i></i><i></i><i></i></span>
<strong>K 线图</strong>
<small>区间波动</small>
</button>
<button class="template-card" data-template="graph" type="button">
<span class="mini-chart graph-icon"><i></i><i></i><i></i></span>
<strong>关系图</strong>
<small>节点关系</small>
</button>
<button class="template-card" data-template="sankey" type="button">
<span class="mini-chart sankey-icon"><i></i><i></i><i></i></span>
<strong>桑基图</strong>
<small>流向分配</small>
</button>
<button class="template-card" data-template="parallel" type="button">
<span class="mini-chart parallel-icon"><i></i><i></i><i></i></span>
<strong>平行坐标</strong>
<small>多变量比较</small>
</button>
<button class="template-card" data-template="lines" type="button">
<span class="mini-chart line"><i></i></span>
<strong>路径线图</strong>
<small>流向轨迹</small>
</button>
<button class="template-card" data-template="map" type="button">
<span class="mini-chart map-icon"></span>
<strong>地图占位</strong>
<small>需地图数据</small>
</button>
<button class="template-card" data-template="custom" type="button">
<span class="mini-chart custom-icon"><i></i><i></i><i></i></span>
<strong>自定义系列</strong>
<small>custom series</small>
</button>
<button class="template-card" data-template="table" type="button">
<span class="mini-chart table-icon"><i></i><i></i><i></i></span>
<strong>数据表格</strong>
<small>ECharts graphic</small>
</button>
</div>
<label class="select-field">
<span>X 轴 / 类目</span>
<select id="xField"></select>
</label>
<label class="select-field">
<span>Y 轴 / 数值</span>
<select id="yField"></select>
</label>
<label class="select-field">
<span>系列 / 分组</span>
<select id="seriesField"></select>
</label>
</section>
<section class="control-group">
<div class="group-head">
<span>04</span>
<h2>ECharts 样式</h2>
</div>
<label class="select-field">
<span>主题</span>
<select id="themeSelect">
<option value="executive">Executive</option>
<option value="fresh">Fresh</option>
<option value="mono">Mono</option>
<option value="contrast">Contrast</option>
</select>
</label>
<div class="toggle-grid">
<label class="check-row"><input id="smoothLine" type="checkbox" checked /> 平滑曲线</label>
<label class="check-row"><input id="showArea" type="checkbox" /> 面积填充</label>
<label class="check-row"><input id="showLegend" type="checkbox" checked /> 图例</label>
<label class="check-row"><input id="showGrid" type="checkbox" checked /> 网格线</label>
</div>
</section>
</aside>
<section class="workspace">
<header class="topbar">
<div>
<p class="eyebrow">Output</p>
<h2 id="datasetTitle">可视化表单</h2>
</div>
<div class="top-actions">
<button class="secondary icon-button" id="zoomOut" type="button" title="缩小">−</button>
<button class="secondary icon-button" id="zoomReset" type="button" title="复位画布">100%</button>
<button class="secondary icon-button" id="zoomIn" type="button" title="放大">+</button>
<button class="secondary icon-button" id="downloadPng" type="button" title="导出 PNG">PNG</button>
<button class="primary" id="copyOption" type="button">复制 ECharts Option</button>
</div>
</header>
<section class="result-band">
<div class="canvas-toolbar" aria-label="canvas status">
<span id="canvasStatus">拖拽画布查看页面与指标,滚轮缩放</span>
<span id="zoomLabel">100%</span>
</div>
<div class="canvas-viewport" id="canvasViewport" tabindex="0" aria-label="infinite canvas workspace">
<div class="canvas-world" id="canvasWorld">
<article class="mockup-node canvas-node">
<div class="node-head">
<span>高保真页面</span>
<small id="mockupNodeLabel">未上传</small>
</div>
<div class="mockup-stage" id="mockupStage">
<img id="mockupPreview" alt="uploaded high fidelity page" hidden />
<div class="mockup-placeholder" id="mockupPlaceholder">
<strong>上传页面后会固定在这里</strong>
<span>支持 PNG / JPG / WebP 截图,用来和右侧指标保持同屏对照。</span>
</div>
</div>
</article>
<article class="metrics-node canvas-node">
<div class="node-head">
<span>指标快照</span>
<small id="sourceLabel">电商核心指标</small>
</div>
<div class="kpi-strip" id="kpiStrip" aria-label="ecommerce metric summary"></div>
</article>
<article class="chart-node canvas-node">
<div class="node-head">
<span id="canvasDatasetTitle">可视化表单</span>
<small id="chartLabel">柱状图</small>
</div>
<div class="chart-stage">
<div id="chart" aria-label="echarts chart"></div>
</div>
</article>
<article class="inspector canvas-node">
<p class="panel-label">当前配置</p>
<dl>
<div><dt>字段</dt><dd id="fieldLabel">月份 / 销售额</dd></div>
<div><dt>画布</dt><dd id="canvasModeLabel">高保真页面 + 指标常驻</dd></div>
</dl>
<div class="preview-frame" id="imagePreviewWrap" hidden>
<p>截图数据草稿</p>
<img id="imagePreview" alt="uploaded screenshot preview" />
</div>
</article>
</div>
</div>
</section>
<section class="data-editor">
<div class="section-head">
<div>
<p class="eyebrow">Editable Data</p>
<h2>数据表</h2>
</div>
<button class="secondary" id="addRow" type="button">新增行</button>
</div>
<div class="table-wrap">
<table id="dataTable"></table>
</div>
</section>
</section>
</main>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
<script src="./script.js"></script>
</body>
</html>