( model: StepsModel, edge: MapEdgeLayout, selected: string | null, reach?: ReadonlySet<string> )
| 1160 | * unregioned picture keeps the Map's rule. |
| 1161 | */ |
| 1162 | export function stepEdgeVisible( |
| 1163 | model: StepsModel, |
| 1164 | edge: MapEdgeLayout, |
| 1165 | selected: string | null, |
| 1166 | reach?: ReadonlySet<string> |
| 1167 | ): boolean { |
| 1168 | if (selected !== null) { |
| 1169 | const r = reach ?? selectionReach(model, selected); |
| 1170 | return r.has(edge.source) || r.has(edge.target); |
| 1171 | } |
| 1172 | if (edge.thin || edge.back) return false; |
| 1173 | // A hop too far to follow says itself in words on both its boxes instead |
| 1174 | // ({@link StepStub}); drawing it as well is the web those words replace. |
| 1175 | if (model.stubbed.has(edge.id)) return false; |
| 1176 | if (model.regions === null) return true; |
| 1177 | const from = model.nodes.get(edge.source)?.step; |
| 1178 | if (from?.anchor) return model.regionEntries?.has(edge.target) ?? true; |
| 1179 | return true; |
| 1180 | } |
| 1181 | |
| 1182 | /** The side panel's two lists for a selected step. */ |
| 1183 | export function stepNeighbourhood( |
no test coverage detected