Git Product home page Git Product logo

ngrx-visualizer's Introduction

NgRx Visualizer

Visualize your ngrx code as a state machine.

Disclaimer

This is not an officially supported Google product.

Purpose

NgRx is composed of actions, events, and reducers. This tool scans the Typescript AST of your codebase and extracts these connections into a graph.

Analyzer Usage

Install the dependencies.

> cd analyzer
> npm install

Using the analyzer CLI, run an analysis on existing an existing ngrx project.

> cd analyzer
> npm start -- -h
> Usage: analyzer.ts [options] <folder>

  Options:

    -V, --version          output the version number
    -c, --classic          use classic module resolution instead of node
    -e, --empty-ref        output references without any usages
    -s, --save <file>      save results to a file
    -r, --remove <regex>   erase part of file path with regex
    -a, --actions <regex>  filter action files with regex
    -x, --exclude <regex>  exclude files from analysis with regex
    -h, --help             output usage information

> npm start -- <somepath>/example-app/ -s example.json --remove <somepath> --exclude "\.d\.ts"

Viewer Usage

Use the precompiled viewer at viewer/bin or compile it yourself by running "npm install; npm run-script build" inside viewer.

If you are developing, you can run a local server and watch for changes using "npm start".

You can either open an analysis file using the file button on the right side of the viewer, or host the viewer and use url query params.

Available Params

load=file.json - Download a graph from the server.

cache=float - Number of days to cache this graph (when expired, graph is redownloaded).

show=path1|path2|... - Show a specific path or paths when the graph is opened.

scale=float - Set the scale of the graph manually.

translate=x,y - Set the translation of the graph manually.

reducerLength=int - Set the number of folders to show for the name of a reducer.

A sample url for a server running with an example.json in the same folder as the viewer: http://server/viewer/bin/index.html?load=example.json&show=example-app/app/books|example-app/app/core&reducerLength=2

Display Modes

The viewer offers three display modes: split reducers, reducers, and no reducers. Split reducers is the default.

In split reducers mode, reducers are removed from the graph. Actions (red) which used to be connected to these reducers (blue), are now converted to blue action nodes. This means that red actions are not in a reducer, and blue actions are. This is the default mode because graphs for larger applications tend to get crowded around reducers.

In reducers mode, no nodes are changed. The reducers are blue, actions red, methods brown, and effects yellow.

In no reducers mode, reducers are removed. The actions are not colored blue like split reducers mode.

Contributing

Contributors are welcome! Please see CONTRIBUTING.md.

License

See LICENSE file.

ngrx-visualizer's People

Stargazers

 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  avatar

ngrx-visualizer's Issues

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.