Skip to content

Commit

Permalink
Changed property name in tooltip display to simplify
Browse files Browse the repository at this point in the history
Removed the master property name and only show subproperties.
  • Loading branch information
arjunrajlab committed Dec 6, 2023
1 parent 265ef7f commit 1601b39
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/AnnotationViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export default class AnnotationViewer extends Vue {
});
yOffset += 12;
for (const propertyPath of this.displayedPropertyPaths) {
const fullName = this.propertyStore.getFullNameFromPath(propertyPath);
const fullName = this.propertyStore.getSubIdsNameFromPath(propertyPath);
if (fullName) {
const propertyValues = this.propertyValues;
const propertyData: Map<string, string> = new Map();
Expand Down
25 changes: 25 additions & 0 deletions src/store/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,31 @@ export class Properties extends VuexModule {
return fullName;
};
}

get getSubIdsNameFromPath() {
return (propertyPath: string[]) => {
const propertyId = propertyPath[0];
if (!propertyId) {
return null;
}
const property = this.getPropertyById(propertyId);
if (!property) {
return null;
}
const propertyName = property.name;
const subIds = propertyPath.slice(1);

// Check if subIds array is empty
if (subIds.length === 0) {
// Return only the propertyName if there are no subIds
return propertyName;
} else {
// Otherwise, return the subIds joined by " / "
return subIds.join(" / ");
}
};
}


get uncomputedAnnotationsPerProperty() {
const uncomputed: { [propertyId: string]: IAnnotation[] } = {};
Expand Down

0 comments on commit 1601b39

Please sign in to comment.