Skip to content

Commit 8c7ac76

Browse files
committed
Move spike setup from axis to layout.
Fix 'across' for right-side axes.
1 parent 34a1562 commit 8c7ac76

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/plots/cartesian/axis_defaults.js

-6
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
7575
coerce('range');
7676
containerOut.cleanRange();
7777

78-
coerce2('showspikes');
79-
coerce2('spikecolor');
80-
coerce2('spikethickness');
81-
coerce2('spikedash');
82-
coerce2('spikemode');
83-
8478
handleTickValueDefaults(containerIn, containerOut, coerce, axType);
8579
handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options);
8680
handleTickMarkDefaults(containerIn, containerOut, coerce, options);

src/plots/cartesian/graph_interact.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,9 @@ function createSpikelines(hoverData, opts) {
878878
yMarker = c0.ya.spikemode.indexOf('marker') !== -1,
879879
xSpikeLine = c0.xa.spikemode.indexOf('toaxis') !== -1 || c0.xa.spikemode.indexOf('across') !== -1,
880880
ySpikeLine = c0.ya.spikemode.indexOf('toaxis') !== -1 || c0.ya.spikemode.indexOf('across') !== -1,
881-
xEndSpike = c0.xa.spikemode.indexOf('across') !== -1 ? xBase + xLength : xPoint,
881+
xEndSpike = c0.xa.spikemode.indexOf('across') !== -1 ?
882+
(ySide === 'left' ? xBase + xLength : xBase - xLength) :
883+
xPoint,
882884
yEndSpike = c0.ya.spikemode.indexOf('across') !== -1 ? yBase - yLength : yPoint;
883885

884886
// Remove old spikeline items

src/plots/cartesian/layout_defaults.js

+6
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
173173

174174
handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions, layoutOut);
175175

176+
coerce('showspikes');
177+
coerce('spikecolor');
178+
coerce('spikethickness');
179+
coerce('spikedash');
180+
coerce('spikemode');
181+
176182
var positioningOptions = {
177183
letter: axLetter,
178184
counterAxes: counterAxes[axLetter],

0 commit comments

Comments
 (0)