refactor(minimap): do not show hidden nodes #5078
This commit is contained in:
@@ -15,6 +15,8 @@ import type { MiniMapProps } from './types';
|
|||||||
const defaultWidth = 200;
|
const defaultWidth = 200;
|
||||||
const defaultHeight = 150;
|
const defaultHeight = 150;
|
||||||
|
|
||||||
|
const filterHidden = (node: Node) => !node.hidden;
|
||||||
|
|
||||||
const selector = (s: ReactFlowState) => {
|
const selector = (s: ReactFlowState) => {
|
||||||
const viewBB: Rect = {
|
const viewBB: Rect = {
|
||||||
x: -s.transform[0] / s.transform[2],
|
x: -s.transform[0] / s.transform[2],
|
||||||
@@ -25,7 +27,10 @@ const selector = (s: ReactFlowState) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
viewBB,
|
viewBB,
|
||||||
boundingRect: s.nodeLookup.size > 0 ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup), viewBB) : viewBB,
|
boundingRect:
|
||||||
|
s.nodeLookup.size > 0
|
||||||
|
? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB)
|
||||||
|
: viewBB,
|
||||||
rfId: s.rfId,
|
rfId: s.rfId,
|
||||||
panZoom: s.panZoom,
|
panZoom: s.panZoom,
|
||||||
translateExtent: s.translateExtent,
|
translateExtent: s.translateExtent,
|
||||||
|
|||||||
Reference in New Issue
Block a user