aboutsummaryrefslogtreecommitdiffstats
path: root/ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/boilerplate.js
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2017-02-14 19:41:00 -0500
committerPamela Dragosh <pdragosh@research.att.com>2017-02-14 19:41:32 -0500
commit91d04c64771832a0b8815ffbe1f0f9920320d94d (patch)
treefb02d5e1c84a3d91def9a7ee95bc87f9c046cc96 /ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/boilerplate.js
parentb9d4caa40ef8e3566ac475968bce17b9b64b6939 (diff)
Initial OpenECOMP policy/engine commit
Change-Id: I7dbff37733b661643dd4d1caefa3d7dccc361b6e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/boilerplate.js')
-rw-r--r--ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/boilerplate.js104
1 files changed, 104 insertions, 0 deletions
diff --git a/ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/boilerplate.js b/ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/boilerplate.js
new file mode 100644
index 000000000..3d2360a6c
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/app/fusion/external/d3/js/models/boilerplate.js
@@ -0,0 +1,104 @@
+
+nv.models.chartName = function() {
+ "use strict";
+ //============================================================
+ // Public Variables with Default Settings
+ //------------------------------------------------------------
+
+
+ var margin = {top: 30, right: 10, bottom: 10, left: 10}
+ , width = 960
+ , height = 500
+ , color = nv.utils.getColor(d3.scale.category20c().range())
+ , dispatch = d3.dispatch('stateChange', 'changeState')
+ ;
+
+ //============================================================
+
+
+ //============================================================
+ // Private Variables
+ //------------------------------------------------------------
+
+
+ //============================================================
+
+
+ function chart(selection) {
+ selection.each(function(data) {
+ var availableWidth = width - margin.left - margin.right,
+ availableHeight = height - margin.top - margin.bottom,
+ container = d3.select(this);
+
+
+ //------------------------------------------------------------
+ // Setup Scales
+
+
+ //------------------------------------------------------------
+
+
+ //------------------------------------------------------------
+ // Setup containers and skeleton of chart
+
+ var wrap = container.selectAll('g.nv-wrap.nv-chartName').data([data]);
+ var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-chartName');
+ var gEnter = wrapEnter.append('g');
+ var g = wrap.select('g')
+
+ gEnter.append('g').attr('class', 'nv-mainWrap');
+
+ wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
+
+ //------------------------------------------------------------
+
+
+
+
+ });
+
+ return chart;
+ }
+
+
+ //============================================================
+ // Expose Public Variables
+ //------------------------------------------------------------
+
+
+ chart.dispatch = dispatch;
+
+ chart.options = nv.utils.optionsFunc.bind(chart);
+
+ chart.margin = function(_) {
+ if (!arguments.length) return margin;
+ margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
+ margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
+ margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
+ margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
+ return chart;
+ };
+
+ chart.width = function(_) {
+ if (!arguments.length) return width;
+ width = _;
+ return chart;
+ };
+
+ chart.height = function(_) {
+ if (!arguments.length) return height;
+ height = _;
+ return chart;
+ };
+
+ chart.color = function(_) {
+ if (!arguments.length) return color;
+ color = nv.utils.getColor(_)
+ return chart;
+ };
+
+ //============================================================
+
+
+ return chart;
+}