8000 Custom trace hover labels by etpinard · Pull Request #1582 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Custom trace hover labels #1582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
May 10, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
83cd8c8
add hoverlabel attribute container for all traces
etpinard Apr 11, 2017
258f1c7
merge hoverlabel items in scatter and bar calcdata
etpinard Apr 11, 2017
fe50b6f
add hover label setting to hoverData during `cleanPoint`
etpinard Apr 11, 2017
8d7ec16
Merge branch 'master' into hoverlabel-custom
etpinard Apr 20, 2017
ffde987
break up cartesian graph_interact.js:
etpinard Apr 20, 2017
1d4930c
update Fx require statements
etpinard Apr 20, 2017
e609955
update hover constant require statements
etpinard Apr 20, 2017
12954aa
sub Fx.init by (cartesian) initIterations
etpinard Apr 20, 2017
27fb2d0
decrease max allowed circular deps to 13 :tada:
etpinard Apr 20, 2017
a96af57
mv fx attribute out of plots/ and into components/fx/
etpinard Apr 20, 2017
abcf1b0
register fx in core.js
etpinard Apr 20, 2017
03554a5
Merge pull request #1613 from plotly/fx-component
etpinard Apr 20, 2017
efcb027
revert hoverlabel in arraysToCalcdata -> add Fx.calc
etpinard Apr 20, 2017
7907140
make fx default test more robust
etpinard Apr 21, 2017
0d66e6e
lint fx constants
etpinard Apr 21, 2017
3ac4c07
lint getComponentMethod call
etpinard Apr 21, 2017
295659e
add fx supplyDefau 8000 lts method
etpinard Apr 21, 2017
9d91e2c
fix mapbox hover label color for array `marker.color` values
etpinard Apr 24, 2017
add85d2
lint var declarations
etpinard Apr 24, 2017
f986fd2
add global layout defaults step for `layout.hoverlabel`
etpinard Apr 24, 2017
a8cc8b0
make common label in 'x' and 'y' hovermode adhere to layout.hoverlabel
etpinard Apr 24, 2017
9ee8877
add tests for custom hover labels cartesian, geo, mapbox & ternary
etpinard Apr 24, 2017
4ec88ef
add support for per-point `hoverlabel` setting in 2d z traces
etpinard Apr 24, 2017
b053629
add support for per-pt `hoverlabel` setting in pie traces
etpinard Apr 24, 2017
92de017
put selection coords (not hoverlabel strings) to event data
etpinard Apr 25, 2017
7332d23
set `selection.index` during gl3d trace handlePick
etpinard Apr 25, 2017
6bbfa65
add support for custom hover label in gl3d
etpinard Apr 25, 2017
28c2770
add support for custom hover label in gl2d
etpinard Apr 25, 2017
cda735b
make hoverlabel text selection query more robust
etpinard Apr 25, 2017
ce27e10
bump back max allowed circular deps to 17
etpinard Apr 25, 2017
be9e6b9
resolves #1575 - call Fx.hover with evt object containing 'xpx' & 'ypx'
etpinard Apr 26, 2017
cf61dc2
fixes #1600 - allow z cartesian traces to have a name hover label
etpinard Apr 26, 2017
9eeadcf
don't override hover label data by undefined vals
etpinard Apr 26, 2017
8321959
make sure arrayOk resyle logic works for hoverlabel attributes
etpinard Apr 27, 2017
409b771
Merge pull request #1627 from plotly/hover-misc-bugs
etpinard May 9, 2017
60bd4fc
factor out gl2d / gl3d cast hover options logic into 1 Fx method
etpinard May 9, 2017
e45bff9
perf improvements in fx helpers
etpinard May 9, 2017
e0be6cd
Merge branch 'master' into hoverlabel-custom
etpinard May 9, 2017
8d021e0
:hocho: :evergreen_tree: in sankey tests
etpinard May 10, 2017
4d3ce92
implement 'hoverlabel' settings in sankey hover routines
etpinard May 10, 2017
e50886c
fixup: don't support array value in sankey hoverlabel settings
etpinard May 10, 2017
f8258cb
add sankey hover label style tests
etpinard May 10, 2017
3f52a89
Merge branch 'master' into hoverlabel-custom
etpinard May 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update hover constant require statements
  • Loading branch information
etpinard committed Apr 20, 2017
commit e6099558fbaaceea7b86de8bd41a40ecdae55b11
6 changes: 3 additions & 3 deletions src/components/annotations/annotation_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

var Lib = require('../../lib');
var Color = require('../color');
var Fx = require('../fx');
var Axes = require('../../plots/cartesian/axes');
var constants = require('../../plots/cartesian/constants');

var attributes = require('./attributes');

