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

inheritance-diagram

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inheritance-diagram

Build an inheritance diagram for a class

  • 3.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Inheritance diagram builder

This builds an inheritance diagram for some node of interest (NOI). Initially it is designed to use in documentations with class description to show parent stack, mixed in nodes and the whole tree of children.

Nodes that contains link property will be highlighted and will behave as usual link element to allow fast jumping to the next interested node in the documentation.

Mainly this library was created for JSDoc (the JSDoc plugin is jsdoc-inheritance-diagram), but it can be used as a core for other purposes.

Limitations and known issues

  1. Arrows at the end of connection line cannot inherit the line styles (colors).

Due to upcomming features/improvements in SVG v2 the above limitations will not have coded workarounds.

Hope SVG v2 will be released and implemented by browsers soon, or maybe some other idea comes to me later :)

Exmaple

The example can be found in example.js file.

npm install inheritance-diagram
node example.js

If CSS from an external file must be applied to the diagram, then an additional code is needed for this, for example:

const diagramBuilder = require('inheritance-diagram');

require('fs').readFile('styles.css', 'utf8', async (err, data) => {
	if (err) {
		throw err;
	}

	const result = await diagramBuilder('inheritance-diagram'))('...', {...}, {
		css: data
	});
});

Result

Example of an inheritance diagram

Keywords

FAQs

Package last updated on 15 Aug 2020

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