d3-svg-to-png
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -54,3 +54,3 @@ const inlineStyles = target => { | ||
module.exports = async (target, name, { scale = 1, format = 'png', quality = 0.92, download = true, ignore = null } = {}) => { | ||
module.exports = async (target, name, { scale = 1, format = 'png', quality = 0.92, download = true, ignore = null, cssinline = 1 } = {}) => { | ||
const elt = document.querySelector(target); | ||
@@ -67,3 +67,5 @@ //Remember all HTML, as we will modify the styles | ||
//Set all the css styles inline | ||
inlineStyles(target, ignore); | ||
if(cssinline === 1){ | ||
inlineStyles(target, ignore); | ||
} | ||
@@ -70,0 +72,0 @@ //Copy all html to a new canvas |
{ | ||
"name": "d3-svg-to-png", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Converts SVG elements to PNG and other image formats while keeping CSS styles", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
#d3-svg-to-png | ||
# d3-svg-to-png | ||
@@ -44,4 +44,4 @@ Converts SVG elements in the browser to PNG and other image formats, while keeping CSS styles. Optionally, it returns the data as a promise or downloads it. It can also rescale the svg image, ignore certain DOM elements... | ||
- **quality** (number): Between 0 (lowest) and 1. Affects formats with compression, like jpg. Default: _.92_ | ||
- **download** (boolean): Wether to download the resulting image. Default: _true_ | ||
- **ignore** (string): A CSS selector that, the matched elements of which will not me added to the output. Default: _null_ | ||
- **download** (boolean): Whether to download the resulting image. Default: _true_ | ||
- **ignore** (string): A CSS selector that, the matched elements of which will not be added to the output. Default: _null_ | ||
@@ -48,0 +48,0 @@ ## Notes |
@@ -7,3 +7,4 @@ declare module 'd3-svg-to-png' { | ||
download: boolean | ||
ignore: string | ||
ignore: string, | ||
cssinline: number | ||
} | ||
@@ -13,2 +14,2 @@ function d3ToPng(selector: string, fileName: string, options?: Partial<Options>): Promise<string> | ||
export default d3ToPng | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6965
86