Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Feb 22, 2024
1 parent 0a56661 commit c4717f5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 31 deletions.
12 changes: 8 additions & 4 deletions src/segmentation_display_state/property_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,6 @@ export function executeSegmentQuery(
}
}


// Filter by tags
const { includeTags, excludeTags } = query;
const tagsProperty = db!.tags;
Expand Down Expand Up @@ -1021,7 +1020,12 @@ export function executeSegmentQuery(
const count = tagCounts[tagIndex];
const tag = tags[tagIndex];
const tagDesc = tagDescriptions[tagIndex];
const tagCount = { tag, tagIndex, count: tagCounts[tagIndex], desc: tagDesc };
const tagCount = {
tag,
tagIndex,
count: tagCounts[tagIndex],
desc: tagDesc,
};
if (query.includeTags.includes(tag) || query.excludeTags.includes(tag)) {
tagStatisticsInQuery.push(tagCount);
} else if (count > 0) {
Expand Down Expand Up @@ -1115,7 +1119,7 @@ function updatePropertyHistogram(
++histogram[
(Math.min(numBins - 1, Math.max(-1, (value - min) * multiplier)) +
1) >>>
0
0
];
}
}
Expand All @@ -1133,7 +1137,7 @@ function updatePropertyHistogram(
++histogram[
(Math.min(numBins - 1, Math.max(-1, (value - min) * multiplier)) +
1) >>>
0
0
];
}
}
Expand Down
61 changes: 34 additions & 27 deletions src/ui/segment_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ const tempUint64 = new Uint64();

abstract class SegmentListSource
extends RefCounted
implements VirtualListSource {
implements VirtualListSource
{
length: number;
changed = new Signal<(splices: readonly Readonly<ArraySpliceOp>[]) => void>();

Expand Down Expand Up @@ -273,21 +274,21 @@ class SegmentQueryListSource extends SegmentListSource {
this.selectedMatches =
queryResult.count > 0
? findQueryResultIntersectionSize(
segmentPropertyMap,
queryResult,
selectedSegments,
)
segmentPropertyMap,
queryResult,
selectedSegments,
)
: 0;
}

if (visibleChanged) {
this.visibleMatches =
queryResult.count > 0
? findQueryResultIntersectionSize(
segmentPropertyMap,
queryResult,
visibleSegments,
)
segmentPropertyMap,
queryResult,
visibleSegments,
)
: 0;
}

Expand Down Expand Up @@ -474,8 +475,9 @@ function updateColumnSortIcon(
const order = sortBy?.find((s) => s.fieldId === id)?.order;
sortIcon.textContent = order === ">" ? "▼" : "▲";
sortIcon.style.visibility = order === undefined ? "" : "visible";
sortIcon.title = `Sort by ${id} in ${order === "<" ? "descending" : "ascending"
} order`;
sortIcon.title = `Sort by ${id} in ${
order === "<" ? "descending" : "ascending"
} order`;
}

class NumericalPropertiesSummary extends RefCounted {
Expand Down Expand Up @@ -509,8 +511,9 @@ class NumericalPropertiesSummary extends RefCounted {
if (properties !== undefined && properties.length > 0) {
listElement = document.createElement("details");
const summaryElement = document.createElement("summary");
summaryElement.textContent = `${properties.length} numerical propert${properties.length > 1 ? "ies" : "y"
}`;
summaryElement.textContent = `${properties.length} numerical propert${
properties.length > 1 ? "ies" : "y"
}`;
listElement.appendChild(summaryElement);
listElement.classList.add(
"neuroglancer-segment-query-result-numerical-list",
Expand Down Expand Up @@ -728,7 +731,7 @@ class NumericalPropertiesSummary extends RefCounted {
updateInputBoundValue(
e,
this.bounds[boundType].value[propertyIndex][
endpointIndex
endpointIndex
] as number,
);
});
Expand Down Expand Up @@ -921,7 +924,7 @@ class NumericalPropertiesSummary extends RefCounted {
computeInvlerp(propertyHistogram.window, constraintBounds[0]),
),
) *
(numBins - 2),
(numBins - 2),
);
const constraintEndBin = Math.ceil(
Math.max(
Expand All @@ -931,7 +934,7 @@ class NumericalPropertiesSummary extends RefCounted {
computeInvlerp(propertyHistogram.window, constraintBounds[1]),
),
) *
(numBins - 2),
(numBins - 2),
);
const polyLine = makeCdfLine(
constraintStartBin,
Expand Down Expand Up @@ -995,8 +998,7 @@ function renderTagSummary(
// if the tag is different than desc, show both
if (tag !== desc && desc !== undefined && desc !== "") {
tagName.textContent = tag + " (" + desc + ")";
}
else {
} else {
tagName.textContent = tag;
}

Expand Down Expand Up @@ -1030,7 +1032,8 @@ function renderTagSummary(
"neuroglancer-segment-query-result-tag-toggle",
);
includeElement.classList.add(
`neuroglancer-segment-query-result-tag-${include ? "include" : "exclude"
`neuroglancer-segment-query-result-tag-${
include ? "include" : "exclude"
}`,
);
tagElement.appendChild(includeElement);
Expand All @@ -1057,8 +1060,9 @@ function renderTagSummary(
{
text: include ? "+" : "-",
enableTitle: `Add tag to ${include ? "required" : "exclusion"} set`,
disableTitle: `Remove tag from ${include ? "required" : "exclusion"
} set`,
disableTitle: `Remove tag from ${
include ? "required" : "exclusion"
} set`,
backgroundScheme: "dark",
},
).element,
Expand Down Expand Up @@ -1249,10 +1253,12 @@ abstract class SegmentListGroupBase extends RefCounted {
visibleSelectedCount > 0 && visibleSelectedCount !== totalDisplayed,
);
selectionStatusMessage.textContent = statusMessage;
copyAllSegmentsButton.title = `Copy all ${totalDisplayed} ${numMatches ? "matching" : "starred"
} segment(s)`;
copyVisibleSegmentsButton.title = `Copy ${visibleDisplayedCount} ${numMatches ? "visible matching" : "visible"
} segment(s)`;
copyAllSegmentsButton.title = `Copy all ${totalDisplayed} ${
numMatches ? "matching" : "starred"
} segment(s)`;
copyVisibleSegmentsButton.title = `Copy ${visibleDisplayedCount} ${
numMatches ? "visible matching" : "visible"
} segment(s)`;
copyAllSegmentsButton.style.visibility = totalDisplayed
? "visible"
: "hidden";
Expand All @@ -1276,8 +1282,9 @@ abstract class SegmentListGroupBase extends RefCounted {
);
let visibleToggleTitle: string;
if (!allVisible) {
visibleToggleTitle = `Click to show ${totalDisplayed - visibleDisplayedCount
} segment ID(s).`;
visibleToggleTitle = `Click to show ${
totalDisplayed - visibleDisplayedCount
} segment ID(s).`;
} else {
visibleToggleTitle = `Click to hide ${totalDisplayed} segment ID(s).`;
}
Expand Down

0 comments on commit c4717f5

Please sign in to comment.