Installations
npm install @uirouter/visualizer
Developer
ui-router
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
12.16.0
NPM Version
6.13.4
Statistics
215 Stars
382 Commits
33 Forks
9 Watching
28 Branches
15 Contributors
Updated on 29 Oct 2024
Languages
TypeScript (72%)
CSS (18.23%)
JavaScript (6.37%)
HTML (1.58%)
SCSS (1.22%)
Shell (0.61%)
Total Downloads
Cumulative downloads
Total Downloads
2,089,892
Last day
-9.3%
950
Compared to previous day
Last week
-4.9%
6,282
Compared to previous week
Last month
1%
29,679
Compared to previous month
Last year
9.4%
390,661
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Peer Dependencies
1
UI-Router State Visualizer and Transition Visualizer
Try the Demo plunker
What
Visualizes the state tree and transitions in UI-Router 1.0+.
This script augments your app with two components:
-
State Visualizer: Your UI-Router state tree, showing the active state and its active ancestors (green nodes)
- Clicking a state will transition to that state.
- If your app is large, state trees can be collapsed by double-clicking a state.
- Supports different layouts and zoom.
-
Transition Visualizer: A list of each transition (from one state to another)
- Color coded Transition status (success/error/ignored/redirected)
- Hover over a Transition to show which states were entered/exited, or retained during the transition.
- Click the Transition to see details (parameter values and resolve data)
How
The Visualizer is a UI-Router plugin.
Register the plugin with the UIRouter
object.
Locate the Plugin
-
Using a
<script>
tagAdd the script as a tag in your HTML.
1<script src="//unpkg.com/@uirouter/visualizer@4"></script>
The visualizer Plugin can be found (as a global variable) on the window object.
1var Visualizer = window['@uirouter/visualizer'].Visualizer;
-
Using
require
orimport
(SystemJS, Webpack, etc)Add the npm package to your project
npm install @uirouter/visualizer
- Use
require
or ES6import
:
1var Visualizer = require('@uirouter/visualizer').Visualizer;
1import { Visualizer } from '@uirouter/visualizer';
- Use
Register the plugin
First get a reference to the UIRouter
object instance.
This differs by framework (AngularJS, Angular, React, etc. See below for details).
After getting a reference to the UIRouter
object, register the Visualizer
plugin
1var pluginInstance = uiRouterInstance.plugin(Visualizer);
Â
Configuring the plugin
You can pass a configuration object when registering the plugin. The configuration object may have the following fields:
state
: (boolean) State Visualizer is not rendered when this isfalse
transition
: (boolean) Transition Visualizer is not rendered when this isfalse
stateVisualizer.node.label
: (function) A function that returns the label for a nodestateVisualizer.node.classes
: (function) A function that returns classnames to apply to a node
stateVisualizer.node.label
The labels for tree nodes can be customized.
Provide a function that accepts the node object and the default label and returns a string:
function(node, defaultLabel) { return "label"; }
This example adds (future)
to future states.
Note: node.self
contains a reference to the state declaration object.
1var options = { 2 stateVisualizer: { 3 node: { 4 label: function (node, defaultLabel) { 5 return node.self.name.endsWith('.**') ? defaultLabel + ' (future)' : defaultLabel; 6 }, 7 }, 8 }, 9}; 10 11var pluginInstance = uiRouterInstance.plugin(Visualizer, options);
stateVisualizer.node.classes
The state tree visualizer can be configured to add additional classes to nodes.
Example below marks every node with angular.js view with is-ng1
class.
1var options = { 2 stateVisualizer: { 3 node: { 4 classes(node) { 5 return Object.entries(node.views || {}).some((routeView) => routeView[1] && routeView[1].$type === 'ng1') 6 ? 'is-ng1' 7 : ''; 8 }, 9 }, 10 }, 11}; 12 13var pluginInstance = uiRouterInstance.plugin(Visualizer, options);
Getting a reference to the UIRouter
object
Angular 1
Inject the $uiRouter
router instance in a run block.
1// inject the router instance into a `run` block by name 2app.run(function ($uiRouter) { 3 var pluginInstance = $uiRouter.plugin(Visualizer); 4});
Angular 2
Use a config function in your root module's UIRouterModule.forRoot()
.
The router instance is passed to the config function.
1import { Visualizer } from "@uirouter/visualizer";
2
3...
4
5export function configRouter(router: UIRouter) {
6 var pluginInstance = router.plugin(Visualizer);
7}
8
9...
10
11@NgModule({
12 imports: [ UIRouterModule.forRoot({ config: configRouter }) ]
13 ...
React (Imperative)
Create the UI-Router instance manually by calling new UIRouterReact();
1var Visualizer = require('@uirouter/visualizer').Visualizer; 2var router = new UIRouterReact(); 3var pluginInstance = router.plugin(Visualizer);
React (Declarative)
Add the plugin to your UIRouter
component
1var Visualizer = require('@uirouter/visualizer').Visualizer; 2 3... 4render() { 5 return <UIRouter plugins=[Visualizer]></UIRouter> 6}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/ui-router/visualizer/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/update_dependencies.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/ui-router/visualizer/update_dependencies.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/update_dependencies.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/ui-router/visualizer/update_dependencies.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/update_dependencies.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/ui-router/visualizer/update_dependencies.yml/master?enable=pin
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 2 third-party GitHubAction dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/update_dependencies.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 30 are checked with a SAST tool
Reason
39 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-36jr-mh4h-2g58
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-jc84-3g44-wf2q
- Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr
- Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx
- Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
Score
2.7
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More