mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 03:38:20 +08:00
fix(behaviors): fix optimize viewport transform does not hide edge arrow (#6217)
Co-authored-by: antv <antv@antfin.com>
This commit is contained in:
parent
e8f7a05702
commit
7cb9d269e0
@ -20,6 +20,7 @@ export const behaviorOptimizeViewportTransform: TestCase = async (context) => {
|
|||||||
style: {
|
style: {
|
||||||
labelFontSize: 8,
|
labelFontSize: 8,
|
||||||
labelText: (datum) => datum.id,
|
labelText: (datum) => datum.id,
|
||||||
|
startArrow: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
behaviors: ['drag-canvas', 'zoom-canvas', 'scroll-canvas', 'optimize-viewport-transform'],
|
behaviors: ['drag-canvas', 'zoom-canvas', 'scroll-canvas', 'optimize-viewport-transform'],
|
||||||
|
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 115 KiB |
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 108 KiB |
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 114 KiB |
@ -59,22 +59,16 @@ export class OptimizeViewportTransform extends BaseBehavior<OptimizeViewportTran
|
|||||||
this.bindEvents();
|
this.bindEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
private filterShapes = (shapes: DisplayObject[], classnames?: string[]) => {
|
|
||||||
return shapes.filter((shape) => shape.className && !classnames?.includes(shape.className));
|
|
||||||
};
|
|
||||||
|
|
||||||
private setElementsVisibility = (
|
private setElementsVisibility = (
|
||||||
elements: DisplayObject[],
|
elements: DisplayObject[],
|
||||||
visibility: BaseStyleProps['visibility'],
|
visibility: BaseStyleProps['visibility'],
|
||||||
excludedClassnames?: string[],
|
excludedClassnames?: string[],
|
||||||
) => {
|
) => {
|
||||||
elements.forEach((element) => {
|
elements.forEach((element) => {
|
||||||
setVisibility(
|
setVisibility(element, visibility, false, (shape) => {
|
||||||
element,
|
if (!shape.className) return true;
|
||||||
visibility,
|
return !excludedClassnames?.includes(shape.className);
|
||||||
false,
|
});
|
||||||
(shape) => !!shape.className && !excludedClassnames?.includes(shape.className),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user