@basic-genomics/hivtrace-viz 1.2.1 → 1.2.3

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.
@@ -312,10 +312,29 @@
312
312
 
313
313
  .hivtrace-pill-row {
314
314
  display: flex;
315
- flex-wrap: wrap;
315
+ flex-wrap: nowrap;
316
316
  gap: 8px;
317
- max-height: 120px;
318
- overflow-y: auto;
317
+ overflow-x: auto;
318
+ padding: 4px 0 8px 0;
319
+ }
320
+
321
+ /* Horizontal scrollbar for pill row */
322
+ .hivtrace-pill-row::-webkit-scrollbar {
323
+ height: 6px;
324
+ }
325
+
326
+ .hivtrace-pill-row::-webkit-scrollbar-track {
327
+ background: #f1f1f1;
328
+ border-radius: 3px;
329
+ }
330
+
331
+ .hivtrace-pill-row::-webkit-scrollbar-thumb {
332
+ background: #c1c1c1;
333
+ border-radius: 3px;
334
+ }
335
+
336
+ .hivtrace-pill-row::-webkit-scrollbar-thumb:hover {
337
+ background: #a1a1a1;
319
338
  }
320
339
 
321
340
  /* 横向 Pill 样式 */
@@ -958,6 +977,30 @@
958
977
  }
959
978
  );
960
979
 
980
+ // 传递自定义上下文菜单项配置
981
+ var customContextMenuItems = options && options.customContextMenuItems;
982
+ if (customContextMenuItems && Array.isArray(customContextMenuItems) && customContextMenuItems.length > 0) {
983
+ user_graph.customContextMenuItems = customContextMenuItems;
984
+
985
+ // 设置菜单项点击回调,通过 postMessage 发送事件到宿主应用
986
+ user_graph.onCustomMenuItemClick = function (itemId, clusterInfo) {
987
+ window.parent.postMessage({
988
+ type: 'CUSTOM_MENU_CLICK',
989
+ itemId: itemId,
990
+ clusterInfo: {
991
+ cluster_id: clusterInfo.cluster_id,
992
+ node_count: clusterInfo.node_count,
993
+ cluster_size: clusterInfo.cluster_size,
994
+ position: { x: clusterInfo.x, y: clusterInfo.y },
995
+ state: { expanded: clusterInfo.expanded, fixed: clusterInfo.fixed },
996
+ node_ids: Array.isArray(clusterInfo.nodes)
997
+ ? clusterInfo.nodes.slice(0, 100).map(function (n) { return n.id; }).filter(Boolean)
998
+ : []
999
+ }
1000
+ }, '*');
1001
+ };
1002
+ }
1003
+
961
1004
  if (user_graph.is_empty()) {
962
1005
  HandleAppError(
963
1006
  "This network contains no clusters and cannot be displayed"
@@ -1349,6 +1392,31 @@
1349
1392
  // 直接替换数据
1350
1393
  user_graph.json = newGraph;
1351
1394
 
1395
+ // 更新自定义上下文菜单项(如果有变化)
1396
+ var customContextMenuItems = options && options.customContextMenuItems;
1397
+ if (customContextMenuItems && Array.isArray(customContextMenuItems) && customContextMenuItems.length > 0) {
1398
+ user_graph.customContextMenuItems = customContextMenuItems;
1399
+ // 确保回调已设置
1400
+ if (!user_graph.onCustomMenuItemClick) {
1401
+ user_graph.onCustomMenuItemClick = function (itemId, clusterInfo) {
1402
+ window.parent.postMessage({
1403
+ type: 'CUSTOM_MENU_CLICK',
1404
+ itemId: itemId,
1405
+ clusterInfo: {
1406
+ cluster_id: clusterInfo.cluster_id,
1407
+ node_count: clusterInfo.node_count,
1408
+ cluster_size: clusterInfo.cluster_size,
1409
+ position: { x: clusterInfo.x, y: clusterInfo.y },
1410
+ state: { expanded: clusterInfo.expanded, fixed: clusterInfo.fixed },
1411
+ node_ids: Array.isArray(clusterInfo.nodes)
1412
+ ? clusterInfo.nodes.slice(0, 100).map(function (n) { return n.id; }).filter(Boolean)
1413
+ : []
1414
+ }
1415
+ }, '*');
1416
+ };
1417
+ }
1418
+ }
1419
+
1352
1420
  // 执行必要的更新
1353
1421
  user_graph.update(false, 0.4);
1354
1422
 
package/dist/hivtrace.css CHANGED
@@ -12003,6 +12003,12 @@ circle.cluster {
12003
12003
  margin-top: 5px;
12004
12004
  }
12005
12005
 
12006
+ /* Statistics tab - scrollable content area without affecting tabs */
12007
+ #trace-attributes {
12008
+ overflow-y: auto;
12009
+ height: calc(100vh - 120px);
12010
+ }
12011
+
12006
12012
  /* Checkbox and label vertical alignment - only for hide_filter addon */
12007
12013
  input[data-hivtrace-ui-role="hide_filter"] {
12008
12014
  vertical-align: middle;