docs: correct showspikes hovermode description - #7981
Conversation
emilykl
left a comment
There was a problem hiding this comment.
Hi @CAOShurong, thanks for working on this attribute description.
The correction isn't quite accurate: when showspikes is true, spikes are drawn according to the behavior specified by spikesnap (which defaults to drawing spikes at the closest data point).
Can you adjust the attribute description to read:
'Determines whether or not spikes (aka droplines) are drawn for this axis.',
'Note that spikes will never be drawn when `hovermode` is *false*.'|
Addressed the requested documentation wording in commit
The branch is ready for re-review. AI assistance remains disclosed in the PR body. |
The description claimed showspikes only takes effect when hovermode is 'closest'. In fact spikes are also drawn in 'x', 'y', 'x unified' and 'y unified' hovermodes: hover.js filters hoverData by ax.showspikes regardless of which cartesian hovermode is active (src/components/fx/hover.js, second spike-point block). The repo's own test suite asserts spikelines render with hovermode 'x' (test/jasmine/tests/hover_spikeline_test.js). Replaces the incorrect note with an accurate per-hovermode description. Fixes part of plotly#7595.
Signed-off-by: Shurong Cao <CAOShurong@users.noreply.github.com>
874b63b to
d5f9474
Compare
|
Follow-up in commit This addresses the two generated-artifact checks that were red on the previous push. The remaining red jobs in that run were the repository's flaky
|
|
The follow-up head |
|
@CAOShurong Thanks for the update, this looks ready to go. FWIW, I don't see a disclosure of AI assistance in the PR description. We don't require disclosure of AI assistance, but we do ask that changes related to plot interactivity or visuals are thoroughly verified in the browser before opening a PR. |
Fixes the documentation part of #7595.
The
showspikesdescription claimed:but this is not accurate. Spikes are drawn in all cartesian hovermodes:
src/components/fx/hover.js(the second spike-point block, whenhoverData.length !== 0) filters hover points bypoint.xa.showspikes/point.ya.showspikesregardless of which of x, y, x unified, y unified or closest is active — only the snap target differs (cursor position vs. nearest data point).hovermode: 'x':test/jasmine/tests/hover_spikeline_test.jscases around L506-521 expect 4 spikeline elements after hovering in x mode.Change: replaces the incorrect note with a per-hovermode description:
Docs-only change to one attribute description in
src/plots/cartesian/layout_attributes.js; no behavior change, so no new tests and no changelog entry beyond this fix.