Show numeric sub-variation edge values as bare numbers
Numeric dependsOn values (merge-type variations) are RFC edge values, not ATTR names. Display them as the number, not as "ATTR: N" or "subvariation N".
This commit is contained in:
parent
06b2bab5d3
commit
2060f109b6
@ -15,12 +15,13 @@ function shortView(node) {
|
|||||||
};
|
};
|
||||||
case 'instrument':
|
case 'instrument':
|
||||||
return { typeTag: 'instrument', label: node.name, meta: [] };
|
return { typeTag: 'instrument', label: node.name, meta: [] };
|
||||||
case 'variation':
|
case 'variation': {
|
||||||
return {
|
const dep = node.dependsOn;
|
||||||
typeTag: 'variation',
|
const label = dep == null ? '(root variation)'
|
||||||
label: node.dependsOn ? `ATTR: ${node.dependsOn}` : '(root variation)',
|
: isNaN(Number(dep)) ? `ATTR: ${dep}`
|
||||||
meta: [],
|
: String(dep);
|
||||||
};
|
return { typeTag: 'variation', label, meta: [] };
|
||||||
|
}
|
||||||
case 'label_spec':
|
case 'label_spec':
|
||||||
return { typeTag: 'label', label: node.label ?? '(no label)', meta: [] };
|
return { typeTag: 'label', label: node.label ?? '(no label)', meta: [] };
|
||||||
case 'bar':
|
case 'bar':
|
||||||
|
|||||||
@ -40,9 +40,13 @@ export const PaneSubObjects = {
|
|||||||
...node.labelSpecs.map(ls => ({
|
...node.labelSpecs.map(ls => ({
|
||||||
kind: 'label_spec', node: ls, label: ls.label ?? '(no label)',
|
kind: 'label_spec', node: ls, label: ls.label ?? '(no label)',
|
||||||
})),
|
})),
|
||||||
...node.subvariations.map((sv, idx) => ({
|
...node.subvariations.map((sv, idx) => {
|
||||||
kind: 'variation', node: sv, label: `subvariation ${idx + 1}`,
|
const dep = sv.dependsOn;
|
||||||
})),
|
const label = dep == null ? `subvariation ${idx + 1}`
|
||||||
|
: isNaN(Number(dep)) ? `ATTR: ${dep}`
|
||||||
|
: String(dep);
|
||||||
|
return { kind: 'variation', node: sv, label, hasChildren: true };
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (node.type === 'bar') {
|
if (node.type === 'bar') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user