Giter VIP home page Giter VIP logo

import-graph-visualizer's Introduction

Import Graph Visualizer

npm version License: MIT

Import Graph Visualizer is a development tool for filtering and visualizing import paths within a JavaScript/TypeScript application.

Motivation

Although there are already excellent tools out there for visualizing imports between Node.js modules (e.g. Dependency Cruiser, which is actually used by this tool under the hood), for large apps these graphs may be too large to comprehend. This is why Import Graph Visualizer allows filtering import paths by source and target modules, allowing you to zoom in to a limited subsection of your app, which will likely be easier to analyze than the entire app as a whole.

Examples

Screenshot of Import Graph Visualizer for this repository:

self example

For an Ionic/Angular starter project:

Ionic/Angular example

For vis-network repo:

vis-network example

Setup

To install as a development dependency in your Node project:

npm install --save-dev @rx-angular/import-graph-visualizer

Alternatively, to install as a global dependency (prefix with sudo on Unix systems):

npm install --global @rx-angular/import-graph-visualizer

Usage

To run this tool, you must supply at least one entry point for your application (e.g. src/index.js):

npx @rx-angular/import-graph-visualizer --entry-points path/to/entry/module

For Typescript projects that use path aliases, make sure to also specify your tsconfig.json path:

npx @rx-angular/import-graph-visualizer --entry-points path/to/entry/module --ts-config path/to/tsconfig

For greater convenience, you may wish to add a script to your package.json:

{
  // ...
  "scripts": {
    // ...
    "import-graph-visualizer": "import-graph-visualizer --entry-points path/to/entry/module ..."
  }
}

Then you may run it as:

npm run import-graph-visualizer

Development

For local development, clone this repo and first install dependencies with:

npm install

Then pick a project for testing and generate its dependencies using the CLI:

npm run reporter -- --entry-points path/to/entry/module --ts-config path/to/tsconfig/file

Then run a development server with:

npm start

If you need to update icons and mappings from VSCode Material Icon Theme, run:

npm install --save-dev vscode-material-icons@latest

import-graph-visualizer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

import-graph-visualizer's Issues

Feature proposal - Reporters for JSON and HTML

Description

I would like to add this young but already very nice tool on my CI and it would be awesome if a flag allows us to specify that we want a not live output, as JSON and HTML ๐Ÿ˜‹

Usage suggestion

JSON reporter

  • This JSON would be useful as a data source for other use cases (data processings) or visualizations
yarn run import-graph-visualizer \
    --no-browser-open \
    --report=json \
    --outputPath=dist/my-branch-name \
    --targets="apps/my-app/src/app/app.module.ts" \
    --sources=""

HTML reporter

  • As a code reviewer, I would like to quickly look at the difference introduced by the commit I am reviewing in term of imports in order to have the opportunity to visually identify an anomaly or a dissonance. For this use case, as the human eye is the added value, an HTML output is very nice.
yarn run import-graph-visualizer \
     --no-browser-open \
     --report=html \
     --outputPath=dist/my-branch-name \
     --targets="apps/my-app/src/app/app.module.ts" \
     --sources=""

Note

Thank you for developing and sharing import-graph-visualizer ๐Ÿ™ โค๏ธ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.