We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2a9c6e commit a98ac44Copy full SHA for a98ac44
4 files changed
src/traces/image/attributes.js
@@ -102,6 +102,6 @@ module.exports = extendFlat({
102
flags: ['x', 'y', 'z', 'color', 'name']
103
}),
104
hovertemplate: hovertemplateAttrs({}, {
105
- keys: ['z', 'c', 'colormodel']
+ keys: ['z', 'color', 'colormodel']
106
})
107
});
src/traces/image/event_data.js
@@ -9,11 +9,11 @@
9
'use strict';
10
11
module.exports = function eventData(out, pt) {
12
- out.colormodel = pt.trace.colormodel;
13
if('xVal' in pt) out.x = pt.xVal;
14
if('yVal' in pt) out.y = pt.yVal;
15
if(pt.xa) out.xaxis = pt.xa;
16
if(pt.ya) out.yaxis = pt.ya;
17
- out.c = pt.c;
+ out.color = pt.color;
+ out.colormodel = pt.trace.colormodel;
18
return out;
19
};
src/traces/image/hover.js
@@ -63,18 +63,19 @@ module.exports = function hoverPoints(pointData, xval, yval) {
63
x1: xa.c2p(cd0.x0 + (nx + 1) * trace.dx),
64
y0: py,
65
y1: py,
66
- c: c,
+ color: c,
67
xVal: xVal,
68
xLabelVal: xVal,
69
yVal: yVal,
70
yLabelVal: yVal,
71
zLabelVal: zLabel,
72
hovertemplateLabels: {
73
'zLabel': zLabel,
74
- 'cLabel': colorstring,
75
- 'c[0]Label': c[0] + s[0],
76
- 'c[1]Label': c[1] + s[1],
77
- 'c[2]Label': c[2] + s[2]
+ 'colorLabel': colorstring,
+ 'color[0]Label': c[0] + s[0],
+ 'color[1]Label': c[1] + s[1],
+ 'color[2]Label': c[2] + s[2],
78
+ 'color[3]Label': c[3] + s[3]
79
}
80
})];
81
test/jasmine/tests/image_test.js
@@ -397,12 +397,12 @@ describe('image hover:', function() {
397
['x', '25.5'],
398
['y', '14.5'],
399
['z', '[54, 136, 153]'],
400
- ['c', '[54, 136, 153]'],
401
- ['c[0]', '54'],
402
- ['c[0]', '54°', 'hsl'],
403
- ['c[1]', '100%', 'hsl'],
404
- ['c[2]', '100%', 'hsl'],
405
- ['c[3]', '1', 'hsla'],
+ ['color', '[54, 136, 153]'],
+ ['color[0]', '54'],
+ ['color[0]', '54°', 'hsl'],
+ ['color[1]', '100%', 'hsl'],
+ ['color[2]', '100%', 'hsl'],
+ ['color[3]', '1', 'hsla'],
406
].forEach(function(test) {
407
it('should support hovertemplate variable ' + test[0], function(done) {
408
var mockCopy = Lib.extendDeep({}, mock);
0 commit comments