@basic-genomics/hivtrace-viz 1.1.6 → 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 +65 -1
- package/dist/hivtrace.js +1 -1
- package/dist/hivtrace.js.map +1 -1
- package/package.json +1 -1
package/dist/embed/index.html
CHANGED
|
@@ -886,8 +886,24 @@
|
|
|
886
886
|
|
|
887
887
|
<div id="trace-attributes" class="tab-pane">
|
|
888
888
|
<div class="hivtrace-attributes-container">
|
|
889
|
-
<!--
|
|
889
|
+
<!-- 顶部:簇选择器 + 属性选择器(横向 pills) -->
|
|
890
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 -->
|
|
891
907
|
<div class="hivtrace-pill-row" data-hivtrace-ui-role="attributes_cat"></div>
|
|
892
908
|
</div>
|
|
893
909
|
|
|
@@ -1225,7 +1241,55 @@
|
|
|
1225
1241
|
}
|
|
1226
1242
|
})();
|
|
1227
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;
|
|
1228
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
|
+
})();
|
|
1229
1293
|
|
|
1230
1294
|
|
|
1231
1295
|
|