@basic-genomics/hivtrace-viz 1.1.5 → 1.1.7
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/embed/hivtrace.js +1 -1
- package/dist/embed/hivtrace.js.map +1 -1
- package/dist/embed/index.html +117 -5
- package/dist/hivtrace.js +1 -1
- package/dist/hivtrace.js.map +1 -1
- package/package.json +1 -1
package/dist/embed/index.html
CHANGED
|
@@ -285,6 +285,54 @@
|
|
|
285
285
|
padding: 4px 12px;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
/* 簇选择器样式 */
|
|
289
|
+
.hivtrace-cluster-selector {
|
|
290
|
+
display: inline-flex;
|
|
291
|
+
align-items: stretch;
|
|
292
|
+
border: 1px solid #ccc;
|
|
293
|
+
border-radius: 4px;
|
|
294
|
+
background: #fff;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.hivtrace-cluster-selector-label {
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
justify-content: center;
|
|
301
|
+
padding: 6px 12px;
|
|
302
|
+
font-size: 13px;
|
|
303
|
+
color: #555;
|
|
304
|
+
background: #f5f5f5;
|
|
305
|
+
border-right: 1px solid #ccc;
|
|
306
|
+
white-space: nowrap;
|
|
307
|
+
min-width: 60px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.hivtrace-cluster-selector .input-group-btn {
|
|
311
|
+
display: flex;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.hivtrace-cluster-selector-btn {
|
|
315
|
+
border: none !important;
|
|
316
|
+
border-radius: 0 !important;
|
|
317
|
+
box-shadow: none !important;
|
|
318
|
+
min-width: 100px;
|
|
319
|
+
text-align: left;
|
|
320
|
+
display: flex;
|
|
321
|
+
align-items: center;
|
|
322
|
+
justify-content: space-between;
|
|
323
|
+
padding: 6px 12px;
|
|
324
|
+
font-size: 13px;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.hivtrace-cluster-selector-btn:hover,
|
|
328
|
+
.hivtrace-cluster-selector-btn:focus {
|
|
329
|
+
background: #f9f9f9;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.hivtrace-cluster-selector-btn .caret {
|
|
333
|
+
margin-left: 8px;
|
|
334
|
+
}
|
|
335
|
+
|
|
288
336
|
/* ========================================
|
|
289
337
|
属性标签页 - 新布局
|
|
290
338
|
顶部横向 pills + 下方左图右表
|
|
@@ -779,11 +827,11 @@
|
|
|
779
827
|
<div class="hivtrace-stats-container">
|
|
780
828
|
<!-- 顶部:Cluster 选择器工具栏 -->
|
|
781
829
|
<div class="hivtrace-stats-header">
|
|
782
|
-
<div class="
|
|
783
|
-
<span class="
|
|
830
|
+
<div class="hivtrace-cluster-selector">
|
|
831
|
+
<span class="hivtrace-cluster-selector-label">选择簇</span>
|
|
784
832
|
<div class="input-group-btn">
|
|
785
|
-
<button type="button" class="btn btn-default dropdown-toggle
|
|
786
|
-
id="stats_cluster_selector_btn">
|
|
833
|
+
<button type="button" class="btn btn-default dropdown-toggle hivtrace-cluster-selector-btn"
|
|
834
|
+
data-toggle="dropdown" id="stats_cluster_selector_btn">
|
|
787
835
|
<span id="stats_cluster_selector_label">总览</span> <span class="caret"></span>
|
|
788
836
|
</button>
|
|
789
837
|
<ul class="dropdown-menu" role="menu" id="stats_cluster_selector_menu">
|
|
@@ -838,8 +886,24 @@
|
|
|
838
886
|
|
|
839
887
|
<div id="trace-attributes" class="tab-pane">
|
|
840
888
|
<div class="hivtrace-attributes-container">
|
|
841
|
-
<!--
|
|
889
|
+
<!-- 顶部:簇选择器 + 属性选择器(横向 pills) -->
|
|
842
890
|
<div class="hivtrace-attributes-header">
|
|
891
|
+
<!-- 簇选择器 -->
|
|
892
|
+
<div style="margin-bottom: 12px;">
|
|
893
|
+
<div class="hivtrace-cluster-selector">
|
|
894
|
+
<span class="hivtrace-cluster-selector-label">选择簇</span>
|
|
895
|
+
<div class="input-group-btn">
|
|
896
|
+
<button type="button" class="btn btn-default dropdown-toggle hivtrace-cluster-selector-btn"
|
|
897
|
+
data-toggle="dropdown" id="attrs_cluster_selector_btn">
|
|
898
|
+
<span id="attrs_cluster_selector_label">总览</span> <span class="caret"></span>
|
|
899
|
+
</button>
|
|
900
|
+
<ul class="dropdown-menu" role="menu" id="attrs_cluster_selector_menu">
|
|
901
|
+
<li><a href="#" data-value="">总览</a></li>
|
|
902
|
+
</ul>
|
|
903
|
+
</div>
|
|
904
|
+
</div>
|
|
905
|
+
</div>
|
|
906
|
+
<!-- 属性 Pills -->
|
|
843
907
|
<div class="hivtrace-pill-row" data-hivtrace-ui-role="attributes_cat"></div>
|
|
844
908
|
</div>
|
|
845
909
|
|
|
@@ -1177,7 +1241,55 @@
|
|
|
1177
1241
|
}
|
|
1178
1242
|
})();
|
|
1179
1243
|
|
|
1244
|
+
// 初始化属性标签页的 cluster 选择器
|
|
1245
|
+
(function initAttrsClusterSelector() {
|
|
1246
|
+
var menu = document.getElementById('attrs_cluster_selector_menu');
|
|
1247
|
+
var label = document.getElementById('attrs_cluster_selector_label');
|
|
1248
|
+
if (!menu || !label) return;
|
|
1249
|
+
|
|
1250
|
+
// 获取所有 cluster 并按 ID 排序
|
|
1251
|
+
var clusters = user_graph.clusters || [];
|
|
1252
|
+
clusters = clusters.slice().sort(function (a, b) {
|
|
1253
|
+
return a.cluster_id - b.cluster_id;
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1256
|
+
// 填充 cluster 选项到 dropdown menu
|
|
1257
|
+
clusters.forEach(function (cluster) {
|
|
1258
|
+
var li = document.createElement('li');
|
|
1259
|
+
var a = document.createElement('a');
|
|
1260
|
+
a.href = '#';
|
|
1261
|
+
a.setAttribute('data-value', cluster.cluster_id);
|
|
1262
|
+
a.textContent = '簇 ' + cluster.cluster_id + ' (' + cluster.children.length + ' 节点)';
|
|
1263
|
+
li.appendChild(a);
|
|
1264
|
+
menu.appendChild(li);
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
// 监听 dropdown 菜单项点击
|
|
1268
|
+
menu.addEventListener('click', function (e) {
|
|
1269
|
+
if (e.target.tagName === 'A') {
|
|
1270
|
+
e.preventDefault();
|
|
1271
|
+
var selectedClusterId = e.target.getAttribute('data-value');
|
|
1272
|
+
var selectedText = e.target.textContent;
|
|
1273
|
+
|
|
1274
|
+
// 更新按钮文本
|
|
1275
|
+
label.textContent = selectedText;
|
|
1180
1276
|
|
|
1277
|
+
// 设置属性页的簇过滤
|
|
1278
|
+
user_graph.attributes_selected_cluster = selectedClusterId || null;
|
|
1279
|
+
|
|
1280
|
+
// 重新触发当前选中的属性(支持分类属性和连续属性)
|
|
1281
|
+
if (user_graph.colorizer && user_graph.colorizer['category_id']) {
|
|
1282
|
+
if (user_graph.colorizer['continuous']) {
|
|
1283
|
+
// 连续属性 - 散点图
|
|
1284
|
+
user_graph.handle_attribute_continuous(user_graph.colorizer['category_id']);
|
|
1285
|
+
} else {
|
|
1286
|
+
// 分类属性 - 弦图
|
|
1287
|
+
user_graph.handle_attribute_categorical(user_graph.colorizer['category_id'], false);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
});
|
|
1292
|
+
})();
|
|
1181
1293
|
|
|
1182
1294
|
|
|
1183
1295
|
|