Skip to content

Commit e7edebd

Browse files
author
Jon M. Mease
committed
hovermode -> hoveron
1 parent 7e4a6ad commit e7edebd

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

src/traces/parcats/attributes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ module.exports = {
4444
editType: 'plot'
4545
// plotAttrs.hoverinfo description is appropriate
4646
}),
47-
hovermode: {
47+
hoveron: {
4848
valType: 'enumerated',
4949
values: ['category', 'color', 'dimension'],
5050
dflt: 'category',
5151
role: 'info',
5252
editType: 'plot',
5353
description: [
54-
'Sets the hover mode of the parcats diagram.',
54+
'Sets the hover interaction mode for the parcats diagram.',
5555
'If `category`, hover interaction take place per category.',
5656
'If `color`, hover interactions take place per color per category.',
57-
'If `dimension`, hover interactions take across all categories per dimension.'
57+
'If `dimension`, hover interactions take place across all categories per dimension.'
5858
].join(' ')
5959
},
6060
arrangement: {

src/traces/parcats/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
9898

9999
mergeLength(traceOut, dimensions, 'values', len);
100100

101-
coerce('hovermode');
101+
coerce('hoveron');
102102
coerce('arrangement');
103103
coerce('bundlecolors');
104104
coerce('sortpaths');

src/traces/parcats/parcats.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ function emitPointsEventColorHovermode(bandElement, eventName, event) {
694694
}
695695

696696
/**
697-
* Create hover label for a band element's category (for use when hovermode === 'category')
697+
* Create hover label for a band element's category (for use when hoveron === 'category')
698698
*
699699
* @param {ClientRect} rootBBox
700700
* Client bounding box for root of figure
@@ -755,7 +755,7 @@ function createHoverLabelForCategoryHovermode(rootBBox, bandElement) {
755755
}
756756

757757
/**
758-
* Create hover label for a band element's category (for use when hovermode === 'category')
758+
* Create hover label for a band element's category (for use when hoveron === 'category')
759759
*
760760
* @param {ClientRect} rootBBox
761761
* Client bounding box for root of figure
@@ -779,7 +779,7 @@ function createHoverLabelForDimensionHovermode(rootBBox, bandElement) {
779779
}
780780

781781
/**
782-
* Create hover labels for a band element's category (for use when hovermode === 'dimension')
782+
* Create hover labels for a band element's category (for use when hoveron === 'dimension')
783783
*
784784
* @param {ClientRect} rootBBox
785785
* Client bounding box for root of figure
@@ -899,13 +899,13 @@ function mouseoverCategoryBand(bandViewModel) {
899899
var gd = bandViewModel.parcatsViewModel.graphDiv;
900900
var fullLayout = gd._fullLayout;
901901
var rootBBox = fullLayout._paperdiv.node().getBoundingClientRect();
902-
var hovermode = bandViewModel.parcatsViewModel.hovermode;
902+
var hoveron = bandViewModel.parcatsViewModel.hoveron;
903903

904904
/** @type {HTMLElement} */
905905
var bandElement = this;
906906

907907
// Handle style and events
908-
if(hovermode === 'color') {
908+
if(hoveron === 'color') {
909909
styleForColorHovermode(bandElement);
910910
emitPointsEventColorHovermode(bandElement, 'plotly_hover', d3.event);
911911
} else {
@@ -916,11 +916,11 @@ function mouseoverCategoryBand(bandViewModel) {
916916
// Handle hover label
917917
if(bandViewModel.parcatsViewModel.hoverinfoItems.indexOf('none') === -1) {
918918
var hoverItems;
919-
if(hovermode === 'category') {
919+
if(hoveron === 'category') {
920920
hoverItems = createHoverLabelForCategoryHovermode(rootBBox, bandElement);
921-
} else if(hovermode === 'color') {
921+
} else if(hoveron === 'color') {
922922
hoverItems = createHoverLabelForColorHovermode(rootBBox, bandElement);
923-
} else if(hovermode === 'dimension') {
923+
} else if(hoveron === 'dimension') {
924924
hoverItems = createHoverLabelForDimensionHovermode(rootBBox, bandElement);
925925
}
926926

@@ -962,11 +962,11 @@ function mouseoutCategory(bandViewModel) {
962962
// Emit unhover event
963963
if(parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) {
964964

965-
var hovermode = bandViewModel.parcatsViewModel.hovermode;
965+
var hoveron = bandViewModel.parcatsViewModel.hoveron;
966966
var bandElement = this;
967967

968968
// Handle style and events
969-
if(hovermode === 'color') {
969+
if(hoveron === 'color') {
970970
emitPointsEventColorHovermode(bandElement, 'plotly_unhover', d3.event);
971971
} else {
972972
emitPointsEventCategoryHovermode(bandElement, 'plotly_unhover', d3.event);
@@ -1209,7 +1209,7 @@ function dragDimensionEnd(d) {
12091209
// ----------------------------
12101210
if(d.parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) {
12111211
if(!d.dragHasMoved && d.potentialClickBand) {
1212-
if(d.parcatsViewModel.hovermode === 'color') {
1212+
if(d.parcatsViewModel.hoveron === 'color') {
12131213
emitPointsEventColorHovermode(d.potentialClickBand, 'plotly_click', d3.event.sourceEvent);
12141214
} else {
12151215
emitPointsEventCategoryHovermode(d.potentialClickBand, 'plotly_click', d3.event.sourceEvent);
@@ -1489,7 +1489,7 @@ function createParcatsViewModel(graphDiv, layout, wrappedParcatsModel) {
14891489
y: traceY,
14901490
width: traceWidth,
14911491
height: traceHeight,
1492-
hovermode: trace.hovermode,
1492+
hoveron: trace.hoveron,
14931493
hoverinfoItems: hoverinfoItems,
14941494
arrangement: trace.arrangement,
14951495
bundlecolors: trace.bundlecolors,
@@ -1949,8 +1949,8 @@ function createDimensionViewModel(parcatsViewModel, dimensionModel) {
19491949
* X position of this trace with respect to the Figure (pixels)
19501950
* @property {Number} y
19511951
* Y position of this trace with respect to the Figure (pixels)
1952-
* @property {String} hovermode
1953-
* Hover mode. One of: 'none', 'category', 'color', or 'dimension'
1952+
* @property {String} hoveron
1953+
* Hover interaction mode. One of: 'category', 'color', or 'dimension'
19541954
* @property {Array.<String>} hoverinfoItems
19551955
* Info to display on hover. Array with a combination of 'counts' and/or 'probabilities', or 'none', or 'skip'
19561956
* @property {String} arrangement

test/image/mocks/parcats_hovermode_color.json renamed to test/image/mocks/parcats_hoveron_color.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"data": [
33
{"type": "parcats",
44
"domain": {"x": [0.125, 0.625],"y": [0.25, 0.75]},
5-
"hovermode": "color",
5+
"hoveron": "color",
66
"hoverinfo": "probability",
77
"dimensions":[
88
{"label": "One", "values": [1, 1, 2, 1, 2, 1, 1, 2, 1]},

test/image/mocks/parcats_hovermode_dimension.json renamed to test/image/mocks/parcats_hoveron_dimension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"data": [
33
{"type": "parcats",
44
"domain": {"x": [0.125, 0.625],"y": [0.25, 0.75]},
5-
"hovermode": "dimension",
5+
"hoveron": "dimension",
66
"hoverinfo": "probability+count",
77
"dimensions":[
88
{"label": "One", "values": [1, 1, 2, 1, 2, 1, 1, 2, 1]},

test/jasmine/tests/parcats_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ describe('Click events', function() {
13281328
});
13291329
});
13301330

1331-
describe('Click events with hovermode color', function() {
1331+
describe('Click events with hoveron color', function() {
13321332

13331333
// Variable declarations
13341334
// ---------------------
@@ -1340,7 +1340,7 @@ describe('Click events with hovermode color', function() {
13401340
// --------
13411341
beforeEach(function() {
13421342
gd = createGraphDiv();
1343-
mock = Lib.extendDeep({}, require('@mocks/parcats_hovermode_color.json'));
1343+
mock = Lib.extendDeep({}, require('@mocks/parcats_hoveron_color.json'));
13441344
});
13451345

13461346
afterEach(destroyGraphDiv);
@@ -1583,7 +1583,7 @@ describe('Hover events', function() {
15831583
});
15841584
});
15851585

1586-
describe('Hover events with hovermode color', function() {
1586+
describe('Hover events with hoveron color', function() {
15871587

15881588
// Variable declarations
15891589
// ---------------------
@@ -1595,12 +1595,12 @@ describe('Hover events with hovermode color', function() {
15951595
// --------
15961596
beforeEach(function() {
15971597
gd = createGraphDiv();
1598-
mock = Lib.extendDeep({}, require('@mocks/parcats_hovermode_color.json'));
1598+
mock = Lib.extendDeep({}, require('@mocks/parcats_hoveron_color.json'));
15991599
});
16001600

16011601
afterEach(destroyGraphDiv);
16021602

1603-
it('hover and unhover should fire on category hovermode color', function(done) {
1603+
it('hover and unhover should fire on category hoveron color', function(done) {
16041604

16051605
var hoverData,
16061606
unhoverData,
@@ -1667,7 +1667,7 @@ describe('Hover events with hovermode color', function() {
16671667
.then(done);
16681668
});
16691669

1670-
it('hover and unhover should fire on path hovermode color', function(done) {
1670+
it('hover and unhover should fire on path hoveron color', function(done) {
16711671

16721672
var hoverData,
16731673
unhoverData,

0 commit comments

Comments
 (0)