-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
95 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
/** | ||
* Creates new object from target excluding given properties. | ||
*/ | ||
var omitProps = exports.omitProps = function omitProps(target, props) { | ||
return Object.keys(target).reduce(function (r, key) { | ||
if (! ~props.indexOf(key)) { | ||
r[key] = target[key]; | ||
} | ||
return r; | ||
}, {}); | ||
}; | ||
|
||
/** | ||
* Creates new object from target including all available properties. | ||
*/ | ||
var includeProps = exports.includeProps = function includeProps(target, props) { | ||
return Object.keys(target).reduce(function (r, key) { | ||
if (~props.indexOf(key) && key in target) { | ||
r[key] = target[key]; | ||
} | ||
return r; | ||
}, {}); | ||
}; | ||
|
||
/** | ||
* Computes appropriate font size of tag. | ||
*/ | ||
var fontSizeConverter = exports.fontSizeConverter = function fontSizeConverter(count, min, max, minSize, maxSize) { | ||
return Math.round((count - min) * (maxSize - minSize) / (max - min) + minSize); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters