Skip to content

Commit

Permalink
fix(module:graph): fix @for track function (#8587)
Browse files Browse the repository at this point in the history
  • Loading branch information
HyperLife1119 committed Jun 24, 2024
1 parent b275063 commit 7687ff2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/graph/graph.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function isDataSource(value: NzSafeAny): value is NzGraphData {
<svg:g [attr.transform]="type === 'sub' ? subGraphTransform(renderNode) : null">
<svg:g class="core" [attr.transform]="coreTransform(renderNode)">
<svg:g class="nz-graph-edges">
@for (edge of $asNzGraphEdges(renderNode.edges); track edgeTrackByFun) {
@for (edge of $asNzGraphEdges(renderNode.edges); track edgeTrackByFun(edge)) {
<g
class="nz-graph-edge"
nz-graph-edge
Expand Down Expand Up @@ -171,7 +171,7 @@ export class NzGraphComponent implements OnInit, OnChanges, AfterContentChecked,
private _dataSubscription?: Subscription | null;
private destroy$ = new Subject<void>();

edgeTrackByFun = (_: number, edge: NzGraphEdge): string => `${edge.v}-${edge.w}`;
edgeTrackByFun = (edge: NzGraphEdge): string => `${edge.v}-${edge.w}`;

subGraphTransform = (node: NzGraphGroupNode): string => {
const x = node.x - node.coreBox.width / 2.0;
Expand Down

0 comments on commit 7687ff2

Please sign in to comment.