@@ -63,6 +63,11 @@ const originalIndex = computed(() => {
6363 }
6464 return Math .floor (Number (originalId));
6565});
66+ const RESERVED_ATTRIBUTE_KEYS = new Set ([
67+ " coordinates" ,
68+ " vtkOriginalCellIds" ,
69+ " vtkOriginalPointIds" ,
70+ ]);
6671
6772const hasOtherAttributes = computed (() => {
6873 const attributes = hybridViewerStore .hoverData ? .attributes || {};
@@ -71,6 +76,16 @@ const hasOtherAttributes = computed(() => {
7176 );
7277});
7378
79+ const sortedAttributes = computed (() => {
80+ const attributes = hybridViewerStore .hoverData ? .attributes || {};
81+ return (
82+ Object .entries (attributes)
83+ .filter (([key ]) => ! RESERVED_ATTRIBUTE_KEYS .has (key))
84+ // oxlint-disable-next-line unicorn/no-array-sort
85+ .sort (([keyA ], [keyB ]) => keyA .localeCompare (keyB))
86+ );
87+ });
88+
7489function capitalize (val ) {
7590 if (! val) {
7691 return " " ;
@@ -156,15 +171,8 @@ function formatAttributeValue(val) {
156171 {{ Number (hybridViewerStore .hoverData .attributes .coordinates [2 ]).toFixed (3 ) }} ]
157172 < / span>
158173 < / v- col>
159- < template v- for = " (val, name) in hybridViewerStore.hoverData.attributes" : key= " name" >
160- < v- col
161- v- if = "
162- name !== 'coordinates' &&
163- name !== 'vtkOriginalCellIds' &&
164- name !== 'vtkOriginalPointIds'
165- "
166- class = " d-flex justify-space-between ga-3"
167- >
174+ < template v- for = " [name, val] in sortedAttributes" : key= " name" >
175+ < v- col class = " d-flex justify-space-between ga-3" >
168176 < span class = " tooltip-label" > {{ capitalize (name) }}: < / span>
169177 < span class = " tooltip-value font-mono" >
170178 {{ formatAttributeValue (val) }}
@@ -183,7 +191,7 @@ function formatAttributeValue(val) {
183191 pointer- events: none;
184192 z- index: 4 ;
185193 min- width: 200px ;
186- max- width: 450px ;
194+ max- width: max - content ;
187195 transition: opacity 0 .15s ease;
188196}
189197.font - mono {
@@ -197,10 +205,12 @@ function formatAttributeValue(val) {
197205.tooltip - label {
198206 color: #bdbdbd;
199207 font- weight: bold;
208+ white- space: nowrap;
200209}
201210.tooltip - value {
202211 color: #a7ffeb;
203212 font- weight: 500 ;
213+ white- space: nowrap;
204214}
205215.tooltip - value- dim {
206216 color: #eeeeee;
0 commit comments