Expand Down Expand Up @@ -118,8 +118,8 @@ module.exports = function handleAnnotationDefaults(annIn, annOut, fullLayout, op
Color.opacity(bgColor) ? Color.rgb(bgColor) : Color.defaultLine);
var hoverBorder = coerce('hoverlabel.bordercolor', Color.contrast(hoverBG));
Lib.coerceFont(coerce, 'hoverlabel.font', {
family: constants.HOVERFONT,
size: constants.HOVERFONTSIZE,
family: Fx.constants.HOVERFONT,
size: Fx.constants.HOVERFONTSIZE,
color: hoverBorder
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/plots/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

'use strict';

var constants = require('./cartesian/constants');
var constants = require('../components/fx/constants');
var fontAttrs = require('./font_attributes');
var extendFlat = require('../lib/extend').extendFlat;

Expand Down
3 changes: 1 addition & 2 deletions src/traces/heatmap/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
var Fx = require('../../components/fx');
var Lib = require('../../lib');

var MAXDIST = require('../../plots/cartesian/constants').MAXDIST;

var MAXDIST = Fx.constants.MAXDIST;

module.exports = function hoverPoints(pointData, xval, yval, 8000 hovermode, contour) {
// never let a heatmap override another type as closest point
Expand Down
4 changes: 2 additions & 2 deletions src/traces/scatter/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

var Lib = require('../../lib');
var Fx = require('../../components/fx');
var constants = require('../../plots/cartesian/constants');
var ErrorBars = require('../../components/errorbars');
var getTraceColor = require('./get_trace_color');
var Color = require('../../components/color');

var MAXDIST = Fx.constants.MAXDIST;

module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
var cd = pointData.cd,
Expand Down Expand Up @@ -148,7 +148,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {

Lib.extendFlat(pointData, {
// never let a 2D override 1D type as closest point
distance: constants.MAXDIST + 10,
distance: MAXDIST + 10,
x0: xmin,
x1: xmax,
y0: yAvg,
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/annotations_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var Plots = require('@src/plots/plots');
var Lib = require('@src/lib');
var Loggers = require('@src/lib/loggers');
var Axes = require('@src/plots/cartesian/axes');
var HOVERMINTIME = require('@src/plots/cartesian/constants').HOVERMINTIME;
var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;
var DBLCLICKDELAY = require('@src/constants/interactions').DBLCLICKDELAY;

var d3 = require('d3');
Expand Down
3 changes: 1 addition & 2 deletions test/jasmine/tests/geo_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ var mouseEvent = require('../assets/mouse_event');
var click = require('../assets/click');

var DBLCLICKDELAY = require('@src/constants/interactions').DBLCLICKDELAY;
var HOVERMINTIME = require('@src/plots/cartesian/constants').HOVERMINTIME;

var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;

function move(fromX, fromY, toX, toY, delay) {
return new Promise(function(resolve) {
Expand Down
14 changes: 7 additions & 7 deletions test/jasmine/tests/hover_label_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var d3 = require('d3');

var Plotly = require('@lib/index');
var Fx = require('@src/components/fx');
var constants = require('@src/plots/cartesian/constants');
var Lib = require('@src/lib');
var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;

var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
Expand Down Expand Up @@ -554,7 +554,7 @@ describe('hover info', function() {
Promise.resolve().then(function() {
Fx.hover(gd, event, 'xy');
})
.then(delay(constants.HOVERMINTIME * 1.1))
.then(delay(HOVERMINTIME * 1.1))
.then(function() {
Fx.unhover(gd);
})
Expand Down Expand Up @@ -719,7 +719,7 @@ describe('hover after resizing', function() {

setTimeout(function() {
resolve();
}, constants.HOVERMINTIME);
}, HOVERMINTIME);
});
}

Expand All @@ -732,7 +732,7 @@ describe('hover after resizing', function() {
expect(hoverText.size()).toEqual(cnt, msg);

resolve();
}, constants.HOVERMINTIME);
}, HOVERMINTIME);
});
}

Expand Down Expand Up @@ -799,7 +799,7 @@ describe('hover on fill', function() {
expect(+transformCoords[1]).toBeCloseTo(labelPos[1], -1.2, labelText + ':y');

resolve();
}, constants.HOVERMINTIME);
}, HOVERMINTIME);
});
}

Expand Down Expand Up @@ -879,7 +879,7 @@ describe('hover updates', function() {
}

resolve();
}, constants.HOVERMINTIME);
}, HOVERMINTIME);
});
}

Expand Down Expand Up @@ -935,7 +935,7 @@ describe('hover updates', function() {
mouseEvent('mousemove', 394, 285);
setTimeout(function() {
resolve();
}, constants.HOVERMINTIME);
}, HOVERMINTIME);
});
}

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/scattermapbox_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var customMatchers = require('../assets/custom_matchers');

var mouseEvent = require('../assets/mouse_event');
var click = require('../assets/click');
var HOVERMINTIME = require('@src/plots/cartesian/constants').HOVERMINTIME;
var HOVERMINTIME = require('@src/components/fx').constants.HOVERMINTIME;

function move(fromX, fromY, toX, toY, delay) {
return new Promise(function(resolve) {
Expand Down
0