Skip to content

Commit

Permalink
fix: fallback handling to ignore invisible elements (#6563)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonneyx authored Nov 27, 2024
1 parent 23e6bf0 commit 49ec991
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/g6/src/transforms/place-radial-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export class PlaceRadialLabels extends BaseTransform<PlaceRadialLabelsOptions> {
const isLeft = Math.abs(radian) > Math.PI / 2;

const isLeaf = !datum.children || datum.children.length === 0;
const nodeHalfWidth = parseSize(graph.getElementRenderStyle(idOf(datum)).size)[0] / 2;
const nodeId = idOf(datum);
const node = this.context.element?.getElement(nodeId);
if (!node || !node.isVisible()) return;

const nodeHalfWidth = parseSize(graph.getElementRenderStyle(nodeId).size)[0] / 2;
const offset = (isLeaf ? 1 : -1) * (nodeHalfWidth + this.options.offset);

const labelTransform: TransformArray = [
Expand Down

0 comments on commit 49ec991

Please sign in to comment.