Skip to content

Commit 5562418

Browse files
committed
no arrayOk textfont for heatmap-like traces
1 parent db7ecc9 commit 5562418

File tree

2 files changed

+18
-89
lines changed

2 files changed

+18
-89
lines changed

src/traces/heatmap/attributes.js

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

33
var scatterAttrs = require('../scatter/attributes');
44
var baseAttrs = require('../../plots/attributes');
5+
var fontAttrs = require('../../plots/font_attributes');
56
var axisHoverFormat = require('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
67
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
78
var texttemplateAttrs = require('../../plots/template_attributes').texttemplateAttrs;
@@ -120,7 +121,11 @@ module.exports = extendFlat({
120121
texttemplate: texttemplateAttrs({editType: 'plot'}, {
121122
keys: ['x', 'y', 'z', 'text']
122123
}),
123-
textfont: extendFlat({}, scatterAttrs.textfont, {arrayOk: false}),
124+
textfont: fontAttrs({
125+
editType: 'plot',
126+
colorEditType: 'style',
127+
description: 'Sets the text font.'
128+
}),
124129

125130
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
126131
}, {

test/plot-schema.json

Lines changed: 12 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -21559,43 +21559,24 @@
2155921559
"valType": "data_array"
2156021560
},
2156121561
"textfont": {
21562-
"arrayOk": false,
2156321562
"color": {
21564-
"arrayOk": true,
2156521563
"editType": "style",
2156621564
"valType": "color"
2156721565
},
21568-
"colorsrc": {
21569-
"description": "Sets the source reference on Chart Studio Cloud for `color`.",
21570-
"editType": "none",
21571-
"valType": "string"
21572-
},
2157321566
"description": "Sets the text font.",
21574-
"editType": "calc",
21567+
"editType": "plot",
2157521568
"family": {
21576-
"arrayOk": true,
2157721569
"description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
21578-
"editType": "calc",
21570+
"editType": "plot",
2157921571
"noBlank": true,
2158021572
"strict": true,
2158121573
"valType": "string"
2158221574
},
21583-
"familysrc": {
21584-
"description": "Sets the source reference on Chart Studio Cloud for `family`.",
21585-
"editType": "none",
21586-
"valType": "string"
21587-
},
2158821575
"role": "object",
2158921576
"size": {
21590-
"arrayOk": true,
21591-
"editType": "calc",
21577+
"editType": "plot",
2159221578
"min": 1,
2159321579
"valType": "number"
21594-
},
21595-
"sizesrc": {
21596-
"description": "Sets the source reference on Chart Studio Cloud for `size`.",
21597-
"editType": "none",
21598-
"valType": "string"
2159921580
}
2160021581
},
2160121582
"textsrc": {
@@ -26683,43 +26664,24 @@
2668326664
"valType": "data_array"
2668426665
},
2668526666
"textfont": {
26686-
"arrayOk": false,
2668726667
"color": {
26688-
"arrayOk": true,
2668926668
"editType": "style",
2669026669
"valType": "color"
2669126670
},
26692-
"colorsrc": {
26693-
"description": "Sets the source reference on Chart Studio Cloud for `color`.",
26694-
"editType": "none",
26695-
"valType": "string"
26696-
},
2669726671
"description": "Sets the text font.",
26698-
"editType": "calc",
26672+
"editType": "plot",
2669926673
"family": {
26700-
"arrayOk": true,
2670126674
"description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
26702-
"editType": "calc",
26675+
"editType": "plot",
2670326676
"noBlank": true,
2670426677
"strict": true,
2670526678
"valType": "string"
2670626679
},
26707-
"familysrc": {
26708-
"description": "Sets the source reference on Chart Studio Cloud for `family`.",
26709-
"editType": "none",
26710-
"valType": "string"
26711-
},
2671226680
"role": "object",
2671326681
"size": {
26714-
"arrayOk": true,
26715-
"editType": "calc",
26682+
"editType": "plot",
2671626683
"min": 1,
2671726684
"valType": "number"
26718-
},
26719-
"sizesrc": {
26720-
"description": "Sets the source reference on Chart Studio Cloud for `size`.",
26721-
"editType": "none",
26722-
"valType": "string"
2672326685
}
2672426686
},
2672526687
"textsrc": {
@@ -30428,43 +30390,24 @@
3042830390
}
3042930391
},
3043030392
"textfont": {
30431-
"arrayOk": false,
3043230393
"color": {
30433-
"arrayOk": true,
3043430394
"editType": "style",
3043530395
"valType": "color"
3043630396
},
30437-
"colorsrc": {
30438-
"description": "Sets the source reference on Chart Studio Cloud for `color`.",
30439-
"editType": "none",
30440-
"valType": "string"
30441-
},
3044230397
"description": "Sets the text font.",
30443-
"editType": "calc",
30398+
"editType": "plot",
3044430399
"family": {
30445-
"arrayOk": true,
3044630400
"description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
30447-
"editType": "calc",
30401+
"editType": "plot",
3044830402
"noBlank": true,
3044930403
"strict": true,
3045030404
"valType": "string"
3045130405
},
30452-
"familysrc": {
30453-
"description": "Sets the source reference on Chart Studio Cloud for `family`.",
30454-
"editType": "none",
30455-
"valType": "string"
30456-
},
3045730406
"role": "object",
3045830407
"size": {
30459-
"arrayOk": true,
30460-
"editType": "calc",
30408+
"editType": "plot",
3046130409
"min": 1,
3046230410
"valType": "number"
30463-
},
30464-
"sizesrc": {
30465-
"description": "Sets the source reference on Chart Studio Cloud for `size`.",
30466-
"editType": "none",
30467-
"valType": "string"
3046830411
}
3046930412
},
3047030413
"texttemplate": {
@@ -31740,43 +31683,24 @@
3174031683
}
3174131684
},
3174231685
"textfont": {
31743-
"arrayOk": false,
3174431686
"color": {
31745-
"arrayOk": true,
3174631687
"editType": "style",
3174731688
"valType": "color"
3174831689
},
31749-
"colorsrc": {
31750-
"description": "Sets the source reference on Chart Studio Cloud for `color`.",
31751-
"editType": "none",
31752-
"valType": "string"
31753-
},
3175431690
"description": "Sets the text font.",
31755-
"editType": "calc",
31691+
"editType": "plot",
3175631692
"family": {
31757-
"arrayOk": true,
3175831693
"description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
31759-
"editType": "calc",
31694+
"editType": "plot",
3176031695
"noBlank": true,
3176131696
"strict": true,
3176231697
"valType": "string"
3176331698
},
31764-
"familysrc": {
31765-
"description": "Sets the source reference on Chart Studio Cloud for `family`.",
31766-
"editType": "none",
31767-
"valType": "string"
31768-
},
3176931699
"role": "object",
3177031700
"size": {
31771-
"arrayOk": true,
31772-
"editType": "calc",
31701+
"editType": "plot",
3177331702
"min": 1,
3177431703
"valType": "number"
31775-
},
31776-
"sizesrc": {
31777-
"description": "Sets the source reference on Chart Studio Cloud for `size`.",
31778-
"editType": "none",
31779-
"valType": "string"
3178031704
}
3178131705
},
3178231706
"texttemplate": {

0 commit comments

Comments
 (0)