|
|
@@ -968,19 +968,15 @@ export default function CategoryEffectTreeApp() {
|
|
|
|
|
|
const levelHeaders: LevelHeader[] = [];
|
|
|
for (let depth = 0; depth <= maxDepth; depth += 1) {
|
|
|
- const nodesAtDepth = layoutNodes.filter((node) => node.depth === depth);
|
|
|
- if (nodesAtDepth.length === 0) {
|
|
|
+ const categoryNodes = layoutNodes.filter(
|
|
|
+ (node) => node.depth === depth && node.kind === "category",
|
|
|
+ );
|
|
|
+ if (categoryNodes.length === 0) {
|
|
|
continue;
|
|
|
}
|
|
|
- const categoryNodes = nodesAtDepth.filter((node) => node.kind === "category");
|
|
|
- const elementOnly = categoryNodes.length === 0;
|
|
|
- let label = "元素";
|
|
|
- if (!elementOnly) {
|
|
|
- label = `L${depth + 1}`;
|
|
|
- }
|
|
|
levelHeaders.push({
|
|
|
depth,
|
|
|
- label,
|
|
|
+ label: `L${depth + 1}`,
|
|
|
x: depth * (NODE_WIDTH + COLUMN_GAP) + CANVAS_PADDING,
|
|
|
});
|
|
|
}
|