Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 37dee48

Browse filesBrowse files
committed
Revert "no integer weight"
This reverts commit f4d4f4c.
1 parent f0fef6f commit 37dee48
Copy full SHA for 37dee48

File tree

3 files changed

+1622
-970
lines changed
Filter options

3 files changed

+1622
-970
lines changed

‎src/lib/coerce.js

Copy file name to clipboardExpand all lines: src/lib/coerce.js
+6-1Lines 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

Copy file name to clipboardExpand all lines: src/plots/font_attributes.js
+4-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.