relationship-matrix
v1.0.1
Published
AngularJS directive for creating relationship matrix
Downloads
6
Readme
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)
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: '«requirement»' },
{ id: 'r-fe', label: 'FuelEconomy', stereotype: '«requirement»' },
{ id: 'r-fc', label: 'FuelCapacity', stereotype: '«requirement»' },
{ id: 'r-orc', label: 'OffRoadCapability', stereotype: '«requirement»' },
{ id: 'r-acc', label: 'Acceleration', stereotype: '«requirement»' },
{ id: 'r-cc', label: 'CargoCapacity', stereotype: '«requirement»' },
{ id: 'r-pow', label: 'Power', stereotype: '«requirement»' }
],
rows: [{
label: 'RegenerativeBreaking',
stereotype: '«requirement»',
links: {
'r-bk': 'D',
'r-fe' : 'D'
}
}, {
label: 'PowerSourceManagement',
stereotype: '«requirement»',
links: {
'r-fe': 'D',
'r-pow': 'D'
}
}, {
label: 'Range',
stereotype: '«requirement»',
links: {
'r-fe': 'D',
'r-fc' : 'D'
}
}, {
label: 'Power',
stereotype: '«requirement»',
links: {
'r-orc': 'D',
'r-acc': 'D',
'r-cc': 'D'
}
}
]
};
}]);
</script>
</body>
</html>
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.