GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: Make hover label triangle optional by emilykl · Pull Request #7451 · plotly/plotly.js Conversation
|
|
@emilykl |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@archmoj not quite ready for review but I'll merge |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
1126715 to
63e44ab
Compare
| 'V' + pY(offsetY - HOVERARROWSIZE) + | ||
| 'Z')); | ||
| pathStr = 'M0,0L' + pX(horzSign * HOVERARROWSIZE + offsetX) + ',' + pY(HOVERARROWSIZE + offsetY) + | ||
| 'v' + pY(d.by / 2 - HOVERARROWSIZE) + |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
OMG math
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@gvwilson Coming up with the new SVG path string with no arrow was Claude Code's only helpful contribution to this PR (but it's a doozy, so, worth it)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@archmoj This is ready for review. A couple questions for you —
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
One could possibly add arrayOk to the Line 89 in 2cac1b1
For this PR I don't see a strong use case for that option. So IMHO it's a good idea to set arrayOk to false as you did.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
We could handle this option for parcats as follow: hoverItems.trace._hoverlabel = {showarrow: false}; before calling Then make the following change var showArrow = (d.trace._hoverlabel || d.trace.hoverlabel)?.showarrow; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
In addition to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Oh that's clever, I like that. Maybe for another PR. It would be cool too if we could just support all the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Instead of the solution proposed above, exports.loneHover = function loneHover(hoverItems, opts) { ... var gd = opts.gd; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I left some suggested feedback for you to consider.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| pathStr = 'M-' + pX(d.bx / 2 + d.tx2width / 2) + ',' + pY(offsetY - d.by / 2) + | ||
| 'h' + pX(d.bx) + 'v' + pY(d.by) + 'h-' + pX(d.bx) + 'Z'; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would you be up for using a template literal here and elsewhere?
| pathStr = 'M-' + pX(d.bx / 2 + d.tx2width / 2) + ',' + pY(offsetY - d.by / 2) + | |
| 'h' + pX(d.bx) + 'v' + pY(d.by) + 'h-' + pX(d.bx) + 'Z'; | |
| pathStr = `M-${pX(d.bx / 2 + d.tx2width / 2)},${pY(offsetY - d.by / 2)}h${pX(d.bx)}v${pY(d.by)}h-${pX(d.bx)}Z`; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We could leave refactoring for another PR.
Template literal may run slower: https://jsperf.app/es6-string-literals-vs-string-concatenation/43
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Have you seen any issues with this kind of calculation? I imagine that most computers are powerful enough where this isn't an issue.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Cameron DeCoster <[email protected]>
@emilykl Wondering if you tried this solution to fix the parcats and sankey traces? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I did, but I didn't like the complexity of the if/else logic it required. It felt like building a parallel system for logic that is already handled for traces which support |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
make hover box caret/triangle optional
There was an error while loading. Please reload this page.