New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@flourish/pocket-knife

Package Overview
Dependencies
Maintainers
31
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flourish/pocket-knife - npm Package Compare versions

Comparing version

to
0.10.0

4

package.json
{
"name": "@flourish/pocket-knife",
"version": "0.9.0",
"version": "0.10.0",
"description": "Flourish module with handy tools",

@@ -15,3 +15,3 @@ "main": "pocket-knife.js",

"author": "Kiln Enterprises Ltd",
"license": "UNLICENSED",
"license": "https://flourish.studio/terms/fcl/",
"devDependencies": {

@@ -18,0 +18,0 @@ "@flourish/eslint-plugin-flourish": "^0.7.2",

@@ -39,2 +39,4 @@ # Flourish pocket knife 🇨🇭

### remToPx(rem)
Converts value specified in rems to px

@@ -41,0 +43,0 @@ ### wrapStringToLines(label, label_styles, text_max_lines, max_width)

@@ -0,1 +1,7 @@

### 0.10.0
* Add `remToPx()`
### 0.9.1
* Update module license
### 0.9.0

@@ -2,0 +8,0 @@ * Add `getTextDimensions` and `getTextHeight`

import { color } from "d3-color";
import { set as d3_set } from "d3-collection";
function remToPx(rem) {
var window_width, base_size;
if (window.innerWidth !== window_width) {
window_width = window.innerWidth;
base_size = parseFloat(getComputedStyle(document.documentElement).fontSize);
}
return rem * base_size;
}
var getTextDimensions = (function() {

@@ -136,2 +145,2 @@ var context = document.createElement("canvas").getContext("2d");

export { getTextDimensions, getTextWidth, getTextHeight, isImage, isPale, isUrl, hexToColor, hexToRgba, wrapStringToLines, getUniqueValuesFromBinding };
export { remToPx, getTextDimensions, getTextWidth, getTextHeight, isImage, isPale, isUrl, hexToColor, hexToRgba, wrapStringToLines, getUniqueValuesFromBinding };