Skip to content

Commit

Permalink
tooltip and viewerSettingPath (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrm authored Feb 28, 2024
1 parent bb349c4 commit 690c2db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/state/image-dataset/firebase/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ class FirebaseRequest implements ImageDataset {
if (this.viewerChannelSettings) {
return Promise.resolve(this.viewerChannelSettings);
}

if (!this.viewerSettingsPath) {
return Promise.resolve({} as ViewerChannelSettings);
}
return axios
.get(this.viewerSettingsPath)
.then((metadata: AxiosResponse) => metadata.data)
Expand Down
12 changes: 6 additions & 6 deletions src/state/image-dataset/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ export interface DatasetMetaData {
version: string;
id: string;
description: string;
image: string;
image?: string;
index: number;
link?: string;
manifest?: string;
production?: boolean;
userData: {
isNew: boolean;
inReview: boolean;
totalTaggedStructures: number;
totalCells: number;
totalFOVs: number;
isNew?: boolean;
inReview?: boolean;
totalTaggedStructures?: number;
totalCells?: number;
totalFOVs?: number;
};
}

Expand Down
3 changes: 2 additions & 1 deletion src/state/selection/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ export const getCategoryGroupColorsAndNames = createSelector(

// not truly a selector, it just seemed cleaner to make this one function instead of 3
// (2 for each axis and one for the color by)
// tooltip won't render if sent an empty string
export function getFeatureDefTooltip(key: string, options: MeasuredFeatureDef[]): string {
const data = find(options, { key: key });
if (data) {
if (data && data.tooltip) {
return data.tooltip;
}
return "";
Expand Down

0 comments on commit 690c2db

Please sign in to comment.