question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select in Box works incorrectly for parallel connections

See original GitHub issue

Prerequisites

Description

When selecting connections using select in box, the plugin only checks if the box crosses the middle connection between the two nodes. If it does, all parallel connections are selected. If not, no connections between those nodes are selected.

Steps to Reproduce

  1. Create a graph with 2 nodes.
  2. On the graph, ensure all transactions are individually shown, using the Transactions (no merging) toggle on the left hand button pane.
  3. Open the table view.
  4. Add multiple (3) transactions between these nodes.
  5. Zoom in across the transaction lines so that there is a clear gap on the graph between each transaction.
  6. Left click and drag on the graph to display the selection rectangle but ensure only the central transaction overlaps the rectangle.
  7. View that upon releasing the mouse, all three transaction lines are selected, not just the centre one, additionally all three transactions are highlighted in the table view.
  8. Left click and drag on the graph to display the selection rectangle but ensure only one of the transactions (other than the central one) overlaps the rectangle.
  9. View that upon releasing the mouse, no transaction lines are selected, and no transactions are selected in the table view.

Expected behaviour:

  1. Step 7 (above) should only highlight the central transaction, with the corresponding transaction also highlighted in table view.
  2. Step 9 should highlight the transaction that intersected the selection rectangle and the corresponding transaction should be highlighted in table view.

Actual behaviour:

  1. Step 7 selects all transactions between the two nodes, these transactions are all highlighted in table view as well.
  2. Step 9 does not select any transactions and no transactions are highlighted in table view…

Reproduces how often:

100%

Additional Information

nil

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Nova-2119commented, Mar 18, 2021

Pull Request https://github.com/constellation-app/constellation/pull/992 fixes the issue described above when selecting vertices.

I have ran out of time to fix the issue when selecting transactions (this is harder) but here is what I have so far: The solution will rely on recreating the logic for splitting transactions used when rendering them to the graph (unlike verticies they have no location data we can access). The logic for this seems to rest in Line.gs:76-78. You cant test this by removing the “/ 32” from lies 77 & 78 and observing the change in distance between edges/transactions. I was unable to confirm what value(s) gData[0].q generally takes. Whoever picks this ticket up should figure that out first. After that it should be fairly straightforward to replicate this logic in the BoxSelectionPlugin to figure out what transactions are where and hence what should be selected.

Stretch goal: If you can figure out a way to decentralise the logic for offsetting transactions so that Line.gs and BoxSelectionPugin can refer to the same logic that would be better.

1reaction
Nova-2119commented, Sep 3, 2020

@aldebaran30701 You were pretty much bang on, I was able to take the r attribute and use that to find the extremities of the node. Then i just check if the box is outside the bounds of the opposite edge of the vertex. So I check if the right side of the box if to the left of the left side of the vertex. If any of these checks are true then the vertex isn’t in the box, if all are false then vertex is in the box. There’s some funky conversion stuff as well, but the way Constellation displays nodes means we don’t have to do anything more than convert the original coordinates which was already done for us! (If only I had realized that initially…)

Sadly I don’t think transactions will be able to use the same logic. Ive only just started looking, but I don’t believe they have a “location” or any sort of equivalent like nodes do. I’ll update here as I figure stuff out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parallel Query concerns - Ask TOM
I am working on Real time Replication. In my database I have already set the max parallel server 10. How can I resolve...
Read more >
10 Electrical Wiring Problems Solved - This Old House
Do you have an electrical wiring issue you're looking to fix? Read our guide to learn some common electrical problems you might face,...
Read more >
Lesson 6: Series/Parallel Circuits
A parallel circuit avoids this problem. Two bulbs in a simple parallel circuit each enjoy the full voltage of the battery. This is...
Read more >
Why does my parallel.ForEach method return the wrong values?
The issue is that when I use a parallel loop the records do not match and sometimes I will get an error on...
Read more >
Parallel resistors (article) - Khan Academy
The resistors in the following image are not in parallel. There are extra components (orange boxes) breaking up the common nodes between resistors....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found