dependrix-visualisation

1.1.1 • Public • Published

dependrix-visualisation

Visualise and compare library usage across multiple projects

Setup your own dependrix visualisation

Dependrix visualises cross-project dependencies using a model as described by schema.json. You can generate a model yourself, or make use of the following:

Build a standalone HTML file

Use the buildStandaloneHTML function exposed by dependrix-visualisation to generate a single HTML file

const fs = require('fs')
const { buildStandaloneHTML } = require('.')

const writeFile = (filename, content) => new Promise((resolve, reject) => fs.writeFile(
  filename,
  content,
  'utf8',
  (err, data) => err ? reject(err) : resolve(content)
))

const model = { projects: {}, analysis: { title: 'An example analysis' } }
buildStandaloneHTML(model)
  .then(html => writeFile('./dependrix-example.html', html))
  .catch(console.error)

Supply your own modelled-dependencies.json

Use the HTML files included in dependrix-visualisation and place them alongside a JSON file containing your model in a location where your webserver can serve them:

mkdir webserver
npm install dependrix-visualisation --save-dev
cp node_modules/dependrix-visualisation/dist/index.html webserver/
cp node_modules/dependrix-visualisation/dist/bundle.min.js webserver/
cp yourDependrixModel.json webserver/modelled-dependencies.json

Local development

Build

npm run build
# or
npm run build -- --watch #automatically re-build whenever changes are made

Run

Open dist/index.html in your browser

Tests

npm test

Tests are run with Jest

Linting

npm run lint

Linting is done with ESLint and is configured to conform code to https://standardjs.com/

Readme

Keywords

none

Package Sidebar

Install

npm i dependrix-visualisation

Weekly Downloads

1

Version

1.1.1

License

ISC

Unpacked Size

329 kB

Total Files

7

Last publish

Collaborators

  • willyc