Skip to content

Commit

Permalink
Fix label placement
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippMDoerner committed Dec 9, 2024
1 parent c944574 commit c4d7c88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/design/organisms/graph/graph.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
forceSimulation,
forceX,
forceY,
pointer,
select,
selectAll,
Selection,
Expand Down Expand Up @@ -410,9 +411,8 @@ export class GraphService {
.select(SELECTORS.linkLabelSelector)
.style('opacity', '1')
.attr('transform', () => {
const centerX = event.layerX;
const centerY = event.layerY + 4;
return `translate(${centerX}, ${centerY}), scale(0.2)`;
const [centerX, centerY] = pointer(event);
return `translate(${centerX}, ${centerY + 6}), scale(0.2)`;
});

select(this)
Expand Down

0 comments on commit c4d7c88

Please sign in to comment.