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

pcnchart

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pcnchart

Create an SVG string to display Process Chain Network data

  • 0.10.0
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

pcnchart

Utility for generating an SVG flowchart from Process Chain Network

pcnchart takes a single input; data conforming to the following specification:

https://github.com/mjswensen/pcn-spec

It outputs an SVG String.

##Installation##

npm install pcnchart

##Server-Side Usage##

For simple server-side rendering with an Express controller:

var charter = require('pcnchart');

exports.graph = function(req, res) {

  // Send PCN data conforming to Specification to chart utility
  var svg = charter(pcnDataStructure);

  // Set HTTP Headers for SVG
  res.set({
    'Content-Type': 'image/svg+xml',
    // Note: Sometimes necessary for embedding on a page 
    // 'X-Frame-Options': 'SAMEORIGIN' 
  });
  res.send(svg);
}

##Client-Side Usage##

Rendering on the client is also simple by using tools such as Browserify to include pcnchart into your browser scripts.

var charter = require('pcnchart'); // Browserify or similar for using NPM

/* Get pcnDataStructure conforming to Specification */
var pcnDataStructure;

var svgElement = charter(pcnDataStructure);

// Append the parsed SVG into a container
var container = document.getElementById('someContainerId');
container.appendChild(svgElement);

Keywords

FAQs

Package last updated on 03 Dec 2014

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

  • 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