Skip to content

Commit

Permalink
fix: fix passthrough connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
MindFreeze committed Apr 25, 2024
1 parent 094ac46 commit 00adfb4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ export function renderBranchConnectors(props: {
}): SVGTemplateResult[] {
const { boxes, size } = props.section;
return boxes
.filter(b => b.children.length > 0)
.filter(b => b.children.length > 0 || b.config.type === 'passthrough')
.map((b, boxIndex) => {
const children = props.nextSection!.boxes.filter(child =>
b.children.some(c => getEntityId(c) === child.entity_id),
const children = props.nextSection!.boxes.filter(
child =>
b.children.some(c => getEntityId(c) === child.entity_id) ||
(b.config.type === 'passthrough' && b.entity_id === child.entity_id),
);
const connections = getChildConnections(b, children, props.allConnections, props.connectionsByParent).filter(
c => {
Expand Down Expand Up @@ -89,7 +91,7 @@ export function renderSection(props: {
config: { min_width },
size,
} = props.section;
const hasChildren = props.nextSection && boxes.some(b => b.children.length > 0);
const hasChildren = props.nextSection && boxes.some(b => b.children.length > 0 || b.config.type === 'passthrough');

const viewBox = props.vertical ? `0 0 ${size} 100` : `0 0 100 ${size}`;
const minWidth = min_width && !props.vertical ? min_width + 'px' : undefined;
Expand Down

0 comments on commit 00adfb4

Please sign in to comment.