Skip to content

Commit

Permalink
feat(annotation): add annotation ID and make properties selectable (#530
Browse files Browse the repository at this point in the history
)
  • Loading branch information
fcollman authored Feb 24, 2024
1 parent 96a56a9 commit 4ad2a18
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ui/annotations.css
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ div.neuroglancer-annotation-details-description {
flex-direction: row;
font-family: sans-serif;
font-size: small;
user-select: text;
}

.neuroglancer-annotation-property-label {
Expand Down
17 changes: 17 additions & 0 deletions src/ui/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,23 @@ export function UserLayerWithAnnotationsMixin<
const { relationships, properties } = annotationLayer.source;
const sourceReadonly = annotationLayer.source.readonly;

// Add the ID to the annotation details.
const label = document.createElement("label");
label.classList.add("neuroglancer-annotation-property");
const idElement = document.createElement("span");
idElement.classList.add(
"neuroglancer-annotation-property-label",
);
idElement.textContent = "ID";
label.appendChild(idElement);
const valueElement = document.createElement("span");
valueElement.classList.add(
"neuroglancer-annotation-property-value",
);
valueElement.textContent = reference.id;
label.appendChild(valueElement);
parent.appendChild(label);

for (let i = 0, count = properties.length; i < count; ++i) {
const property = properties[i];
const label = document.createElement("label");
Expand Down

0 comments on commit 4ad2a18

Please sign in to comment.