Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-svg-to-png

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-svg-to-png - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

6

index.js

@@ -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
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc