Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit adf3b03

Browse files
authored
Merge pull request plotly#2070 from plotly/table-fontAttrs
Reuse font_attributes in `table`
2 parents 63c163c + 61bc258 commit adf3b03

File tree

1 file changed

+3
-62
lines changed

1 file changed

+3
-62
lines changed

src/traces/table/attributes.js

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
var annAttrs = require('../../components/annotations/attributes');
1212
var extendFlat = require('../../lib/extend').extendFlat;
1313
var overrideAll = require('../../plot_api/edit_types').overrideAll;
14+
var fontAttrs = require('../../plots/font_attributes');
1415

1516
module.exports = overrideAll({
1617
domain: {
@@ -135,37 +136,7 @@ module.exports = overrideAll({
135136
}
136137
},
137138

138-
font: {
139-
family: {
140-
valType: 'string',
141-
arrayOk: true,
142-
role: 'style',
143-
noBlank: true,
144-
strict: true,
145-
description: [
146-
'HTML font family - the typeface that will be applied by the web browser.',
147-
'The web browser will only be able to apply a font if it is available on the system',
148-
'which it operates. Provide multiple font families, separated by commas, to indicate',
149-
'the preference in which to apply fonts if they aren\'t available on the system.',
150-
'The plotly service (at https://plot.ly or on-premise) generates images on a server,',
151-
'where only a select number of',
152-
'fonts are installed and supported.',
153-
'These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,',
154-
'*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,',
155-
'*PT Sans Narrow*, *Raleway*, *Times New Roman*.'
156-
].join(' ')
157-
},
158-
size: {
159-
valType: 'number',
160-
arrayOk: true,
161-
role: 'style'
162-
},
163-
color: {
164-
valType: 'color',
165-
arrayOk: true,
166-
role: 'style'
167-
}
168-
}
139+
font: extendFlat({}, fontAttrs({arrayOk: true}))
169140
},
170141

171142
cells: {
@@ -243,36 +214,6 @@ module.exports = overrideAll({
243214
}
244215
},
245216

246-
font: {
247-
family: {
248-
valType: 'string',
249-
arrayOk: true,
250-
role: 'style',
251-
noBlank: true,
252-
strict: true,
253-
description: [
254-
'HTML font family - the typeface that will be applied by the web browser.',
255-
'The web browser will only be able to apply a font if it is available on the system',
256-
'which it operates. Provide multiple font families, separated by commas, to indicate',
257-
'the preference in which to apply fonts if they aren\'t available on the system.',
258-
'The plotly service (at https://plot.ly or on-premise) generates images on a server,',
259-
'where only a select number of',
260-
'fonts are installed and supported.',
261-
'These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,',
262-
'*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,',
263-
'*PT Sans Narrow*, *Raleway*, *Times New Roman*.'
264-
].join(' ')
265-
},
266-
size: {
267-
valType: 'number',
268-
arrayOk: true,
269-
role: 'style'
270-
},
271-
color: {
272-
valType: 'color',
273-
arrayOk: true,
274-
role: 'style'
275-
}
276-
}
217+
font: extendFlat({}, fontAttrs({arrayOk: true}))
277218
}
278219
}, 'calc', 'from-root');

0 commit comments

Comments
 (0)