Socket
Book a DemoInstallSign in
Socket

front_screenshot

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

front_screenshot

Mini library, with no dependencies, to output PNGs from maps and reports (or anything in the DOM)

1.1.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Front Screenshot

Build Status

This library bundles

Into an library with no dependencies, that can transform SVG elements into images or Canvas elements, and take screenshots of your page or sections of it, even if they are hidden due to CSS properties such as overlay scroll, hidden or auto.

Why?

Basically, because chart libraries such as C3.js can style SVG elements with rotation and other transformations that HTML2Canvas cannot parse. So I combined its features with the ones on Canvg to preprocess a given container, transforming each SVG element into an image, then capturing the screenshot, then restoring the original SVG.

Some additions and removal of properties, attributes and classnames where cumbersome to add using native document.querySelectorAll methods, so I also bundled Cash.js, a minimal jQuery alternative that provides just what's needed to manipulate DOM nodes.

Example

See the online example at: https://huasofoundries.github.io/front_screenshot/

Or, you can also clone this repo, run make install, then make run from its root and navigate to http://localhost:5000.

git clone https://github.com/HuasoFoundries/front_screenshot.git
cd front_screenshot
make install
make run

API

See USAGE.md

Install

Install it with

npm install front_screenshot

or, if you're using JSPM:

jspm install front_screenshot=npm:front_screenshot
jspm install front_screenshot=github:HuasoFroundries/front_screenshot

Keywords

screenshot

FAQs

Package last updated on 15 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.