Skip to content

Commit 52c29cc

Browse files
committed
Add fallback value to attributes files
1 parent 680c793 commit 52c29cc

File tree

44 files changed

+169
-296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+169
-296
lines changed

src/components/shapes/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var extendFlat = require('../../lib/extend').extendFlat;
88
var templatedArray = require('../../plot_api/plot_template').templatedArray;
99
var axisPlaceableObjs = require('../../constants/axis_placeable_objects');
1010
var basePlotAttributes = require('../../plots/attributes');
11-
var shapeTexttemplateAttrs = require('../../plots/template_attributes').shapeTexttemplateAttrs;
11+
const { shapeTexttemplateAttrs, templatefallbackAttrs } = require('../../plots/template_attributes');
1212
var shapeLabelTexttemplateVars = require('./label_texttemplate');
1313

1414
module.exports = templatedArray('shape', {
@@ -331,6 +331,7 @@ module.exports = templatedArray('shape', {
331331
].join(' ')
332332
},
333333
texttemplate: shapeTexttemplateAttrs({}, { keys: Object.keys(shapeLabelTexttemplateVars) }),
334+
texttemplatefallback: templatefallbackAttrs(),
334335
font: fontAttrs({
335336
editType: 'calc+arraydraw',
336337
colorEditType: 'arraydraw',

src/components/shapes/draw_newshape/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var basePlotAttributes = require('../../../plots/attributes');
55
var fontAttrs = require('../../../plots/font_attributes');
66
var dash = require('../../drawing/attributes').dash;
77
var extendFlat = require('../../../lib/extend').extendFlat;
8-
var shapeTexttemplateAttrs = require('../../../plots/template_attributes').shapeTexttemplateAttrs;
8+
const { shapeTexttemplateAttrs, templatefallbackAttrs } = require('../../../plots/template_attributes');
99
var shapeLabelTexttemplateVars = require('../label_texttemplate');
1010

1111
module.exports = overrideAll(
@@ -150,6 +150,7 @@ module.exports = overrideAll(
150150
{ newshape: true },
151151
{ keys: Object.keys(shapeLabelTexttemplateVars) }
152152
),
153+
texttemplatefallback: templatefallbackAttrs(),
153154
font: fontAttrs({
154155
description: 'Sets the new shape label text font.'
155156
}),

src/traces/bar/attributes.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
var scatterAttrs = require('../scatter/attributes');
44
var axisHoverFormat = require('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
5-
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
6-
var texttemplateAttrs = require('../../plots/template_attributes').texttemplateAttrs;
5+
const { hovertemplateAttrs, texttemplateAttrs, templatefallbackAttrs } = require('../../plots/template_attributes');
76
var colorScaleAttrs = require('../../components/colorscale/attributes');
87
var fontAttrs = require('../../plots/font_attributes');
98
var constants = require('./constants');
@@ -78,19 +77,11 @@ module.exports = {
7877
yhoverformat: axisHoverFormat('y'),
7978

8079
text: scatterAttrs.text,
81-
texttemplate: texttemplateAttrs(
82-
{ editType: 'plot' },
83-
{
84-
keys: constants.eventDataKeys
85-
}
86-
),
80+
texttemplate: texttemplateAttrs({ editType: 'plot' }, { keys: constants.eventDataKeys }),
81+
texttemplatefallback: templatefallbackAttrs(),
8782
hovertext: scatterAttrs.hovertext,
88-
hovertemplate: hovertemplateAttrs(
89-
{},
90-
{
91-
keys: constants.eventDataKeys
92-
}
93-
),
83+
hovertemplate: hovertemplateAttrs({}, { keys: constants.eventDataKeys }),
84+
hovertemplatefallback: templatefallbackAttrs(),
9485

9586
textposition: {
9687
valType: 'enumerated',

src/traces/barpolar/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
3+
const { hovertemplateAttrs, templatefallbackAttrs } = require('../../plots/template_attributes');
44
var extendFlat = require('../../lib/extend').extendFlat;
55
var scatterPolarAttrs = require('../scatterpolar/attributes');
66
var barAttrs = require('../bar/attributes');
@@ -59,6 +59,7 @@ module.exports = {
5959

6060
hoverinfo: scatterPolarAttrs.hoverinfo,
6161
hovertemplate: hovertemplateAttrs(),
62+
hovertemplatefallback: templatefallbackAttrs(),
6263

6364
selected: barAttrs.selected,
6465
unselected: barAttrs.unselected

src/traces/box/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var scatterAttrs = require('../scatter/attributes');
55
var barAttrs = require('../bar/attributes');
66
var colorAttrs = require('../../components/color/attributes');
77
var axisHoverFormat = require('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
8-
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
8+
const { hovertemplateAttrs, templatefallbackAttrs } = require('../../plots/template_attributes');
99
var extendFlat = require('../../lib/extend').extendFlat;
1010

1111
var scatterMarkerAttrs = scatterAttrs.marker;
@@ -410,6 +410,7 @@ module.exports = {
410410
}),
411411
hovertext: extendFlat({}, scatterAttrs.hovertext, { description: 'Same as `text`.' }),
412412
hovertemplate: hovertemplateAttrs({ description: 'N.B. This only has an effect when hovering on points.' }),
413+
hovertemplatefallback: templatefallbackAttrs(),
413414

414415
hoveron: {
415416
valType: 'flaglist',

src/traces/choropleth/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
3+
const { hovertemplateAttrs, templatefallbackAttrs } = require('../../plots/template_attributes');
44
var scatterGeoAttrs = require('../scattergeo/attributes');
55
var colorScaleAttrs = require('../../components/colorscale/attributes');
66
var baseAttrs = require('../../plots/attributes');
@@ -84,6 +84,7 @@ module.exports = extendFlat(
8484
flags: ['location', 'z', 'text', 'name']
8585
}),
8686
hovertemplate: hovertemplateAttrs(),
87+
hovertemplatefallback: templatefallbackAttrs(),
8788
showlegend: extendFlat({}, baseAttrs.showlegend, { dflt: false })
8889
},
8990

src/traces/choroplethmap/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var choroplethAttrs = require('../choropleth/attributes');
44
var colorScaleAttrs = require('../../components/colorscale/attributes');
5-
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
5+
const { hovertemplateAttrs, templatefallbackAttrs } = require('../../plots/template_attributes');
66
var baseAttrs = require('../../plots/attributes');
77
var extendFlat = require('../../lib/extend').extendFlat;
88

@@ -98,6 +98,7 @@ module.exports = extendFlat(
9898

9999
hoverinfo: choroplethAttrs.hoverinfo,
100100
hovertemplate: hovertemplateAttrs({}, { keys: ['properties'] }),
101+
hovertemplatefallback: templatefallbackAttrs(),
101102
showlegend: extendFlat({}, baseAttrs.showlegend, { dflt: false })
102103
},
103104

src/traces/choroplethmapbox/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var choroplethAttrs = require('../choropleth/attributes');
44
var colorScaleAttrs = require('../../components/colorscale/attributes');
5-
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
5+
const { hovertemplateAttrs, templatefallbackAttrs } = require('../../plots/template_attributes');
66
var baseAttrs = require('../../plots/attributes');
77
var extendFlat = require('../../lib/extend').extendFlat;
88

@@ -98,6 +98,7 @@ module.exports = extendFlat(
9898

9999
hoverinfo: choroplethAttrs.hoverinfo,
100100
hovertemplate: hovertemplateAttrs({}, { keys: ['properties'] }),
101+
hovertemplatefallback: templatefallbackAttrs(),
101102
showlegend: extendFlat({}, baseAttrs.showlegend, { dflt: false })
102103
},
103104

src/traces/cone/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var colorScaleAttrs = require('../../components/colorscale/attributes');
44
var axisHoverFormat = require('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
5-
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
5+
const { hovertemplateAttrs, templatefallbackAttrs } = require('../../plots/template_attributes');
66
var mesh3dAttrs = require('../mesh3d/attributes');
77
var baseAttrs = require('../../plots/attributes');
88

@@ -146,6 +146,7 @@ var attrs = {
146146
},
147147

148148
hovertemplate: hovertemplateAttrs({ editType: 'calc' }, { keys: ['norm'] }),
149+
hovertemplatefallback: templatefallbackAttrs(),
149150
uhoverformat: axisHoverFormat('u', 1),
150151
vhoverformat: axisHoverFormat('v', 1),
151152
whoverformat: axisHoverFormat('w', 1),

src/traces/contour/attributes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ module.exports = extendFlat(
4242
yhoverformat: axisHoverFormat('y'),
4343
zhoverformat: axisHoverFormat('z', 1),
4444
hovertemplate: heatmapAttrs.hovertemplate,
45+
hovertemplatefallback: heatmapAttrs.hovertemplatefallback,
4546
texttemplate: extendFlat({}, heatmapAttrs.texttemplate, {
4647
description: [
4748
'For this trace it only has an effect if `coloring` is set to *heatmap*.',
4849
heatmapAttrs.texttemplate.description
4950
].join(' ')
5051
}),
52+
texttemplatefallback: heatmapAttrs.texttemplatefallback,
5153
textfont: extendFlat({}, heatmapAttrs.textfont, {
5254
description: [
5355
'For this trace it only has an effect if `coloring` is set to *heatmap*.',

0 commit comments

Comments
 (0)