From 021143a74e4e420c2c60e51fed28d3342f7108a9 Mon Sep 17 00:00:00 2001 From: jinhan Date: Tue, 5 Dec 2023 11:30:59 -0500 Subject: [PATCH] attemp to display calculated distance in selection panel --- src/main.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index a9c88d0..4987e4c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -192,14 +192,15 @@ function observeSegmentSelect(targetNode: Element) { const updateSelectionDetailsBody = function(item: HTMLElement) { if (item.classList) { let selectionList: Element|HTMLElement[] = []; - if (item.classList.contains("neuroglancer-annotation-list-entry")) { + if (item.classList.contains("neuroglancer-selection-details-layer")) { //neuroglancer-annotation-list-entry selectionList = [item]; } selectionList.forEach(item => { - const positionGrid = item.querySelector(".neuroglancer-annotation-position") - const isDataBounds = item.querySelector(".neuroglancer-annotation-description")?.textContent === "Data Bounds" ? true : false; - if (positionGrid && !isDataBounds) { - const coordElements = item.querySelectorAll(' .neuroglancer-annotation-coordinate'); + // const positionGrid = item.querySelector(".neuroglancer-selected-annotation-details-position")//.neuroglancer-annotation-position + const isDataBounds = false // item.querySelector(".neuroglancer-annotation-details-description")?.textContent === "Data Bounds" ? true : false; //.neuroglancer-annotation-description + if (!isDataBounds) { + const coordElements = item.querySelectorAll('.neuroglancer-selected-annotation-details-position-coord'); //.neuroglancer-annotation-coordinate + console.log(coordElements) let coordinates: Point3D[] = []; for (let i = 0; i < coordElements?.length; i += 3){ @@ -245,7 +246,7 @@ function observeSegmentSelect(targetNode: Element) { // Convert existing items targetNode.querySelectorAll('.neuroglancer-segment-list-entry').forEach(updateSegmentSelectItem); - targetNode.querySelectorAll('.neuroglancer-annotation-list-entry').forEach(updateSelectionDetailsBody); + targetNode.querySelectorAll('.neuroglancer-selection-details-layer').forEach(updateSelectionDetailsBody);//neuroglancer-annotation-list-entry } function liveNeuroglancerInjection() {