Skip to content

Commit 37dee48

Browse files
committed
Revert "no integer weight"
This reverts commit f4d4f4c.
1 parent f0fef6f commit 37dee48

File tree

3 files changed

+1622
-970
lines changed

3 files changed

+1622
-970
lines changed

src/lib/coerce.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,13 @@ exports.valObjectMeta = {
114114
'are coerced to the `dflt`.'
115115
].join(' '),
116116
requiredOpts: [],
117-
otherOpts: ['dflt', 'min', 'max', 'arrayOk'],
117+
otherOpts: ['dflt', 'min', 'max', 'arrayOk', 'extras'],
118118
coerceFunction: function(v, propOut, dflt, opts) {
119+
if((opts.extras || []).indexOf(v) !== -1) {
120+
propOut.set(v);
121+
return;
122+
}
123+
119124
if(v % 1 || !isNumeric(v) ||
120125
(opts.min !== undefined && v < opts.min) ||
121126
(opts.max !== undefined && v > opts.max)) {

src/plots/font_attributes.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ module.exports = function(opts) {
5151

5252
weight: {
5353
editType: editType,
54-
valType: 'enumerated',
55-
values: ['normal', 'bold'],
54+
valType: 'integer',
55+
min: 1,
56+
max: 1000,
57+
extras: ['normal', 'bold'],
5658
dflt: 'normal',
5759
description: [
5860
'Sets the weight (or boldness) of the font.'

0 commit comments

Comments
 (0)