diff --git a/src/ui/annotations.css b/src/ui/annotations.css index da60e397d..3e2b22a44 100644 --- a/src/ui/annotations.css +++ b/src/ui/annotations.css @@ -61,7 +61,7 @@ padding-right: 5px; } -.neuroglancer-annotation-description { +.neuroglancer-annotation-description, .neuroglancer-annotation-tags { grid-column: dim / -1; text-overflow: ellipsis; overflow: hidden; diff --git a/src/ui/annotations.ts b/src/ui/annotations.ts index b68dd487b..b70534b2a 100644 --- a/src/ui/annotations.ts +++ b/src/ui/annotations.ts @@ -936,6 +936,26 @@ export class AnnotationLayerView extends Tab { description.textContent = annotation.description; element.appendChild(description); } + const { + properties: { value: properties }, + } = state.source; + const activeTags: string[] = []; + for (let i = 0, count = properties.length; i < count; ++i) { + const property = properties[i]; + const value = annotation.properties[i]; + activeTags; + if (isAnnotationTagPropertySpec(property) && property.tag) { + if (value !== 0) { + activeTags.push(property.tag); + } + } + } + if (activeTags.length) { + const tags = document.createElement("div"); + tags.classList.add("neuroglancer-annotation-tags"); + tags.textContent = activeTags.map((x) => `#${x}`).join(" "); + element.appendChild(tags); + } icon.style.gridRow = `span ${numRows}`; if (deleteButton !== undefined) { deleteButton.style.gridRow = `span ${numRows}`;