Display the number of duplicate links between nodes in d3 graph visualization

Created on 23 April 2025, 2 months ago

Problem/Motivation

The entity_mesh module currently uses a d3-based graphic to visualize node connections, with nodes represented as balls and connections as lines. However, when a source node has multiple links to the same target node, the visualization only shows a single line, making it impossible to determine the actual number of connections between those nodes. This limits the usefulness of the visualization in scenarios where multiple relationships exist between the same pair of entities.

Steps to reproduce

  1. Create two nodes/entities in a configuration where the source can have multiple links to the same target (e.g., through repeated references or relationships).
  2. Ensure that the source node has more than one link to the same target node.
  3. View the d3 visualization provided by entity_mesh.
  4. Observe that only a single line is displayed between the two nodes, regardless of the actual number of links.

Proposed resolution

Enhance the d3 visualization so that when there are multiple links between the same pair of nodes, a number is displayed on or near the connecting line, indicating the count of links from the source to the target. This would allow users to accurately interpret the relationships and better understand the underlying data structure.

Remaining tasks

  • Update the d3 rendering logic to detect multiple links between the same node pair.
  • Display a count on the line when the link count is greater than one.
  • Add visual or design adjustments as necessary to ensure readability of the link count label.
  • Test the updated visualization with multiples data sets.
  • Update documentation if needed.

User interface changes

When multiple links exist between two nodes, a numeric label will be displayed on the line connecting them in the d3 graph. No other UI changes are expected.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇪🇸Spain eduardo morales alberti Spain, 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024