Select in Box works incorrectly for parallel connections
See original GitHub issuePrerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Running the latest version of Constellation
- Attached the Support Package via
Help
>Support Package
- Checked the FAQs: https://github.com/constellation-app/constellation/wiki/FAQ
- Checked that your issue isn’t already filed: https://github.com/constellation-app/constellation/issues
- Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/wiki/Catalogue-of-Repositories
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
- Create a graph with 2 nodes.
- On the graph, ensure all transactions are individually shown, using the Transactions (no merging) toggle on the left hand button pane.
- Open the table view.
- Add multiple (3) transactions between these nodes.
- Zoom in across the transaction lines so that there is a clear gap on the graph between each transaction.
- Left click and drag on the graph to display the selection rectangle but ensure only the central transaction overlaps the rectangle.
- 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.
- 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.
- View that upon releasing the mouse, no transaction lines are selected, and no transactions are selected in the table view.
Expected behaviour:
- Step 7 (above) should only highlight the central transaction, with the corresponding transaction also highlighted in table view.
- Step 9 should highlight the transaction that intersected the selection rectangle and the corresponding transaction should be highlighted in table view.
Actual behaviour:
- Step 7 selects all transactions between the two nodes, these transactions are all highlighted in table view as well.
- 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:
- Created 3 years ago
- Comments:11 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@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.