Skip to content

Commit 2433d4c

Browse files
committed
Lint, test and implementation fixes
1 parent d680bd4 commit 2433d4c

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/plots/cartesian/axis_defaults.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
7575
coerce('range');
7676
containerOut.cleanRange();
7777

78-
coerce('showspikes');
79-
coerce('spikecolor');
80-
coerce('spikethickness');
81-
coerce('spikedash');
82-
coerce('spikemode');
78+
if(coerce2('showspikes')) {
79+
coerce2('spikecolor');
80+
coerce2('spikethickness');
81+
coerce2('spikedash');
82+
coerce2('spikemode');
83+
}
8384

8485
handleTickValueDefaults(containerIn, containerOut, coerce, axType);
8586
handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options);

src/plots/cartesian/graph_interact.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,10 @@ function hover(gd, evt, subplot) {
591591

592592
gd._hoverdata = newhoverdata;
593593

594-
if(hoverChanged(gd, evt, oldhoverdata)) {
594+
if(hoverChanged(gd, evt, oldhoverdata) && gd._hasCartesian) {
595595
var droplineOpts = {
596596
hovermode: hovermode,
597+
fullLayout: fullLayout,
597598
container: fullLayout._hoverlayer,
598599
outerContainer: fullLayout._paperdiv
599600
};
@@ -860,15 +861,15 @@ function createDroplines(hoverData, opts) {
860861
yAnchoredBase = yEdge - outerBBox.top,
861862
xBase = c0.ya.anchor === 'free' ? xFreeBase : xAnchoredBase,
862863
yBase = c0.xa.anchor === 'free' ? yFreeBase : yAnchoredBase,
863-
contrastColor = Color.combine(fullLayout.plot_bgcolor, fullLayout.paper_bgcolor),
864+
contrastColor = Color.combine(opts.fullLayout.plot_bgcolor, opts.fullLayout.paper_bgcolor),
864865
xColor = c0.xa.spikecolor ? c0.xa.spikecolor : (
865-
tinycolor.readability(c0.color,contrastColor) < 1.5 ? (
866-
tinycolor(c0.color).getBrightness() > 128 ? '#000' : Color.background)
867-
: c0.color),
866+
tinycolor.readability(c0.color, contrastColor) < 1.5 ? (
867+
tinycolor(c0.color).getBrightness() > 128 ? '#000' : Color.background) :
868+
c0.color),
868869
yColor = c0.ya.spikecolor ? c0.ya.spikecolor : (
869-
tinycolor.readability(c0.color,contrastColor) < 1.5 ? (
870-
tinycolor(c0.color).getBrightness() > 128 ? '#000' : Color.background)
871-
: c0.color),
870+
tinycolor.readability(c0.color, contrastColor) < 1.5 ? (
871+
tinycolor(c0.color).getBrightness() > 128 ? '#000' : Color.background) :
872+
c0.color),
872873
xThickness = c0.xa.spikethickness,
873874
yThickness = c0.ya.spikethickness,
874875
xDash = Drawing.dashStyle(c0.xa.spikedash, xThickness),

0 commit comments

Comments
 (0)