Fix missing cursor for ternary plot#7057
Merged
archmoj merged 9 commits intoplotly:masterfrom Jul 22, 2024
Merged
Conversation
archmoj
reviewed
Jul 22, 2024
archmoj
reviewed
Jul 22, 2024
Co-authored-by: Mojtaba Samimi <33888540+archmoj@users.noreply.github.com>
Co-authored-by: Mojtaba Samimi <33888540+archmoj@users.noreply.github.com>
update as suggusted
Contributor
Author
|
I also updated the - if(dragmode === 'pan') {
- toplevel.style('cursor', 'move');
- } else {
- toplevel.style('cursor', 'crosshair');
- }
+ toplevel.style('cursor', dragmode === 'pan' ? 'move' : 'crosshair'); |
archmoj
reviewed
Jul 22, 2024
src/plots/ternary/ternary.js
Outdated
Comment on lines
102
to
104
| var toplevel = this.plotContainer.selectAll('g.toplevel'); | ||
|
|
||
| toplevel.style('cursor', dragmode === 'pan' ? 'move' : 'crosshair'); |
Contributor
There was a problem hiding this comment.
Let's use _ternarylayer.
Suggested change
| var toplevel = this.plotContainer.selectAll('g.toplevel'); | |
| toplevel.style('cursor', dragmode === 'pan' ? 'move' : 'crosshair'); | |
| var fullLayout = gd._fullLayout; | |
| fullLayout._ternarylayer | |
| .selectAll('g.toplevel') | |
| .style('cursor', fullLayout.dragmode === 'pan' ? 'move' : 'crosshair'); |
Contributor
Author
There was a problem hiding this comment.
I have updated again with your sugguestion.
Also, I moved the updateFx function from proto.plot to the function Ternary(options, fullLayout) function so that the updateFx function is only triggered once at initialization instead of being called every time the plot is zoomed/panned and resized. What do you think?
update and clean as suggested
update and clean as suggested
archmoj
reviewed
Jul 22, 2024
src/plots/ternary/index.js
Outdated
|
|
||
| exports.updateFx = function(gd) { | ||
| var fullLayout = gd._fullLayout; | ||
|
|
Contributor
There was a problem hiding this comment.
Please run npm run lint -- --fix and commit the changes.
Suggested change
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fix #7056
This is my first contribution to such a large open source project. If I understand the coding style wrong or wrong logic for the fix, please let me know.