Skip to content

Commit 0d34b05

Browse files
committed
add anim:true info to valObjects of animatable scatter attributes
1 parent df9ac56 commit 0d34b05

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

src/components/colorscale/attributes.js

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ function code(s) {
5454
* most of these attributes already require a recalc, but the ones that do not
5555
* have editType *style* or *plot* unless you override (presumably with *calc*)
5656
*
57+
* - anim {boolean) (dflt: undefined): is 'color' animatable?
58+
*
5759
* @return {object}
5860
*/
5961
module.exports = function colorScaleAttrs(context, opts) {
@@ -109,6 +111,10 @@ module.exports = function colorScaleAttrs(context, opts) {
109111
' ' + minmaxFull + ' if set.'
110112
].join('')
111113
};
114+
115+
if(opts.anim) {
116+
attrs.color.anim = true;
117+
}
112118
}
113119

114120
attrs[auto] = {

src/plots/attributes.js

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ module.exports = {
7979
ids: {
8080
valType: 'data_array',
8181
editType: 'calc',
82+
anim: true,
8283
description: [
8384
'Assigns id labels to each datum.',
8485
'These ids for object constancy of data points during animation.',

src/traces/scatter/attributes.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ module.exports = {
2121
x: {
2222
valType: 'data_array',
2323
editType: 'calc+clearAxisTypes',
24+
anim: true,
2425
description: 'Sets the x coordinates.'
2526
},
2627
x0: {
2728
valType: 'any',
2829
dflt: 0,
2930
role: 'info',
3031
editType: 'calc+clearAxisTypes',
32+
anim: true,
3133
description: [
3234
'Alternate to `x`.',
3335
'Builds a linear space of x coordinates.',
@@ -40,6 +42,7 @@ module.exports = {
4042
dflt: 1,
4143
role: 'info',
4244
editType: 'calc',
45+
anim: true,
4346
description: [
4447
'Sets the x coordinate step.',
4548
'See `x0` for more info.'
@@ -48,13 +51,15 @@ module.exports = {
4851
y: {
4952
valType: 'data_array',
5053
editType: 'calc+clearAxisTypes',
54+
anim: true,
5155
description: 'Sets the y coordinates.'
5256
},
5357
y0: {
5458
valType: 'any',
5559
dflt: 0,
5660
role: 'info',
5761
editType: 'calc+clearAxisTypes',
62+
anim: true,
5863
description: [
5964
'Alternate to `y`.',
6065
'Builds a linear space of y coordinates.',
@@ -67,6 +72,7 @@ module.exports = {
6772
dflt: 1,
6873
role: 'info',
6974
editType: 'calc',
75+
anim: true,
7076
description: [
7177
'Sets the y coordinate step.',
7278
'See `y0` for more info.'
@@ -208,6 +214,7 @@ module.exports = {
208214
valType: 'color',
209215
role: 'style',
210216
editType: 'style',
217+
anim: true,
211218
description: 'Sets the line color.'
212219
},
213220
width: {
@@ -216,6 +223,7 @@ module.exports = {
216223
dflt: 2,
217224
role: 'style',
218225
editType: 'style',
226+
anim: true,
219227
description: 'Sets the line width (in px).'
220228
},
221229
shape: {
@@ -314,6 +322,7 @@ module.exports = {
314322
valType: 'color',
315323
role: 'style',
316324
editType: 'style',
325+
anim: true,
317326
description: [
318327
'Sets the fill color.',
319328
'Defaults to a half-transparent variant of the line color,',
@@ -343,6 +352,7 @@ module.exports = {
343352
arrayOk: true,
344353
role: 'style',
345354
editType: 'style',
355+
anim: true,
346356
description: 'Sets the marker opacity.'
347357
},
348358
size: {
@@ -352,6 +362,7 @@ module.exports = {
352362
arrayOk: true,
353363
role: 'style',
354364
editType: 'calc',
365+
anim: true,
355366
description: 'Sets the marker size (in px).'
356367
},
357368
maxdisplayed: {
@@ -409,11 +420,12 @@ module.exports = {
409420
arrayOk: true,
410421
role: 'style',
411422
editType: 'style',
423+
anim: true,
412424
description: 'Sets the width (in px) of the lines bounding the marker points.'
413425
},
414426
editType: 'calc'
415427
},
416-
colorAttributes('marker.line')
428+
colorAttributes('marker.line', {anim: true})
417429
),
418430
gradient: {
419431
type: {
@@ -442,7 +454,7 @@ module.exports = {
442454
},
443455
editType: 'calc'
444456
},
445-
colorAttributes('marker')
457+
colorAttributes('marker', {anim: true})
446458
),
447459
selected: {
448460
marker: {

test/jasmine/bundle_tests/plotschema_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('plot schema', function() {
117117
.concat(valObject.otherOpts)
118118
.concat([
119119
'valType', 'description', 'role',
120-
'editType', 'impliedEdits',
120+
'editType', 'impliedEdits', 'anim',
121121
'_compareAsJSON', '_noTemplating'
122122
]);
123123

0 commit comments

Comments
 (0)