Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statement property pop-up for indirect edges centred on whole diagram and not on the edge in question #186

Open
StephenAbbott opened this issue Dec 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@StephenAbbott
Copy link
Member

Describe the bug
When testing example data including https://github.com/openownership/data-standard/blob/main/examples/mixed-direct-and-indirect-ownership.json and https://github.com/openownership/data-standard/blob/main/examples/multiple-indirect-ownership.json, the statement property pop-ups for most of the nodes and edges appear centred on the node/edge which the user has clicked on.

But with the indirect edges appearing at the bottom of the diagram for each of these two examples, clicking on that edge makes the pop-up window appear in the middle of the diagram rather than over the middle of the edge in question.

To Reproduce
Steps to reproduce the behavior:

  1. Paste this JSON into the visualiser tool and click 'Draw'
  2. Click on the owns 60% indirect edge going from Person 1 to Company B
  3. The statement property pop-up window should appear but is centred in the middle of the whole diagram not in the middle of the edge in question (see image below)

Expected behavior
The statement property pop-up window should appear centred on the middle of the edge the user has clicked rather than the middle of the whole diagram

Screenshots
Image

Desktop (please complete the following information):

  • OS: iOS
  • Browser: Chrome
  • Version: 130.0.6723.117 (Official Build) (arm64)
@StephenAbbott StephenAbbott added the bug Something isn't working label Dec 6, 2024
@codemacabre
Copy link
Collaborator

The reason this happens is that it uses the bounding box of the edge clicked, so in this example it uses the upper-most edge (i.e. where the edge curves upwards) as the top of the edge and places the tooltip there:

Image

To fix this will likely involve storing the mouse (or touch) position at the point of interaction and setting the tooltip's coordinates to that.

@StephenAbbott
Copy link
Member Author

@codemacabre Thanks for the response. This isn't a high-priority issue to fix so let's leave on the backlog for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants