From 6075d867c6130c4bb18a517cb93fe7ec807cc5a5 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Fri, 6 Oct 2017 22:00:51 +0200 Subject: [PATCH 1/2] reuse font_attributes --- src/traces/table/attributes.js | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/src/traces/table/attributes.js b/src/traces/table/attributes.js index 86b349a039f..ad860454a48 100644 --- a/src/traces/table/attributes.js +++ b/src/traces/table/attributes.js @@ -11,6 +11,7 @@ var annAttrs = require('../../components/annotations/attributes'); var extendFlat = require('../../lib/extend').extendFlat; var overrideAll = require('../../plot_api/edit_types').overrideAll; +var fontAttrs = require('../../plots/font_attributes'); module.exports = overrideAll({ domain: { @@ -135,37 +136,7 @@ module.exports = overrideAll({ } }, - font: { - family: { - valType: 'string', - arrayOk: true, - role: 'style', - noBlank: true, - strict: true, - 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 plotly service (at https://plot.ly 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*.' - ].join(' ') - }, - size: { - valType: 'number', - arrayOk: true, - role: 'style' - }, - color: { - valType: 'color', - arrayOk: true, - role: 'style' - } - } + font: extendFlat({}, fontAttrs({arrayOk: true})) }, cells: { From 61bc258190a916b4693abb3a7faee661b1fd511f Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Fri, 6 Oct 2017 23:08:04 +0200 Subject: [PATCH 2/2] =?UTF-8?q?other=20use=20of=20`font`=20-=20thanks=20?= =?UTF-8?q?=C3=89tienne=20for=20the=20catch!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/traces/table/attributes.js | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/src/traces/table/attributes.js b/src/traces/table/attributes.js index ad860454a48..9b60d9ce478 100644 --- a/src/traces/table/attributes.js +++ b/src/traces/table/attributes.js @@ -214,36 +214,6 @@ module.exports = overrideAll({ } }, - font: { - family: { - valType: 'string', - arrayOk: true, - role: 'style', - noBlank: true, - strict: true, - 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 plotly service (at https://plot.ly 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*.' - ].join(' ') - }, - size: { - valType: 'number', - arrayOk: true, - role: 'style' - }, - color: { - valType: 'color', - arrayOk: true, - role: 'style' - } - } + font: extendFlat({}, fontAttrs({arrayOk: true})) } }, 'calc', 'from-root');