npm

Need private packages and team management tools?Check out npm Orgs. »

relationship-matrix

1.0.1 • Public • Published

Relationship Matrix

The Relationship Matrix is a convenient method of visualizing relationships quickly and definitively. It shows the relationship between two, three or four groups of information. The intention behind the relationship matrix is to make explicit how strong the relationship between each pair of activities is.

Available components

AngularJS directive (angular-relationship-matrix-directive.js)

Example Matrix 1

Example Matrix 2

Example Matrix 3

Install angular-relationship-matrix-directive.js

Build the files yourself, download from bower

npm install angular-relationship-matrix-directive --save

Use angular-relationship-matrix-directive.js

In your html/template add

...
  <link rel="stylesheet" href="./node_modules/relationship-matrix/css/directive.css">
...
  <script src="./node_modules/relationship-matrix/angular-relationship-matrix-directive.js"></script> 
...

In your application, declare dependency injection like so..

var app = angular.module('<YourModuleName>', ['angular-relationship-matrix-directive']);

Complete code example

<!DOCTYPE html>
<html>
<head>
  <title>Relationship Matrix</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="./node_modules/relationship-matrix/css/directive.css">
  <link rel="stylesheet" type="text/css" href="./node_modules/relationship-matrix/css/example.css">
</head>
<body ng-app="DemoApp" ng-controller="Controller">
  <div relationship-matrix materix-data="matrixData"></div>
  <h3>JSON</h3>
  <pre>{{matrixData | json }}</pre>
  <script type="text/javascript" src="./node_modules/angular/angular.js"></script> 
  <script type="text/javascript" src="./node_modules/angular-sanitize/angular-sanitize.js"></script> 
  <script type="text/javascript" src="./node_modules/relationship-matrix/angular-relationship-matrix-directive.js"></script> 
  <script type="text/javascript">
    
  angular.module('DemoApp', ['angular-relationship-matrix-directive'])
    .controller('Controller',['$scope', function($scope) {
 
      $scope.matrixData = {
        title: 'Derived Requirements from Lowest Tier of Requirements Hierarchy',
        notes: '* This is comment...',
        legendKeys: {
          'D': {
            label: 'DeriveReqt',
            color: 'yellow'
          }
        },
        cols: [
          { id: 'r-bk', label: 'Breaking', stereotype: '&laquo;requirement&raquo;' },
          { id: 'r-fe', label: 'FuelEconomy', stereotype: '&laquo;requirement&raquo;' },
          { id: 'r-fc', label: 'FuelCapacity', stereotype: '&laquo;requirement&raquo;' },
          { id: 'r-orc', label: 'OffRoadCapability', stereotype: '&laquo;requirement&raquo;' },
          { id: 'r-acc', label: 'Acceleration', stereotype: '&laquo;requirement&raquo;' },
          { id: 'r-cc', label: 'CargoCapacity', stereotype: '&laquo;requirement&raquo;' },
          { id: 'r-pow', label: 'Power', stereotype: '&laquo;requirement&raquo;' }
        ],
        rows: [{ 
            label: 'RegenerativeBreaking',
            stereotype: '&laquo;requirement&raquo;',
            links: {
              'r-bk': 'D', 
              'r-fe' : 'D'
            }
          }, {
            label: 'PowerSourceManagement',
            stereotype: '&laquo;requirement&raquo;',
            links: {
              'r-fe': 'D',
              'r-pow': 'D'
            }
          }, {
            label: 'Range',
            stereotype: '&laquo;requirement&raquo;',
            links: {
              'r-fe': 'D', 
              'r-fc' : 'D'
            }
          }, {
            label: 'Power',
            stereotype: '&laquo;requirement&raquo;',
            links: {
              'r-orc': 'D',
              'r-acc': 'D',
              'r-cc': 'D'
            }
          }
        ]
      };
 
    }]);
  </script> 
</body>
</html>

More examples

License

The MIT License (MIT)

Copyright (c) 2017 Vorachet Jaroensawas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

none

install

npm i relationship-matrix

Downloadsweekly downloads

7

version

1.0.1

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability