Skip to content

Commit

Permalink
Revert "no integer weight"
Browse files Browse the repository at this point in the history
This reverts commit f4d4f4c.
  • Loading branch information
archmoj committed May 3, 2024
1 parent f0fef6f commit 37dee48
Show file tree
Hide file tree
Showing 3 changed files with 1,622 additions and 970 deletions.
7 changes: 6 additions & 1 deletion src/lib/coerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,13 @@ exports.valObjectMeta = {
'are coerced to the `dflt`.'
].join(' '),
requiredOpts: [],
otherOpts: ['dflt', 'min', 'max', 'arrayOk'],
otherOpts: ['dflt', 'min', 'max', 'arrayOk', 'extras'],
coerceFunction: function(v, propOut, dflt, opts) {
if((opts.extras || []).indexOf(v) !== -1) {
propOut.set(v);
return;
}

if(v % 1 || !isNumeric(v) ||
(opts.min !== undefined && v < opts.min) ||
(opts.max !== undefined && v > opts.max)) {
Expand Down
6 changes: 4 additions & 2 deletions src/plots/font_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ module.exports = function(opts) {

weight: {
editType: editType,
valType: 'enumerated',
values: ['normal', 'bold'],
valType: 'integer',
min: 1,
max: 1000,
extras: ['normal', 'bold'],
dflt: 'normal',
description: [
'Sets the weight (or boldness) of the font.'
Expand Down

0 comments on commit 37dee48

Please sign in to comment.