diff --git a/README.md b/README.md
index a6cb1eb..ba16649 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,8 @@
Build Setup
+![Screenshot](https://user-images.githubusercontent.com/5210420/48297569-b85bcd80-e479-11e8-85ad-b1a4cc00967f.gif)
+
## Purpose
This plugin is designed to allow Vue.js developers to incorporate fully reactive and customizable charts into their applications. The plugin is built off of the D3.js JavaScript library for manipulating documents based on data. By binding data from your components, you can create complex charts and graphs that respond to changes in your application. Vue.js lifecycle events will trigger the charts to update and maintain two-way binding between your charts and your data. By adding in a state management (such as Vuex) you can additionally persist state across an entire application.
@@ -145,9 +147,6 @@ If you wish to style the components of the chart you can via the selectors:
}
```
-![screenshot](https://user-images.githubusercontent.com/5210420/47540328-a3d8dc00-d8a2-11e8-9948-3f878e01109f.gif)
-
-
## Performance Consideration
By default all charts are imported into v-chart-plugin.js. This allows all charts to share one common interface. If you are only using a few select charts in your implementation you can remove those unused charts from the import statements in the v-chart-plugin.js.
diff --git a/dist/index.html b/dist/index.html
index e731e6d..23ea826 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -1 +1 @@
-v-chart-plugin
\ No newline at end of file
+v-chart-plugin
\ No newline at end of file
diff --git a/dist/module/assets/data/sales.js b/dist/module/assets/data/sales.js
index 2c1d1ea..b0b91b8 100644
--- a/dist/module/assets/data/sales.js
+++ b/dist/module/assets/data/sales.js
@@ -3,60 +3,84 @@ export default [{
month: 'Jan',
year: 2018,
total: 475,
+ forecast: 500,
+ yoy: 1.05,
actual: true
}, {
month: 'Feb',
year: 2018,
total: 515,
+ forecast: 525,
+ yoy: 1.03,
actual: true
}, {
month: 'Mar',
year: 2018,
total: 390,
+ forecast: 480,
+ yoy: .95,
actual: true
}, {
month: 'Apr',
year: 2018,
total: 430,
+ forecast: 440,
+ yoy: .80,
actual: true
}, {
month: 'May',
year: 2018,
total: 510,
+ forecast: 500,
+ yoy: .70,
actual: true
}, {
month: 'Jun',
year: 2018,
total: 399,
+ forecast: 450,
+ yoy: .75,
actual: true
}, {
month: 'Jul',
year: 2018,
total: 601,
+ forecast: 550,
+ yoy: 1.00,
actual: true
}, {
month: 'Aug',
year: 2018,
total: 496,
+ forecast: 480,
+ yoy: 1.15,
actual: true
}, {
month: 'Sep',
year: 2018,
total: 379,
+ forecast: 440,
+ yoy: 1.10,
actual: true
}, {
month: 'Oct',
year: 2018,
total: 410,
+ forecast: 430,
+ yoy: .85,
actual: false
}, {
month: 'Nov',
year: 2018,
total: 490,
+ forecast: 500,
+ yoy: .95,
actual: false
}, {
month: 'Dec',
year: 2018,
total: 610,
+ forecast: 625,
+ yoy: 1.01,
actual: false
}];
\ No newline at end of file
diff --git a/dist/module/import/lineGraph.js b/dist/module/import/lineGraph.js
index e61d911..e09b77b 100644
--- a/dist/module/import/lineGraph.js
+++ b/dist/module/import/lineGraph.js
@@ -27,7 +27,7 @@ var lineGraph = function chart(mode) {
*/
var cs = {
palette: {
- lineFill: '#ffcdcd',
+ lineFill: ['#ffcdcd', '#005792'],
pointFill: '#005792',
pointStroke: '#d1f4fa'
},
@@ -49,18 +49,23 @@ var lineGraph = function chart(mode) {
* @param {Object} points (svg element)
*/
var enter = function enter(points, path) {
- if (mode === 'init') path.enter().append('path').attr('d', cs.lineFunction(_this.ds)).attr('fill', 'none').attr('stroke', cs.palette.lineFill).attr('stroke-width', 3);
-
- points.enter().append('circle').attr('class', _this.selector).attr('r', 2).on('mouseover', function (d) {
- _this.addTooltip(d, window.event);
- }).on('mouseout', function (d) {
- _this.removeTooltip(d);
- }).attr('cx', function (d) {
- return cs.x.scale(d.dim) + cs.y.axisWidth + 5;
- }).attr('cy', function (d) {
- return cs.y.scale(d.metric);
+ _this.metric.forEach(function (e, i) {
+ path[i].enter().append('path').attr('d', cs.lineFunction[i](_this.ds)).attr('fill', 'none').attr('id', 'p' + i).attr('stroke', cs.palette.lineFill[i]).attr('stroke-width', 3);
});
- return points;
+
+ // points.enter()
+ // .append('circle')
+ // .attr('class', this.selector)
+ // .attr('r', 2)
+ // .on('mouseover', (d) => {
+ // this.addTooltip(d, window.event);
+ // })
+ // .on('mouseout', (d) => {
+ // this.removeTooltip(d);
+ // })
+ // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
+ // .attr('cy', d => cs.y.scale(d.metric[0]));
+ // return points;
};
/**
* Runs when a value of an element in dataset is changed
@@ -69,18 +74,16 @@ var lineGraph = function chart(mode) {
* @param {Object} points (svg element)
*/
var transition = function transition(points, path) {
- path.transition().attr('d', cs.lineFunction(_this.ds));
-
- points.transition().attr('cx', function (d) {
- return cs.x.scale(d.dim) + cs.y.axisWidth + 5;
- }).attr('cy', function (d) {
- return cs.y.scale(d.metric);
- }).attr('cx', function (d) {
- return cs.x.scale(d.dim) + cs.y.axisWidth + 5;
- }).attr('cy', function (d) {
- return cs.y.scale(d.metric);
+ _this.metric.forEach(function (e, i) {
+ path[i].transition().attr('d', cs.lineFunction[i](_this.ds));
});
- return points;
+
+ // points.transition()
+ // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
+ // .attr('cy', d => cs.y.scale(d.metric[0]))
+ // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
+ // .attr('cy', d => cs.y.scale(d.metric[0]));
+ // return points;
};
/**
@@ -91,7 +94,9 @@ var lineGraph = function chart(mode) {
*/
var exit = function exit(points, path) {
points.exit().remove();
- path.exit().remove();
+ _this.metric.forEach(function (e, i) {
+ path[i].exit().remove();
+ });
return points;
};
@@ -100,9 +105,8 @@ var lineGraph = function chart(mode) {
* @member buildScales
* @function
*/
- var buildScales = function buildScales() {
+ var buildScales = function buildScales(cs) {
cs.y.scale = d3.scaleLinear().domain([_this.min, _this.max]).range([_this.displayHeight - cs.x.axisHeight, _this.header]);
- cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);
_this.ds.forEach(function (t) {
return cs.x.domain.push(t.dim);
});
@@ -116,22 +120,31 @@ var lineGraph = function chart(mode) {
* @member drawAxis
* @function
*/
- var drawAxis = function drawAxis() {
+ var drawAxis = function drawAxis(cs) {
cs.x.axis = d3.axisBottom().scale(cs.x.scale);
cs.x.xOffset = cs.y.axisWidth + 5;
cs.x.yOffset = _this.displayHeight - cs.x.axisHeight;
+ cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);
cs.y.xOffset = cs.y.axisWidth;
cs.y.yOffset = 0;
+ svgContainer.append('g').attr('class', 'axis').attr('transform', 'translate(' + cs.x.xOffset + ', ' + cs.x.yOffset + ')').call(cs.x.axis);
+ svgContainer.append('g').attr('class', 'axis').attr('transform', 'translate(' + cs.y.xOffset + ',' + cs.y.yOffset + ')').call(cs.y.axis);
};
- cs.lineFunction = d3.line().x(function (d) {
- return cs.x.scale(d.dim) + cs.y.axisWidth + 5;
- }).y(function (d) {
- return cs.y.scale(d.metric);
+ cs.lineFunction = [];
+ this.metric.forEach(function (e, i) {
+ cs.lineFunction.push(d3.line().x(function (d) {
+ return cs.x.scale(d.dim) + cs.y.axisWidth + 5;
+ }).y(function (d) {
+ return cs.y.scale(d.metric[i]);
+ }));
});
var points = svgContainer.selectAll('circle').data(this.ds);
- var path = svgContainer.selectAll('path').data(this.ds);
+ var path = [];
+ this.metric.forEach(function (e, i) {
+ path.push(svgContainer.selectAll('path#p' + i).data(_this.ds));
+ });
cs = this.setOverrides(cs, this.chartData.overrides);
@@ -141,9 +154,6 @@ var lineGraph = function chart(mode) {
transition(points, path);
exit(points, path);
- svgContainer.append('g').append('g').attr('class', 'axis').attr('transform', 'translate(' + cs.x.xOffset + ', ' + cs.x.yOffset + ')').call(cs.x.axis);
- svgContainer.append('g').append('g').attr('class', 'axis').attr('transform', 'translate(' + cs.y.xOffset + ',' + cs.y.yOffset + ')').call(cs.y.axis);
-
return cs;
};
diff --git a/dist/module/v-chart-plugin.js b/dist/module/v-chart-plugin.js
index 70a594a..889094f 100644
--- a/dist/module/v-chart-plugin.js
+++ b/dist/module/v-chart-plugin.js
@@ -147,7 +147,7 @@ var Chart = {
*/
generateLegend: function generateLegend(cs) {
if (this.chartData.legends && this.chartData.legends.enabled === true) {
- d3.select('#' + this.chartData.selector).append('text').attr('x', this.width - 60).attr('y', this.height * 0.95).style('text-anchor', 'middle').text(this.chartData.metric);
+ d3.select('#' + this.chartData.selector).append('text').attr('x', this.width - 60).attr('y', this.height * 0.95).style('text-anchor', 'middle').text(this.chartData.metric[0]);
d3.select('#' + this.chartData.selector).append("g").attr("class", "legends").append("rect").attr('x', this.width - 30).attr('y', this.height * 0.95 - 10).attr("width", 30).attr("height", 10).style("fill", function () {
var fill = cs.palette.lineFill || cs.palette.fill;
@@ -165,14 +165,37 @@ var Chart = {
ds: function ds() {
var _this = this;
- return this.chartData.data.map(function (d) {
- var td = {};
- td.metric = _this.chartData.metric ? d[_this.chartData.metric] : d;
+ //TODO add in support for arrays with undefined metric
+ var ds = { metric: [] };
+ if (!Array.isArray(this.chartData.metric)) {
+ ds.metric.push(this.chartData.metric);
+ } else {
+ ds.metric = this.chartData.metric;
+ }
+ ds.dim = this.chartData.dim;
+ ds.data = this.chartData.data;
+
+ return ds.data.map(function (d) {
+ var td = {
+ metric: []
+ };
+ ds.metric.forEach(function (e, i) {
+ td.metric[i] = d[e] || 0;
+ });
td.dim = _this.chartData.dim ? d[_this.chartData.dim] : null;
return td;
});
},
+ /**
+ * Metric getter function
+ * @memberOf Chart
+ * @returns {array} Metrics
+ */
+ metric: function metric() {
+ return this.chartData.metric;
+ },
+
/**
* Height getter function
* @memberOf Chart
@@ -198,8 +221,12 @@ var Chart = {
*/
max: function max() {
var max = 0;
+ var results = [];
this.ds.forEach(function (e) {
- max = max > e.metric ? max : e.metric;
+ results = results.concat([].concat(_toConsumableArray(e.metric)));
+ });
+ results.forEach(function (e) {
+ max = max > e ? max : e;
});
return max;
},
@@ -210,21 +237,16 @@ var Chart = {
* @returns {number} Min value for metric
*/
min: function min() {
- return Math.min.apply(Math, _toConsumableArray(this.ds.map(function (o) {
- return o.metric;
+ var max = 0;
+ var results = [];
+ this.ds.forEach(function (e) {
+ results = results.concat([].concat(_toConsumableArray(e.metric)));
+ });
+ return Math.min.apply(Math, _toConsumableArray(results.map(function (o) {
+ return o;
})));
},
- /**
- * Gets the height of the title
- * @memberOf Chart
- * @returns {number} Height of the chart title
- */
- titleHeight: function titleHeight() {
- if (this.chartData.title) return this.chartData.textHeight || 25;
- return 0;
- },
-
/**
* Gets the height of the dispaly area
* @memberOf Chart
@@ -238,6 +260,16 @@ var Chart = {
}
},
+ /**
+ * Gets the height of the title
+ * @memberOf Chart
+ * @returns {number} Height of the chart title
+ */
+ titleHeight: function titleHeight() {
+ if (this.chartData.title) return this.chartData.textHeight || 25;
+ return 0;
+ },
+
/**
* Gets the subtitle height
* @memberOf Chart
diff --git a/dist/static/js/app.d0cfa1f5b8fb363d2216.js b/dist/static/js/app.d0cfa1f5b8fb363d2216.js
new file mode 100644
index 0000000..ffcbfd9
--- /dev/null
+++ b/dist/static/js/app.d0cfa1f5b8fb363d2216.js
@@ -0,0 +1,2 @@
+webpackJsonp([1],{"Gf/I":function(t,a){},IYc2:function(t,a){},NHnr:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var i=e("7+uW"),r=e("Gu7T"),s=e.n(r),n=e("BO1k"),c=e.n(n),l=e("fZjL"),h=e.n(l),o=e("Dd8w"),d=e.n(o),f=e("woOf"),u=e.n(f),x=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("bmQh")),m=function(){var t=this,a=x.select("#"+this.chartData.selector),e={palette:{fill:"#005792",stroke:"#d1f4fa"},bar:{hPadding:8,vPadding:5},x:{axisHeight:10,ticks:5},y:{domain:[],range:[],axisWidth:null}},i=function(t){return e.x.scale(t.metric)},r=function(){return(t.displayHeight-e.x.axisHeight-t.header-e.bar.vPadding)/t.ds.length-1},s=function(a,i){return i*(t.displayHeight-e.x.axisHeight-t.header)/t.ds.length+1+t.header},n=function(a){t.addTooltip(a,window.event)},c=function(a){t.removeTooltip(a)},l=a.selectAll("rect").data(this.ds);return e=this.setOverrides(e,this.chartData.overrides),this.ds[0].dim&&(e.y.axisWidth=e.y.axisWidth||10*this.ds.reduce(function(t,a){return a.dim.length>t?a.dim.length:t},0)),e.x.scale=x.scaleLinear().domain([0,t.max]).range([0,t.width-e.bar.hPadding-e.y.axisWidth]),t.ds.forEach(function(t){return e.y.domain.push(t.dim)}),t.ds.forEach(function(a,i){return e.y.range.push((t.displayHeight-e.x.axisHeight-t.header+e.bar.vPadding)*i/t.ds.length)}),e.y.scale=x.scaleOrdinal().domain(e.y.domain).range(e.y.range),e.x.axis=x.axisBottom().ticks(e.x.ticks,"s").scale(e.x.scale),e.y.axis=x.axisLeft().scale(e.y.scale),e.x.yOffset=t.displayHeight-e.x.axisHeight,e.x.xOffset=e.bar.hPadding+e.y.axisWidth,e.y.yOffset=e.bar.vPadding+t.header-1,e.y.xOffset=e.y.axisWidth,t.ds[0].dim&&a.append("g").attr("class","axis").attr("transform","translate("+e.y.xOffset+", "+e.y.yOffset+")").call(e.y.axis),a.append("g").attr("class","axis").attr("transform","translate("+e.x.xOffset+", "+e.x.yOffset+")").call(e.x.axis),function(a){a.enter().append("rect").attr("fill",e.palette.fill).attr("stroke",e.palette.stroke).attr("class",t.selector).attr("width",i).attr("height",r).attr("y",s).attr("x",e.y.axisWidth+e.bar.hPadding).on("mouseover",n).on("mouseout",c)}(l),function(t){t.transition().attr("width",i).attr("height",r).attr("y",s).attr("x",e.y.axisWidth+e.bar.hPadding)}(l),function(t){t.exit().remove()}(l),e},y=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("n7yu")),p=function(){var t=this,a=y.select("#"+this.chartData.selector),e={palette:{fill:"#005792",stroke:"#d1f4fa"},bar:{hPadding:0,vPadding:0},x:{axisHeight:20,domain:[],range:[]},y:{axisWidth:30,ticks:5}},i=function(){return(t.width-e.y.axisWidth)/t.chartData.data.length-1},r=function(a){return t.displayHeight-e.y.scale(a.metric)},s=function(a,i){return i*(t.width-e.y.axisWidth)/t.chartData.data.length+e.y.axisWidth},n=function(t){return e.y.scale(t.metric)},c=function(a){t.addTooltip(a,window.event)},l=function(a){t.removeTooltip(a)},h=a.selectAll("rect").data(this.ds);return(e=this.setOverrides(e,this.chartData.overrides)).y.scale=y.scaleLinear().domain([0,t.max]).range([t.displayHeight,t.header]),t.ds.forEach(function(t){return e.x.domain.push(t.dim)}),t.ds.forEach(function(a,i){return e.x.range.push((t.chartData.width-e.y.axisWidth+e.bar.vPadding)*i/t.ds.length)}),e.x.scale=y.scaleOrdinal().domain(e.x.domain).range(e.x.range),e.y.axis=y.axisLeft().ticks(e.y.ticks,"s").scale(e.y.scale),e.x.axis=y.axisBottom().scale(e.x.scale),e.x.yOffset=t.displayHeight,e.x.xOffset=e.y.axisWidth,e.y.yOffset=0,e.y.xOffset=e.y.axisWidth,a.append("g").attr("class","axis").attr("transform","translate("+e.y.xOffset+", "+e.y.yOffset+")").call(e.y.axis),t.ds[0].dim&&a.append("g").attr("class","axis").attr("transform","translate("+e.x.xOffset+", "+e.x.yOffset+")").call(e.x.axis),function(a){a.enter().append("rect").attr("fill",e.palette.fill).attr("stroke",e.palette.stroke).attr("class",t.selector).attr("width",i).attr("height",r).attr("x",s).attr("y",n).on("mouseover",c).on("mouseout",l)}(h),function(t){t.transition().attr("width",i).attr("height",r).attr("x",s).attr("y",n)}(h),function(t){t.exit().remove()}(h),e},g=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),v=function(t){var a=this,e=g.select("#"+this.chartData.selector),i={palette:{lineFill:["#ffcdcd","#005792"],pointFill:"#005792",pointStroke:"#d1f4fa"},x:{domain:[],range:[],axisHeight:20},y:{axisWidth:30,ticks:5}};i.lineFunction=[],this.metric.forEach(function(t,a){i.lineFunction.push(g.line().x(function(t){return i.x.scale(t.dim)+i.y.axisWidth+5}).y(function(t){return i.y.scale(t.metric[a])}))});var r=e.selectAll("circle").data(this.ds),s=[];return this.metric.forEach(function(t,i){s.push(e.selectAll("path#p"+i).data(a.ds))}),function(t){t.y.scale=g.scaleLinear().domain([a.min,a.max]).range([a.displayHeight-t.x.axisHeight,a.header]),a.ds.forEach(function(a){return t.x.domain.push(a.dim)}),a.ds.forEach(function(e,i){return t.x.range.push((a.width*i-a.header)/a.ds.length)}),t.x.scale=g.scaleOrdinal().domain(t.x.domain).range(t.x.range)}(i=this.setOverrides(i,this.chartData.overrides)),function(t){t.x.axis=g.axisBottom().scale(t.x.scale),t.x.xOffset=t.y.axisWidth+5,t.x.yOffset=a.displayHeight-t.x.axisHeight,t.y.axis=g.axisLeft().ticks(t.y.ticks,"s").scale(t.y.scale),t.y.xOffset=t.y.axisWidth,t.y.yOffset=0,e.append("g").attr("class","axis").attr("transform","translate("+t.x.xOffset+", "+t.x.yOffset+")").call(t.x.axis),e.append("g").attr("class","axis").attr("transform","translate("+t.y.xOffset+","+t.y.yOffset+")").call(t.y.axis)}(i),function(t,e){a.metric.forEach(function(t,r){e[r].enter().append("path").attr("d",i.lineFunction[r](a.ds)).attr("fill","none").attr("id","p"+r).attr("stroke",i.palette.lineFill[r]).attr("stroke-width",3)})}(0,s),function(t,e){a.metric.forEach(function(t,r){e[r].transition().attr("d",i.lineFunction[r](a.ds))})}(0,s),function(t,e){t.exit().remove(),a.metric.forEach(function(t,a){e[a].exit().remove()})}(r,s),i},D=u()({},e("sHXk"),e("dJjO"),e("Mx2h")),w=function(){var t=this,a=D.select("#"+this.chartData.selector),e={x:{domain:[],range:[],axisHeight:20},y:{axisWidth:30,ticks:5}},i=a.selectAll("circle").data(this.ds);return(e=this.setOverrides(e,this.chartData.overrides)).y.scale=D.scaleLinear().domain([t.min,t.max]).range([t.displayHeight-e.x.axisHeight,t.header]),e.y.axis=D.axisLeft().ticks(e.y.ticks,"s").scale(e.y.scale),t.ds.forEach(function(t){return e.x.domain.push(t.dim)}),t.ds.forEach(function(a,i){return e.x.range.push((t.width*i-t.header)/t.ds.length)}),e.x.scale=D.scaleOrdinal().domain(e.x.domain).range(e.x.range),e.x.axis=D.axisBottom().scale(e.x.scale),e.x.xOffset=e.y.axisWidth+5,e.x.yOffset=t.height-e.x.axisHeight,e.y.xOffset=e.y.axisWidth,e.y.yOffset=0,a.append("g").attr("class","axis").attr("transform","translate("+e.x.xOffset+", "+e.x.yOffset+")").call(e.x.axis),a.append("g").attr("class","axis").attr("transform","translate("+e.y.xOffset+","+e.y.yOffset+")").call(e.y.axis),i.enter().append("circle").attr("class",t.selector).attr("r",2).on("mouseover",function(a){t.addTooltip(a,window.event)}).on("mouseout",function(a){t.removeTooltip(a)}).attr("cx",function(t){return e.x.scale(t.dim)+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric)}),function(t){t.transition().attr("cx",function(t){return e.x.scale(t.dim)+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric)}).attr("cx",function(t){return e.x.scale(t.dim)+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric)})}(i),i.exit().remove(),e},O=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),b=function(){var t=this,a=O.select("#"+this.chartData.selector),e={radius:null,ordinalColors:["#d1f4fa","#005792","#ffe6eb","#ffcdcd"]};e.radius=this.height>this.width?(this.width-.1*this.width)/2:(this.height-.1*this.height)/2;var i=O.scaleOrdinal().range(e.ordinalColors),r=function(t,a){return i(a)},s=function(a){t.addTooltip(a.data,window.event)},n=function(a){t.removeTooltip(a)},c=O.arc().outerRadius(e.radius-10).innerRadius(25),l=O.pie().sort(null).value(function(t){return t.metric}),h=a.selectAll(".arc").data(l(this.ds));return e=this.setOverrides(e,this.chartData.overrides),function(a){a.enter().append("g").attr("transform","translate("+t.width/2+","+t.height/2+")").append("path").merge(a).attr("class","arc").attr("d",c).attr("fill",r).on("mouseover",s).on("mouseout",n).attr("transform","translate(0,"+t.header+")")}(h),function(t){t.transition().attr("d",c).attr("fill",r)}(h),function(t){t.exit().remove()}(h),e},H=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),C=function(){var t=this,a=H.select("#"+this.chartData.selector),e={palette:{stroke:"#d1f4fa",fill:"#005792"},x:{domain:[],range:[],axisHeight:45,axisWidth:45},y:{axisWidth:45}},i=function(a){var i=" "+t.width+", "+e.x.yOffset+" ";return i+=" "+e.x.axisHeight+", "+e.x.yOffset+" ",i+=a.map(function(t){return[e.x.scale(t.dim)+e.y.axisWidth+5,e.y.scale(t.metric)].join(",")}).join(" ")},r=a.selectAll("polygon").data([this.ds]);return(e=this.setOverrides(e,this.chartData.overrides)).y.scale=H.scaleLinear().domain([0,t.max]).range([t.displayHeight-e.x.axisHeight,t.titleHeight]),e.y.axis=H.axisLeft().ticks(10,"s").scale(e.y.scale),t.ds.forEach(function(t){return e.x.domain.push(t.dim)}),t.ds.forEach(function(a,i){return e.x.range.push((t.width-e.x.axisWidth)*i/t.ds.length)}),e.x.scale=H.scaleOrdinal().domain(e.x.domain).range(e.x.range),e.x.axis=H.axisBottom().scale(e.x.scale),e.polyFunction=H.line().x(function(t){return e.x.scale(t.dim)+e.y.axisWidth+5}).y(function(t){return e.y.scale(t.metric)}),e.x.xOffset=e.y.axisWidth+5,e.x.yOffset=t.displayHeight-e.x.axisHeight,e.y.xOffset=e.y.axisWidth,e.y.yOffset=0,a.append("g").append("g").attr("class","axis").attr("transform","translate("+e.x.xOffset+", "+e.x.yOffset+")").call(e.x.axis),t.ds[0].dim&&a.append("g").append("g").attr("class","axis").attr("transform","translate("+e.y.xOffset+","+e.y.yOffset+")").call(e.y.axis),r.enter().append("polygon").attr("stroke",e.palette.stroke).attr("fill",e.palette.fill).attr("points",i),function(t){t.transition().attr("points",i)}(r),function(t){t.exit().remove()}(r),e},k=u()({},e("sHXk")),W={install:function(t){t.component("v-chart",{props:["chartData"],data:function(){return{selector:this.chartData.selector+"-"+this.chartData.chartType}},methods:d()({initalizeChart:function(){var t=this[this.chartData.chartType]("init");this.drawTitle(),this.generateLegend(t)},refreshChart:function(){this.clearAxis(),this[this.chartData.chartType]("refresh")},clearAxis:function(){k.select("#"+this.chartData.selector).selectAll(".axis").remove()},clearCanvas:function(){k.select("#"+this.chartData.selector).selectAll("*").remove()},drawTitle:function(){k.select("#"+this.chartData.selector).append("text").attr("x",this.width/2).attr("y",this.titleHeight-.1*this.titleHeight).style("text-anchor","middle").text(this.chartData.title),k.select("#"+this.chartData.selector).append("text").attr("x",this.width/2).attr("y",this.titleHeight-.1*this.titleHeight+this.subtitleHeight).style("text-anchor","middle").text(this.chartData.subtitle)},addTooltip:function(t,a){k.select("#"+this.chartData.selector).append("rect").attr("x",a.layerX-5-50).attr("y",a.layerY-13-25).attr("height","16px").attr("width","80px").attr("class","tt").attr("fill","white"),k.select("#"+this.chartData.selector).append("text").attr("x",a.layerX-50).attr("y",a.layerY-25).attr("class","tt").attr("font-size","10px").text(t.dim+":"+t.metric)},removeTooltip:function(){k.select("#"+this.chartData.selector).selectAll(".tt").remove()},setOverrides:function(t,a){a=a||{};var e=h()(t),i=!0,r=!1,s=void 0;try{for(var n,l=c()(e);!(i=(n=l.next()).done);i=!0){var o=n.value;u()(t[o],a[o])}}catch(t){r=!0,s=t}finally{try{!i&&l.return&&l.return()}finally{if(r)throw s}}return t},generateLegend:function(t){this.chartData.legends&&!0===this.chartData.legends.enabled&&(k.select("#"+this.chartData.selector).append("text").attr("x",this.width-60).attr("y",.95*this.height).style("text-anchor","middle").text(this.chartData.metric[0]),k.select("#"+this.chartData.selector).append("g").attr("class","legends").append("rect").attr("x",this.width-30).attr("y",.95*this.height-10).attr("width",30).attr("height",10).style("fill",function(){return t.palette.lineFill||t.palette.fill}))}},{barChart:m},{vBarChart:p},{scatterPlot:w},{pieChart:b},{areaChart:C},{lineGraph:v}),computed:{ds:function(){var t=this,a={metric:[]};return Array.isArray(this.chartData.metric)?a.metric=this.chartData.metric:a.metric.push(this.chartData.metric),a.dim=this.chartData.dim,a.data=this.chartData.data,a.data.map(function(e){var i={metric:[]};return a.metric.forEach(function(t,a){i.metric[a]=e[t]||0}),i.dim=t.chartData.dim?e[t.chartData.dim]:null,i})},metric:function(){return this.chartData.metric},height:function(){return this.chartData.height||200},width:function(){return this.chartData.width||200},max:function(){var t=0,a=[];return this.ds.forEach(function(t){a=a.concat([].concat(s()(t.metric)))}),a.forEach(function(a){t=t>a?t:a}),t},min:function(){var t=[];return this.ds.forEach(function(a){t=t.concat([].concat(s()(a.metric)))}),Math.min.apply(Math,s()(t.map(function(t){return t})))},displayHeight:function(){return this.chartData.legends&&!0===this.chartData.legends.enabled?.8*this.height:this.height},titleHeight:function(){return this.chartData.title?this.chartData.textHeight||25:0},subtitleHeight:function(){return this.chartData.subtitle?.66*this.chartData.textHeight||16.5:0},header:function(){return this.titleHeight+this.subtitleHeight}},mounted:function(){this.initalizeChart()},watch:{chartData:{handler:function(){this.refreshChart()},deep:!0}},template:""})}},_=W;"undefined"!=typeof window&&window.Vue&&window.Vue.use(W);var E=[{month:"Jan",year:2018,total:475,forecast:500,yoy:1.05,actual:!0},{month:"Feb",year:2018,total:515,forecast:525,yoy:1.03,actual:!0},{month:"Mar",year:2018,total:390,forecast:480,yoy:.95,actual:!0},{month:"Apr",year:2018,total:430,forecast:440,yoy:.8,actual:!0},{month:"May",year:2018,total:510,forecast:500,yoy:.7,actual:!0},{month:"Jun",year:2018,total:399,forecast:450,yoy:.75,actual:!0},{month:"Jul",year:2018,total:601,forecast:550,yoy:1,actual:!0},{month:"Aug",year:2018,total:496,forecast:480,yoy:1.15,actual:!0},{month:"Sep",year:2018,total:379,forecast:440,yoy:1.1,actual:!0},{month:"Oct",year:2018,total:410,forecast:430,yoy:.85,actual:!1},{month:"Nov",year:2018,total:490,forecast:500,yoy:.95,actual:!1},{month:"Dec",year:2018,total:610,forecast:625,yoy:1.01,actual:!1}],T={name:"barChartExample",methods:{newItem:function(){this.sales.push({month:null,year:null,total:null,actual:!1})},removeItem:function(t,a){a.preventDefault(),this.sales.splice(t,1)}},data:function(){return{sales:E,areaChartData:{chartType:"areaChart",selector:"areaChart",title:"Area Chart",width:300,height:200,metric:["total"],dim:"month",data:E,legends:{enabled:!0,height:25,width:50}},barChartData:{chartType:"barChart",selector:"chart",title:"Bar Chart",subtitle:"Sales by month",height:200,metric:"total",dim:"month",data:E,legends:{enabled:!0,height:25,width:50}},lineGraphData:{chartType:"lineGraph",selector:"lineGraph",title:"Line Graph",width:600,subtitle:"Sales by month",height:200,metric:["total","forecast"],dim:"month",data:E,legends:{enabled:!0,height:25,width:50}},vBarChartData:{chartType:"vBarChart",selector:"vChart",title:"Verticle Bar Chart",subtitle:"Sales by month",width:300,height:200,metric:"total",dim:"month",data:E,legends:{enabled:!0,height:25,width:50}},pieChartData:{chartType:"pieChart",selector:"pieChart",title:"Pie Chart",subtitle:"Sales by month",width:300,height:200,metric:"total",dim:"month",data:E},scatterPlotData:{chartType:"scatterPlot",selector:"scatterPlot",title:"Scatter Plot",subtitle:"Sales by month",width:300,height:200,metric:"total",dim:"month",data:E,legends:{enabled:!0,height:25,width:50}}}}},A={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"container"},[t._m(0),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-6 col-md-4"},[t._l(t.sales,function(a,i){return e("div",[e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.sales[i].total,expression:"sales[index].total",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:t.sales[i].total},on:{input:function(a){a.target.composing||t.$set(t.sales[i],"total",t._n(a.target.value))},blur:function(a){t.$forceUpdate()}}}),t._v(" "),e("button",{attrs:{type:"submit"},on:{click:function(a){t.removeItem(i,a)}},model:{value:t.sales[i],callback:function(a){t.$set(t.sales,i,a)},expression:"sales[index]"}},[t._v(" [-] ")])])}),t._v(" "),e("button",{on:{click:t.newItem}},[t._v(" [+] ")])],2),t._v(" "),e("div",{staticClass:"col-6 col-md-8"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-12"},[e("v-chart",{attrs:{chartData:t.lineGraphData}})],1),t._v(" "),e("div",{staticClass:"col-12 col-lg-6"},[e("v-chart",{attrs:{chartData:t.areaChartData}})],1),t._v(" "),e("div",{staticClass:"col-12 col-lg-6"},[e("v-chart",{attrs:{chartData:t.barChartData}})],1),t._v(" "),e("div",{staticClass:"col-12 col-lg-6"},[e("v-chart",{attrs:{chartData:t.vBarChartData}})],1),t._v(" "),e("div",{staticClass:"col-12 col-lg-6"},[e("v-chart",{attrs:{chartData:t.pieChartData}})],1)])])]),t._v(" "),t._m(1)])},staticRenderFns:[function(){var t=this.$createElement,a=this._self._c||t;return a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("img",{staticClass:"logo",attrs:{src:e("dLd/")}})])])},function(){var t=this.$createElement,a=this._self._c||t;return a("a",{attrs:{href:"https://github.com/ignoreintuition/v-chart-plugin"}},[a("img",{staticStyle:{position:"absolute",top:"0",right:"0",border:"0"},attrs:{src:"https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png",alt:"Fork me on GitHub"}})])}]};var P={name:"App",components:{chartExample:e("VU/8")(T,A,!1,function(t){e("IYc2")},null,null).exports}},F={render:function(){var t=this.$createElement,a=this._self._c||t;return a("div",{attrs:{id:"app"}},[a("chartExample")],1)},staticRenderFns:[]};var L=e("VU/8")(P,F,!1,function(t){e("Gf/I")},null,null).exports;i.a.config.productionTip=!1,i.a.use(_),new i.a({el:"#app",components:{App:L},template:""})},"dLd/":function(t,a,e){t.exports=e.p+"static/img/logo.7eeeac5.png"}},["NHnr"]);
+//# sourceMappingURL=app.d0cfa1f5b8fb363d2216.js.map
\ No newline at end of file
diff --git a/dist/static/js/app.d0cfa1f5b8fb363d2216.js.map b/dist/static/js/app.d0cfa1f5b8fb363d2216.js.map
new file mode 100644
index 0000000..ae733bb
--- /dev/null
+++ b/dist/static/js/app.d0cfa1f5b8fb363d2216.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///./src/import/barChart.js","webpack:///./src/import/vBarChart.js","webpack:///./src/import/lineGraph.js","webpack:///./src/import/scatterPlot.js","webpack:///./src/import/pieChart.js","webpack:///./src/import/areaChart.js","webpack:///./src/v-chart-plugin.js","webpack:///./src/assets/data/sales.js","webpack:///src/components/chartExample.vue","webpack:///./src/components/chartExample.vue?7140","webpack:///./src/components/chartExample.vue","webpack:///src/App.vue","webpack:///./src/App.vue?b8d2","webpack:///./src/App.vue","webpack:///./src/main.js","webpack:///./src/assets/img/logo.png"],"names":["d3","assign_default","require","barChart","_this","this","svgContainer","select","chartData","selector","cs","palette","fill","stroke","bar","hPadding","vPadding","x","axisHeight","ticks","y","domain","range","axisWidth","getWidth","d","scale","metric","getHeight","displayHeight","header","ds","length","getYCoord","i","mouseOver","addTooltip","window","event","mouseOut","removeTooltip","rects","selectAll","data","setOverrides","overrides","dim","reduce","accumulator","currentValue","scaleLinear","max","width","forEach","t","push","scaleOrdinal","axis","axisBottom","axisLeft","yOffset","xOffset","append","attr","call","enter","on","transition","exit","remove","vBarChart","getXCoord","lineGraph","mode","lineFill","pointFill","pointStroke","lineFunction","e","line","points","path","min","buildScales","drawAxis","scatterPlot","height","p","pieChart","radius","ordinalColors","color","getColor","arc","outerRadius","innerRadius","pie","sort","value","merge","areaChart","getPoints","poly","map","join","titleHeight","polyFunction","s","Chart","install","Vue","component","props","chartType","methods","initalizeChart","drawTitle","generateLegend","refreshChart","clearAxis","clearCanvas","style","text","title","subtitleHeight","subtitle","layerX","layerY","keys","keys_default","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","get_iterator_default","next","done","key","err","return","legends","enabled","computed","Array","isArray","td","results","concat","toConsumableArray_default","Math","apply","o","textHeight","mounted","watch","handler","deep","template","use","sales","month","year","total","forecast","yoy","actual","chartExample","name","newItem","removeItem","preventDefault","splice","areaChartData","barChartData","lineGraphData","vBarChartData","pieChartData","scatterPlotData","components_chartExample","render","_vm","_h","$createElement","_c","_self","staticClass","_m","_v","_l","index","directives","rawName","expression","modifiers","number","attrs","type","domProps","input","$event","target","composing","$set","_n","blur","$forceUpdate","click","model","callback","$$v","staticRenderFns","src","__webpack_require__","href","staticStyle","position","top","right","border","alt","App","components","normalizeComponent","ssrContext","selectortype_template_index_0_src_App","id","src_App","App_normalizeComponent","config","productionTip","el","module","exports"],"mappings":"0QAUMA,EAAKC,OACTC,EAAQ,QACRA,EAAQ,QACRA,EAAQ,QACRA,EAAQ,SAqLKC,EA/KE,WAAiB,IAAAC,EAAAC,KAK1BC,EAAeN,EAAGO,OAAH,IAAcF,KAAKG,UAAUC,UAK9CC,GACFC,SACEC,KAAM,UACNC,OAAQ,WAEVC,KACEC,SAAU,EACVC,SAAU,GAEZC,GACEC,WAAY,GACZC,MAAO,GAETC,GACEC,UACAC,SACAC,UAAW,OAUTC,EAAW,SAAAC,GAAA,OAAKf,EAAGO,EAAES,MAAMD,EAAEE,SAO7BC,EAAY,kBAChBxB,EAAKyB,cAAgBnB,EAAGO,EAAEC,WAAad,EAAK0B,OAASpB,EAAGI,IAAIE,UAAYZ,EAAK2B,GAAGC,OAAS,GASrFC,EAAY,SAACR,EAAGS,GAAJ,OAAUA,GAC1B9B,EAAKyB,cAAgBnB,EAAGO,EAAEC,WAAad,EAAK0B,QAAU1B,EAAK2B,GAAGC,OAAS,EAAI5B,EAAK0B,QAQ5EK,EAAY,SAACV,GACjBrB,EAAKgC,WAAWX,EAAGY,OAAOC,QAStBC,EAAW,SAACd,GAChBrB,EAAKoC,cAAcf,IAuFfgB,EAAQnC,EAAaoC,UAAU,QAAQC,KAAKtC,KAAK0B,IAYvD,OAVArB,EAAKL,KAAKuC,aAAalC,EAAIL,KAAKG,UAAUqC,WACtCxC,KAAK0B,GAAG,GAAGe,MACbpC,EAAGU,EAAEG,UAAYb,EAAGU,EAAEG,WAAoD,GAAtClB,KAAK0B,GAAGgB,OARtB,SAACC,EAAaC,GACpC,OAAQA,EAAaH,IAAId,OAASgB,EAAeC,EAAaH,IAAId,OAASgB,GAOP,IAvCpEtC,EAAGO,EAAES,MAAQ1B,EAAGkD,cACb7B,QAAQ,EAAGjB,EAAK+C,MACh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B,EAAblL,KAAamL,eAA0BC,EAAvCpL,KAAuCqL,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBE,YAAA,QAAkBF,EAAA,OAAYE,YAAA,QAAkBF,EAAA,OAAYE,YAAA,OAAAU,OAA0BgB,IAAMC,EAAQ,gBAAiC,WAAc,IAAa/B,EAAblL,KAAamL,eAA0BC,EAAvCpL,KAAuCqL,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,KAAeY,OAAOkB,KAAA,uDAA4D9B,EAAA,OAAY+B,aAAaC,SAAA,WAAAC,IAAA,IAAAC,MAAA,IAAAC,OAAA,KAAyDvB,OAAQgB,IAAA,sEAAAQ,IAAA,4BCElf,ICMAC,GACArD,KAAA,MACAsD,YACAvD,aDTyB8C,EAAQ,OAcjCU,CACExD,EACAY,GATF,EAVA,SAAA6C,GACEX,EAAQ,SAaV,KAEA,MAUgC,UEvBjBY,GADE7C,OAFP,WAAgB,IAAaE,EAAblL,KAAamL,eAA0BC,EAAvCpL,KAAuCqL,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBY,OAAO8B,GAAA,SAAY1C,EAAA,qBAE7F2B,oBCChC,IAuBegB,EAvBUd,EAAQ,OAcjBe,CACdP,EACAI,GAT6B,EAV/B,SAAoBD,GAClBX,EAAQ,SAaS,KAEU,MAUG,QCpBhCxG,IAAIwH,OAAOC,eAAgB,EAE3BzH,IAAIkD,IAAIpD,GAGR,IAAIE,KACF0H,GAAI,OACJT,YAAcD,OACd/D,SAAU,mCCdZ0E,EAAAC,QAAiBpB,EAAA/H,EAAuB","file":"static/js/app.d0cfa1f5b8fb363d2216.js","sourcesContent":["/** \n * @fileOverview Bar chart component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n /* eslint-env browser */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-ease'));\n/**\n * Builds a Bar Chart.\n * @module barChart\n */\n\nconst barChart = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n palette: {\n fill: '#005792',\n stroke: '#d1f4fa',\n },\n bar: {\n hPadding: 8,\n vPadding: 5,\n },\n x: {\n axisHeight: 10,\n ticks: 5,\n },\n y: {\n domain: [],\n range: [],\n axisWidth: null,\n },\n };\n\n /**\n * Returns width of the bar\n * @member getWidth\n * @function\n * @param {Object} d (svg element)\n */\n const getWidth = d => cs.x.scale(d.metric);\n\n /**\n * Returns height of the bar\n * @member getHeight\n * @function\n */\n const getHeight = () => (\n this.displayHeight - cs.x.axisHeight - this.header - cs.bar.vPadding) / this.ds.length - 1;\n\n /**\n * Returns y axis co-ordinate of the bar\n * @member getYCoord\n * @function\n * @param {Object} d (svg element)\n * @param {Object} i (svg element)\n */\n const getYCoord = (d, i) => i * (\n this.displayHeight - cs.x.axisHeight - this.header) / this.ds.length + 1 + this.header;\n\n /**\n * Adds a tooltip on mouse over\n * @member mouseOver\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOver = (d) => {\n this.addTooltip(d, window.event);\n };\n\n /**\n * Removes tooltip on mouse out\n * @member mouseOut\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOut = (d) => {\n this.removeTooltip(d);\n };\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} rects (svg element)\n */\n const enter = (rects) => {\n rects.enter()\n .append('rect')\n .attr('fill', cs.palette.fill)\n .attr('stroke', cs.palette.stroke)\n .attr('class', this.selector)\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('y', getYCoord)\n .attr('x', cs.y.axisWidth + cs.bar.hPadding)\n .on('mouseover', mouseOver)\n .on('mouseout', mouseOut);\n return rects;\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} rects (svg element)\n */\n const transition = (rects) => {\n rects.transition()\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('y', getYCoord)\n .attr('x', cs.y.axisWidth + cs.bar.hPadding);\n return rects;\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} rect (svg element)\n */\n const exit = (rects) => {\n rects.exit().remove();\n return rects;\n };\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.x.scale = d3.scaleLinear()\n .domain([0, this.max])\n .range([0, this.width - cs.bar.hPadding - cs.y.axisWidth]);\n this.ds.forEach(t => cs.y.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.y.range.push(((\n this.displayHeight - cs.x.axisHeight - this.header + cs.bar.vPadding) * i) / this.ds.length));\n cs.y.scale = d3.scaleOrdinal().domain(cs.y.domain).range(cs.y.range);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.x.axis = d3.axisBottom().ticks(cs.x.ticks, 's').scale(cs.x.scale);\n cs.y.axis = d3.axisLeft().scale(cs.y.scale);\n cs.x.yOffset = this.displayHeight - cs.x.axisHeight;\n cs.x.xOffset = cs.bar.hPadding + cs.y.axisWidth;\n cs.y.yOffset = cs.bar.vPadding + this.header - 1;\n cs.y.xOffset = cs.y.axisWidth;\n if (this.ds[0].dim)\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`).call(cs.y.axis);\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`).call(cs.x.axis);\n };\n /**\n * Get the maximum dimension length\n * @member getMaxDimLength\n * @function\n * @param {number} accumulator\n * @param {number} currentValue\n */\n const getMaxDimLength = (accumulator, currentValue) => {\n return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator;\n }\n\n const rects = svgContainer.selectAll('rect').data(this.ds);\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n if (this.ds[0].dim)\n cs.y.axisWidth = cs.y.axisWidth || (this.ds.reduce(getMaxDimLength, 0)) * 10;\n\n buildScales(cs);\n drawAxis(cs);\n enter(rects);\n transition(rects);\n exit(rects);\n\n return cs;\n};\n\nexport default barChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/barChart.js","/** \n * @fileOverview Verticle Bar Chart component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n const d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-transition'));\n/**\n * Builds a Verticle Bar Chart.\n * @module vBarChart\n */\n\nconst vBarChart = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n palette: {\n fill: '#005792',\n stroke: '#d1f4fa',\n },\n bar: {\n hPadding: 0,\n vPadding: 0,\n },\n x: {\n axisHeight: 20,\n domain: [],\n range: [],\n },\n y: {\n axisWidth: 30,\n ticks: 5,\n },\n };\n /**\n * Returns width of the bar\n * @member getWidth\n * @function\n */\n\n const getWidth = () => ((this.width - cs.y.axisWidth) / this.chartData.data.length - 1);\n\n /**\n * Returns height of the bar\n * @member getHeight\n * @function\n * @param {Object} d (svg element)\n */\n const getHeight = d => this.displayHeight - cs.y.scale(d.metric);\n\n /**\n * Returns x axis co-ordinate of the bar\n * @member getXCoord\n * @function\n * @param {Object} d (svg element)\n * @param {Object} i (svg element)\n */\n const getXCoord = (d, i) => (\n i * (this.width - cs.y.axisWidth) / this.chartData.data.length) + cs.y.axisWidth;\n /**\n * Returns y axis co-ordinate of the bar\n * @member getYCoord\n * @function\n * @param {Object} d (svg element)\n */\n const getYCoord = d => cs.y.scale(d.metric);\n\n /**\n * Adds a tooltip on mouse over\n * @member mouseOver\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOver = (d) => {\n this.addTooltip(d, window.event);\n };\n\n /**\n * Removes tooltip on mouse out\n * @member mouseOut\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOut = (d) => {\n this.removeTooltip(d);\n };\n\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} rects (svg element)\n */\n const enter = (rects) => {\n rects.enter()\n .append('rect')\n .attr('fill', cs.palette.fill)\n .attr('stroke', cs.palette.stroke)\n .attr('class', this.selector)\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('x', getXCoord)\n .attr('y', getYCoord)\n .on('mouseover', mouseOver)\n .on('mouseout', mouseOut);\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} rects (svg element)\n */\n const transition = (rects) => {\n rects.transition()\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('x', getXCoord)\n .attr('y', getYCoord);\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} rects (svg element)\n */\n const exit = (rects) => {\n rects.exit().remove();\n };\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.y.scale = d3.scaleLinear()\n .domain([0, this.max])\n .range([this.displayHeight, this.header]);\n this.ds.forEach(t => cs.x.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.x.range.push(((\n this.chartData.width - cs.y.axisWidth + cs.bar.vPadding) * i) / this.ds.length));\n cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);\n cs.x.axis = d3.axisBottom().scale(cs.x.scale);\n cs.x.yOffset = this.displayHeight;\n cs.x.xOffset = cs.y.axisWidth;\n cs.y.yOffset = 0;\n cs.y.xOffset = cs.y.axisWidth;\n svgContainer.append('g').attr('class', 'axis')\n .attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`)\n .call(cs.y.axis);\n if (this.ds[0].dim)\n svgContainer.append('g').attr('class', 'axis')\n .attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)\n .call(cs.x.axis);\n };\n\n const rects = svgContainer.selectAll('rect').data(this.ds);\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n buildScales(cs);\n drawAxis(cs);\n enter(rects);\n transition(rects);\n exit(rects);\n\n return cs;\n};\n\nexport default vBarChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/vBarChart.js","/** \n * @fileOverview Line Graph component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-shape'));\n/**\n * Builds a Line Graph.\n * @module lineGraph\n */\n\nconst lineGraph = function chart(mode) {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n palette: {\n lineFill: ['#ffcdcd', '#005792'],\n pointFill: '#005792',\n pointStroke: '#d1f4fa',\n },\n x: {\n domain: [],\n range: [],\n axisHeight: 20,\n },\n y: {\n axisWidth: 30,\n ticks: 5,\n },\n };\n\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} points (svg element) \n */\n const enter = (points, path) => {\n this.metric.forEach( (e, i) => {\n path[i].enter().append('path')\n .attr('d', cs.lineFunction[i](this.ds))\n .attr('fill', 'none')\n .attr('id', 'p' + i)\n .attr('stroke', cs.palette.lineFill[i])\n .attr('stroke-width', 3)\n }) \n \n // points.enter()\n // .append('circle')\n // .attr('class', this.selector)\n // .attr('r', 2)\n // .on('mouseover', (d) => {\n // this.addTooltip(d, window.event);\n // })\n // .on('mouseout', (d) => {\n // this.removeTooltip(d);\n // })\n // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n // .attr('cy', d => cs.y.scale(d.metric[0]));\n // return points;\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} points (svg element) \n */\n const transition = (points, path) => {\n this.metric.forEach( (e, i) => {\n path[i].transition()\n .attr('d', cs.lineFunction[i](this.ds));\n })\n \n // points.transition()\n // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n // .attr('cy', d => cs.y.scale(d.metric[0]))\n // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n // .attr('cy', d => cs.y.scale(d.metric[0]));\n // return points;\n };\n\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} points (svg element)\n */\n const exit = (points, path) => {\n points.exit().remove();\n this.metric.forEach( (e, i) => {\n path[i].exit().remove();\n })\n return points;\n };\n\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = cs => {\n cs.y.scale = d3.scaleLinear()\n .domain([this.min, this.max])\n .range([this.displayHeight - cs.x.axisHeight, this.header]);\n this.ds.forEach(t => cs.x.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.x.range.push(((this.width * i) - this.header) / this.ds.length));\n cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = cs => {\n cs.x.axis = d3.axisBottom().scale(cs.x.scale);\n cs.x.xOffset = cs.y.axisWidth + 5;\n cs.x.yOffset = this.displayHeight - cs.x.axisHeight;\n cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);\n cs.y.xOffset = cs.y.axisWidth;\n cs.y.yOffset = 0;\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)\n .call(cs.x.axis);\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)\n .call(cs.y.axis);\n };\n\n cs.lineFunction = [];\n this.metric.forEach( (e, i) => {\n cs.lineFunction.push( \n d3.line()\n .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .y(d => cs.y.scale(d.metric[i]))\n ) \n });\n \n const points = svgContainer.selectAll('circle').data(this.ds);\n const path = []\n this.metric.forEach( (e, i) => {\n path.push(svgContainer.selectAll('path#p' + i).data(this.ds))\n })\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n\n buildScales(cs);\n drawAxis(cs);\n enter(points, path);\n transition(points, path);\n exit(points, path);\n\n return cs;\n};\n\nexport default lineGraph;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/lineGraph.js","/** \n * @fileOverview Scatter Plot component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n /* eslint-env browser */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'));\n/**\n * Builds a Scatter Plot.\n * @module scatterPlot\n */\n\nconst scatterPlot = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n x: {\n domain: [],\n range: [],\n axisHeight: 20,\n },\n y: {\n axisWidth: 30,\n ticks: 5,\n },\n };\n const points = svgContainer.selectAll('circle').data(this.ds);\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} p (svg element)\n */\n const enter = (p) => {\n p.enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('r', 2)\n .on('mouseover', (d) => {\n this.addTooltip(d, window.event);\n })\n .on('mouseout', (d) => {\n this.removeTooltip(d);\n })\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric));\n return points;\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} p (svg element)\n */\n const transition = (p) => {\n p.transition()\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric))\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric));\n return points;\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} rect (svg element)\n */\n const exit = () => {\n points.exit().remove();\n return points;\n };\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.y.scale = d3.scaleLinear()\n .domain([this.min, this.max])\n .range([this.displayHeight - cs.x.axisHeight, this.header]);\n cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);\n this.ds.forEach(t => cs.x.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.x.range.push(((this.width * i) - this.header) / this.ds.length));\n cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.x.axis = d3.axisBottom().scale(cs.x.scale);\n cs.x.xOffset = cs.y.axisWidth + 5;\n cs.x.yOffset = this.height - cs.x.axisHeight;\n cs.y.xOffset = cs.y.axisWidth;\n cs.y.yOffset = 0;\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`).call(cs.x.axis);\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`).call(cs.y.axis);\n };\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n buildScales(cs);\n drawAxis(cs);\n enter(points);\n transition(points);\n exit(points);\n\n return cs;\n};\n\nexport default scatterPlot;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/scatterPlot.js","/** \n * @fileOverview Pie Chart component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n /* eslint-env browser */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-shape'));\n/**\n * Builds an Pie Chart.\n * @module pieChart\n */\n\nconst pieChart = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n radius: null,\n ordinalColors: ['#d1f4fa', '#005792', '#ffe6eb', '#ffcdcd'],\n };\n cs.radius = this.height > this.width ? (\n this.width - this.width * 0.1) / 2 : (this.height - this.height * 0.1) / 2;\n\n const color = d3.scaleOrdinal()\n .range(cs.ordinalColors);\n\n /**\n * Returns colors for pie chart\n * @member getColor\n * @function\n */\n const getColor = (d, i) => color(i);\n\n /**\n * Adds a tooltip on mouse over\n * @member mouseOver\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOver = (d) => {\n this.addTooltip(d.data, window.event);\n };\n\n /**\n * Removes tooltip on mouse out\n * @member mouseOut\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOut = (d) => {\n this.removeTooltip(d);\n };\n\n const path = d3.arc()\n .outerRadius(cs.radius - 10)\n .innerRadius(25);\n\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} arc (svg element)\n */\n const enter = (arc) => {\n arc.enter()\n .append('g')\n .attr('transform', `translate(${this.width / 2},${this.height / 2})`)\n .append('path')\n .merge(arc)\n .attr('class', 'arc')\n .attr('d', path)\n .attr('fill', getColor)\n .on('mouseover', mouseOver)\n .on('mouseout', mouseOut)\n .attr('transform', `translate(0,${this.header})`);\n return arc;\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} arc (svg element)\n */\n const transition = (arc) => {\n arc.transition()\n .attr('d', path)\n .attr('fill', getColor);\n return arc;\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} arc (svg element)\n */\n const exit = (arc) => {\n arc.exit().remove();\n return arc;\n };\n\n const pie = d3.pie()\n .sort(null)\n .value(d => d.metric);\n\n const arc = svgContainer.selectAll('.arc')\n .data(pie(this.ds));\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n enter(arc);\n transition(arc);\n exit(arc);\n\n return cs;\n};\n\nexport default pieChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/pieChart.js","/** \n * @fileOverview Area chart component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n /* eslint-env browser */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-shape'));\n/**\n * Builds an Area Chart.\n * @module areaChart\n */\nconst areaChart = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n palette: {\n stroke: '#d1f4fa',\n fill: '#005792',\n },\n x: {\n domain: [],\n range: [],\n axisHeight: 45,\n axisWidth: 45,\n },\n y: {\n axisWidth: 45,\n },\n };\n /**\n * Returns plot points \n * @member getPoints\n * @function\n * @param {Object} p\n */\n const getPoints = (p) => {\n let poly = (` ${this.width}, ${cs.x.yOffset} `);\n poly += (` ${cs.x.axisHeight}, ${cs.x.yOffset} `);\n poly += p.map(d => [cs.x.scale(d.dim) + cs.y.axisWidth + 5, cs.y.scale(d.metric)].join(',')).join(' ');\n return poly;\n };\n\n const poly = svgContainer.selectAll('polygon').data([this.ds]);\n\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} s (svg element)\n */\n const enter = (s) => {\n s.enter()\n .append('polygon')\n .attr('stroke', cs.palette.stroke)\n .attr('fill', cs.palette.fill)\n .attr('points', getPoints);\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} s (svg element)\n */\n const transition = (s) => {\n s.transition()\n .attr('points', getPoints);\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} s (svg element)\n */\n const exit = (s) => {\n s.exit().remove();\n return s;\n };\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.y.scale = d3.scaleLinear()\n .domain([0, this.max])\n .range([this.displayHeight - cs.x.axisHeight, this.titleHeight]);\n cs.y.axis = d3.axisLeft().ticks(10, 's').scale(cs.y.scale);\n this.ds.forEach(t => cs.x.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.x.range.push((((\n this.width - cs.x.axisWidth) * i)) / this.ds.length));\n cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);\n cs.x.axis = d3.axisBottom().scale(cs.x.scale);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.polyFunction = d3.line()\n .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .y(d => cs.y.scale(d.metric));\n cs.x.xOffset = cs.y.axisWidth + 5;\n cs.x.yOffset = this.displayHeight - cs.x.axisHeight;\n cs.y.xOffset = cs.y.axisWidth;\n cs.y.yOffset = 0;\n svgContainer.append('g').append('g')\n .attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)\n .call(cs.x.axis);\n if (this.ds[0].dim)\n svgContainer.append('g').append('g').attr('class', 'axis')\n .attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)\n .call(cs.y.axis);\n };\n \n cs = this.setOverrides(cs, this.chartData.overrides);\n buildScales(cs);\n drawAxis(cs);\n enter(poly);\n transition(poly);\n exit(poly);\n\n return cs;\n};\n\nexport default areaChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/areaChart.js","/** \n * @fileOverview Chart component containing all of the generic components required for charts\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n */\n\n/* eslint-env browser */\nimport barChart from './import/barChart';\nimport vBarChart from './import/vBarChart';\nimport lineGraph from './import/lineGraph';\nimport scatterPlot from './import/scatterPlot';\nimport pieChart from './import/pieChart';\nimport areaChart from './import/areaChart';\n\nconst d3 = Object.assign({},\n require('d3-selection'));\n\n/**\n * Chart is the generic component used for any chart type\n * @namespace\n */\n \nconst Chart = {\n install(Vue) {\n Vue.component('v-chart', {\n props: ['chartData'],\n data() {\n return {\n selector: `${this.chartData.selector}-${this.chartData.chartType}`,\n };\n },\n methods: {\n /**\n * Generate a new Chart of type chartType\n * @memberOf Chart\n */\n initalizeChart() {\n const cs = this[this.chartData.chartType]('init');\n this.drawTitle();\n this.generateLegend(cs);\n },\n /**\n * Redraw the Chart when the data is recycled\n * @memberOf Chart\n */\n refreshChart() {\n this.clearAxis();\n this[this.chartData.chartType]('refresh');\n },\n /**\n * Remove x and y axes\n * @memberOf Chart\n */\n clearAxis() {\n d3.select(`#${this.chartData.selector}`).selectAll('.axis').remove();\n },\n /**\n * Remove all content from the SVG\n * @memberOf Chart\n */\n clearCanvas() {\n d3.select(`#${this.chartData.selector}`).selectAll('*').remove();\n },\n /**\n * Appends title and subtitle to the chart\n * @memberOf Chart\n */\n drawTitle() {\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', this.width / 2)\n .attr('y', this.titleHeight - this.titleHeight * 0.1)\n .style('text-anchor', 'middle')\n .text(this.chartData.title);\n\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', this.width / 2)\n .attr('y', this.titleHeight - this.titleHeight * 0.1 + this.subtitleHeight)\n .style('text-anchor', 'middle')\n .text(this.chartData.subtitle);\n },\n /**\n * Adds a tooltip to the SVG\n * @memberOf Chart\n * @param {Object} d dataset\n * @param {Object} e event x and y coordinates\n */\n addTooltip(d, e) {\n d3.select(`#${this.chartData.selector}`)\n .append('rect')\n .attr('x', e.layerX - 5 - 50)\n .attr('y', e.layerY - 13 - 25)\n .attr('height', '16px')\n .attr('width', '80px')\n .attr('class', 'tt')\n .attr('fill', 'white');\n\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', e.layerX - 50)\n .attr('y', e.layerY - 25)\n .attr('class', 'tt')\n .attr('font-size', '10px')\n .text(`${d.dim}:${d.metric}`);\n },\n /**\n * Removes all tooltips from the SVG\n * @memberOf Chart\n * @param {Object} d dataset\n */\n removeTooltip() {\n d3.select(`#${this.chartData.selector}`)\n .selectAll('.tt').remove();\n },\n /**\n * Override default values \n * @param {Object} cs configuration of the coordinate systems\n * @param {Object} overrides the additional values that can be used for an object\n * @returns {Object} updated configuration of coordinate system \n */\n setOverrides(cs, overrides) {\n overrides = overrides || {};\n const keys = Object.keys(cs);\n for (const key of keys)\n Object.assign(cs[key], overrides[key]);\n return cs;\n },\n /**\n * Generate legend if option -legends- defined as true\n * @memberOf Chart\n * @param {Object} cs configuration of the coordinate system\n */\n generateLegend(cs) {\n if (this.chartData.legends && this.chartData.legends.enabled === true) {\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', this.width - 60)\n .attr('y', this.height * 0.95)\n .style('text-anchor', 'middle')\n .text(this.chartData.metric[0]);\n\n d3.select(`#${this.chartData.selector}`)\n .append(\"g\")\n .attr(\"class\", \"legends\")\n .append(\"rect\")\n .attr('x', this.width - 30)\n .attr('y', this.height * 0.95 - 10)\n .attr(\"width\", 30)\n .attr(\"height\", 10)\n .style(\"fill\", function () {\n const fill = cs.palette.lineFill || cs.palette.fill;\n return fill;\n });\n }\n },\n\n ...((typeof barChart !== 'undefined') && { barChart }),\n ...((typeof vBarChart !== 'undefined') && { vBarChart }),\n ...((typeof scatterPlot !== 'undefined') && { scatterPlot }),\n ...((typeof pieChart !== 'undefined') && { pieChart }),\n ...((typeof areaChart !== 'undefined') && { areaChart }),\n ...((typeof lineGraph !== 'undefined') && { lineGraph }),\n },\n computed: {\n /**\n * Dataset getter function\n * @memberOf Chart\n * @returns {Object} normalized dataset\n */\n ds() {\n //TODO add in support for arrays with undefined metric\n const ds = { metric: [] };\n if (!Array.isArray(this.chartData.metric)){\n ds.metric.push(this.chartData.metric);\n } else {\n ds.metric = this.chartData.metric;\n }\n ds.dim = this.chartData.dim;\n ds.data = this.chartData.data;\n\n return ds.data.map((d) => {\n const td = {\n metric: []\n };\n ds.metric.forEach(function(e, i){\n td.metric[i] = d[e] || 0;\n })\n td.dim = this.chartData.dim ? d[this.chartData.dim] : null;\n return td;\n });\n },\n /**\n * Metric getter function\n * @memberOf Chart\n * @returns {array} Metrics \n */\n metric() {\n return this.chartData.metric;\n },\n /**\n * Height getter function\n * @memberOf Chart\n * @returns {number} Chart Height\n */\n height() {\n return this.chartData.height || 200;\n },\n /**\n * Width getter function\n * @memberOf Chart\n * @returns {number} Chart width\n */\n width() {\n return this.chartData.width || 200;\n },\n /**\n * Get the maxium value for metric\n * @memberOf Chart\n * @returns {number} Max value for metric\n */\n max() {\n let max = 0;\n var results = []; \n this.ds.forEach(e => {\n results = results.concat([...e.metric]);\n });\n results.forEach((e) => {\n max = max > e ? max : e;\n });\n return max;\n },\n /**\n * Get the minimum value for dataset\n * @memberOf Chart\n * @returns {number} Min value for metric\n */\n min() {\n let max = 0;\n var results = []; \n this.ds.forEach(e => {\n results = results.concat([...e.metric]);\n });\n return Math.min(...results.map(o => o));\n },\n /**\n * Gets the height of the dispaly area\n * @memberOf Chart\n * @returns {number} Height of the chart display\n */\n displayHeight() {\n if (this.chartData.legends && this.chartData.legends.enabled === true) {\n return this.height * .80;\n } else {\n return this.height;\n }\n },\n /**\n * Gets the height of the title \n * @memberOf Chart\n * @returns {number} Height of the chart title\n */\n titleHeight() {\n if (this.chartData.title) return this.chartData.textHeight || 25;\n return 0;\n },\n /**\n * Gets the subtitle height\n * @memberOf Chart\n * @returns {number} Height of chart subtitle\n */\n subtitleHeight() {\n if (this.chartData.subtitle) return this.chartData.textHeight * 0.66 || 25 * 0.66;\n return 0;\n },\n /**\n * Gets the combined height of the title and subtitle\n * @memberOf Chart\n * @returns {number} Total header height\n */\n header() {\n return (this.titleHeight + this.subtitleHeight);\n },\n },\n mounted() {\n this.initalizeChart();\n },\n watch: {\n chartData: {\n handler() {\n this.refreshChart();\n },\n deep: true,\n },\n },\n template:\n '',\n });\n },\n};\n\nexport default Chart;\n\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(Chart);\n}\n\n\n// WEBPACK FOOTER //\n// ./src/v-chart-plugin.js","\nexport default [\n {\n month: 'Jan',\n year: 2018,\n total: 475,\n forecast: 500,\n yoy: 1.05,\n actual: true,\n },\n {\n month: 'Feb',\n year: 2018,\n total: 515,\n forecast: 525,\n yoy: 1.03,\n actual: true,\n },\n {\n month: 'Mar',\n year: 2018,\n total: 390,\n forecast: 480,\n yoy: .95,\n actual: true,\n },\n {\n month: 'Apr',\n year: 2018,\n total: 430,\n forecast: 440,\n yoy: .80,\n actual: true,\n },\n {\n month: 'May',\n year: 2018,\n total: 510,\n forecast: 500,\n yoy: .70,\n actual: true,\n },\n {\n month: 'Jun',\n year: 2018,\n total: 399,\n forecast: 450,\n yoy: .75,\n actual: true,\n },\n {\n month: 'Jul',\n year: 2018,\n total: 601,\n forecast: 550,\n yoy: 1.00,\n actual: true,\n },\n {\n month: 'Aug',\n year: 2018,\n total: 496,\n forecast: 480,\n yoy: 1.15,\n actual: true,\n },\n {\n month: 'Sep',\n year: 2018,\n total: 379,\n forecast: 440,\n yoy: 1.10,\n actual: true,\n },\n {\n month: 'Oct',\n year: 2018,\n total: 410,\n forecast: 430,\n yoy: .85,\n actual: false,\n },\n {\n month: 'Nov',\n year: 2018,\n total: 490,\n forecast: 500,\n yoy: .95,\n actual: false,\n },\n {\n month: 'Dec',\n year: 2018,\n total: 610,\n forecast: 625,\n yoy: 1.01,\n actual: false,\n },\n];\n\n\n\n// WEBPACK FOOTER //\n// ./src/assets/data/sales.js","\n \n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/chartExample.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container\"},[_vm._m(0),_vm._v(\" \"),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"form-group col-6 col-md-4\"},[_vm._l((_vm.sales),function(t,index){return _c('div',[_c('input',{directives:[{name:\"model\",rawName:\"v-model.number\",value:(_vm.sales[index].total),expression:\"sales[index].total\",modifiers:{\"number\":true}}],attrs:{\"type\":\"number\"},domProps:{\"value\":(_vm.sales[index].total)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.sales[index], \"total\", _vm._n($event.target.value))},\"blur\":function($event){_vm.$forceUpdate()}}}),_vm._v(\" \"),_c('button',{attrs:{\"type\":\"submit\"},on:{\"click\":function($event){_vm.removeItem(index, $event)}},model:{value:(_vm.sales[index]),callback:function ($$v) {_vm.$set(_vm.sales, index, $$v)},expression:\"sales[index]\"}},[_vm._v(\" [-] \")])])}),_vm._v(\" \"),_c('button',{on:{\"click\":_vm.newItem}},[_vm._v(\" [+] \")])],2),_vm._v(\" \"),_c('div',{staticClass:\"col-6 col-md-8\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-12\"},[_c('v-chart',{attrs:{\"chartData\":_vm.lineGraphData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12 col-lg-6\"},[_c('v-chart',{attrs:{\"chartData\":_vm.areaChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12 col-lg-6\"},[_c('v-chart',{attrs:{\"chartData\":_vm.barChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12 col-lg-6\"},[_c('v-chart',{attrs:{\"chartData\":_vm.vBarChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12 col-lg-6\"},[_c('v-chart',{attrs:{\"chartData\":_vm.pieChartData}})],1)])])]),_vm._v(\" \"),_vm._m(1)])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col\"},[_c('img',{staticClass:\"logo\",attrs:{\"src\":require(\"../assets/img/logo.png\")}})])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('a',{attrs:{\"href\":\"https://github.com/ignoreintuition/v-chart-plugin\"}},[_c('img',{staticStyle:{\"position\":\"absolute\",\"top\":\"0\",\"right\":\"0\",\"border\":\"0\"},attrs:{\"src\":\"https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png\",\"alt\":\"Fork me on GitHub\"}})])}]\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-c144c514\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/chartExample.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-c144c514\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./chartExample.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./chartExample.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./chartExample.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-c144c514\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./chartExample.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/chartExample.vue\n// module id = null\n// module chunks = ","\n \n \n
\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/App.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[_c('chartExample')],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-233405e9\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/App.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-233405e9\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../node_modules/vue-loader/lib/selector?type=styles&index=0!./App.vue\")\n}\nvar normalizeComponent = require(\"!../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\nimport __vue_script__ from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\n/* template */\nimport __vue_template__ from \"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-233405e9\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../node_modules/vue-loader/lib/selector?type=template&index=0!./App.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/App.vue\n// module id = null\n// module chunks = ","// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue';\nimport Chart from './v-chart-plugin';\nimport App from './App.vue';\n\nVue.config.productionTip = false;\n\nVue.use(Chart);\n\n/* eslint-disable no-new */\nnew Vue({\n el: '#app',\n components: { App },\n template: '',\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","module.exports = __webpack_public_path__ + \"static/img/logo.7eeeac5.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/assets/img/logo.png\n// module id = dLd/\n// module chunks = 1"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/static/js/app.fa53c39ff82bc0000f0f.js b/dist/static/js/app.fa53c39ff82bc0000f0f.js
deleted file mode 100644
index 484de0e..0000000
--- a/dist/static/js/app.fa53c39ff82bc0000f0f.js
+++ /dev/null
@@ -1,2 +0,0 @@
-webpackJsonp([1],{"6r8H":function(t,a){},"Gf/I":function(t,a){},NHnr:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var i=e("7+uW"),r=e("Gu7T"),s=e.n(r),n=e("BO1k"),l=e.n(n),c=e("fZjL"),h=e.n(c),o=e("Dd8w"),d=e.n(o),u=e("woOf"),f=e.n(u),x=f()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("bmQh")),m=function(){var t=this,a=x.select("#"+this.chartData.selector),e={palette:{fill:"#005792",stroke:"#d1f4fa"},bar:{hPadding:8,vPadding:5},x:{axisHeight:10,ticks:5},y:{domain:[],range:[],axisWidth:null}},i=function(t){return e.x.scale(t.metric)},r=function(){return(t.displayHeight-e.x.axisHeight-t.header-e.bar.vPadding)/t.ds.length-1},s=function(a,i){return i*(t.displayHeight-e.x.axisHeight-t.header)/t.ds.length+1+t.header},n=function(a){t.addTooltip(a,window.event)},l=function(a){t.removeTooltip(a)},c=a.selectAll("rect").data(this.ds);return e=this.setOverrides(e,this.chartData.overrides),this.ds[0].dim&&(e.y.axisWidth=e.y.axisWidth||10*this.ds.reduce(function(t,a){return a.dim.length>t?a.dim.length:t},0)),e.x.scale=x.scaleLinear().domain([0,t.max]).range([0,t.width-e.bar.hPadding-e.y.axisWidth]),t.ds.forEach(function(t){return e.y.domain.push(t.dim)}),t.ds.forEach(function(a,i){return e.y.range.push((t.displayHeight-e.x.axisHeight-t.header+e.bar.vPadding)*i/t.ds.length)}),e.y.scale=x.scaleOrdinal().domain(e.y.domain).range(e.y.range),e.x.axis=x.axisBottom().ticks(e.x.ticks,"s").scale(e.x.scale),e.y.axis=x.axisLeft().scale(e.y.scale),e.x.yOffset=t.displayHeight-e.x.axisHeight,e.x.xOffset=e.bar.hPadding+e.y.axisWidth,e.y.yOffset=e.bar.vPadding+t.header-1,e.y.xOffset=e.y.axisWidth,t.ds[0].dim&&a.append("g").attr("class","axis").attr("transform","translate("+e.y.xOffset+", "+e.y.yOffset+")").call(e.y.axis),a.append("g").attr("class","axis").attr("transform","translate("+e.x.xOffset+", "+e.x.yOffset+")").call(e.x.axis),function(a){a.enter().append("rect").attr("fill",e.palette.fill).attr("stroke",e.palette.stroke).attr("class",t.selector).attr("width",i).attr("height",r).attr("y",s).attr("x",e.y.axisWidth+e.bar.hPadding).on("mouseover",n).on("mouseout",l)}(c),function(t){t.transition().attr("width",i).attr("height",r).attr("y",s).attr("x",e.y.axisWidth+e.bar.hPadding)}(c),function(t){t.exit().remove()}(c),e},p=f()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("n7yu")),y=function(){var t=this,a=p.select("#"+this.chartData.selector),e={palette:{fill:"#005792",stroke:"#d1f4fa"},bar:{hPadding:0,vPadding:0},x:{axisHeight:20,domain:[],range:[]},y:{axisWidth:30,ticks:5}},i=function(){return(t.width-e.y.axisWidth)/t.chartData.data.length-1},r=function(a){return t.displayHeight-e.y.scale(a.metric)},s=function(a,i){return i*(t.width-e.y.axisWidth)/t.chartData.data.length+e.y.axisWidth},n=function(t){return e.y.scale(t.metric)},l=function(a){t.addTooltip(a,window.event)},c=function(a){t.removeTooltip(a)},h=a.selectAll("rect").data(this.ds);return(e=this.setOverrides(e,this.chartData.overrides)).y.scale=p.scaleLinear().domain([0,t.max]).range([t.displayHeight,t.header]),t.ds.forEach(function(t){return e.x.domain.push(t.dim)}),t.ds.forEach(function(a,i){return e.x.range.push((t.chartData.width-e.y.axisWidth+e.bar.vPadding)*i/t.ds.length)}),e.x.scale=p.scaleOrdinal().domain(e.x.domain).range(e.x.range),e.y.axis=p.axisLeft().ticks(e.y.ticks,"s").scale(e.y.scale),e.x.axis=p.axisBottom().scale(e.x.scale),e.x.yOffset=t.displayHeight,e.x.xOffset=e.y.axisWidth,e.y.yOffset=0,e.y.xOffset=e.y.axisWidth,a.append("g").attr("class","axis").attr("transform","translate("+e.y.xOffset+", "+e.y.yOffset+")").call(e.y.axis),t.ds[0].dim&&a.append("g").attr("class","axis").attr("transform","translate("+e.x.xOffset+", "+e.x.yOffset+")").call(e.x.axis),function(a){a.enter().append("rect").attr("fill",e.palette.fill).attr("stroke",e.palette.stroke).attr("class",t.selector).attr("width",i).attr("height",r).attr("x",s).attr("y",n).on("mouseover",l).on("mouseout",c)}(h),function(t){t.transition().attr("width",i).attr("height",r).attr("x",s).attr("y",n)}(h),function(t){t.exit().remove()}(h),e},g=f()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),v=function(t){var a=this,e=g.select("#"+this.chartData.selector),i={palette:{lineFill:"#ffcdcd",pointFill:"#005792",pointStroke:"#d1f4fa"},x:{domain:[],range:[],axisHeight:20},y:{axisWidth:30,ticks:5}};i.lineFunction=g.line().x(function(t){return i.x.scale(t.dim)+i.y.axisWidth+5}).y(function(t){return i.y.scale(t.metric)});var r=e.selectAll("circle").data(this.ds),s=e.selectAll("path").data(this.ds);return(i=this.setOverrides(i,this.chartData.overrides)).y.scale=g.scaleLinear().domain([a.min,a.max]).range([a.displayHeight-i.x.axisHeight,a.header]),i.y.axis=g.axisLeft().ticks(i.y.ticks,"s").scale(i.y.scale),a.ds.forEach(function(t){return i.x.domain.push(t.dim)}),a.ds.forEach(function(t,e){return i.x.range.push((a.width*e-a.header)/a.ds.length)}),i.x.scale=g.scaleOrdinal().domain(i.x.domain).range(i.x.range),i.x.axis=g.axisBottom().scale(i.x.scale),i.x.xOffset=i.y.axisWidth+5,i.x.yOffset=a.displayHeight-i.x.axisHeight,i.y.xOffset=i.y.axisWidth,i.y.yOffset=0,function(e,r){"init"===t&&r.enter().append("path").attr("d",i.lineFunction(a.ds)).attr("fill","none").attr("stroke",i.palette.lineFill).attr("stroke-width",3),e.enter().append("circle").attr("class",a.selector).attr("r",2).on("mouseover",function(t){a.addTooltip(t,window.event)}).on("mouseout",function(t){a.removeTooltip(t)}).attr("cx",function(t){return i.x.scale(t.dim)+i.y.axisWidth+5}).attr("cy",function(t){return i.y.scale(t.metric)})}(r,s),function(t,e){e.transition().attr("d",i.lineFunction(a.ds)),t.transition().attr("cx",function(t){return i.x.scale(t.dim)+i.y.axisWidth+5}).attr("cy",function(t){return i.y.scale(t.metric)}).attr("cx",function(t){return i.x.scale(t.dim)+i.y.axisWidth+5}).attr("cy",function(t){return i.y.scale(t.metric)})}(r,s),function(t,a){t.exit().remove(),a.exit().remove()}(r,s),e.append("g").append("g").attr("class","axis").attr("transform","translate("+i.x.xOffset+", "+i.x.yOffset+")").call(i.x.axis),e.append("g").append("g").attr("class","axis").attr("transform","translate("+i.y.xOffset+","+i.y.yOffset+")").call(i.y.axis),i},w=f()({},e("sHXk"),e("dJjO"),e("Mx2h")),D=function(){var t=this,a=w.select("#"+this.chartData.selector),e={x:{domain:[],range:[],axisHeight:20},y:{axisWidth:30,ticks:5}},i=a.selectAll("circle").data(this.ds);return(e=this.setOverrides(e,this.chartData.overrides)).y.scale=w.scaleLinear().domain([t.min,t.max]).range([t.displayHeight-e.x.axisHeight,t.header]),e.y.axis=w.axisLeft().ticks(e.y.ticks,"s").scale(e.y.scale),t.ds.forEach(function(t){return e.x.domain.push(t.dim)}),t.ds.forEach(function(a,i){return e.x.range.push((t.width*i-t.header)/t.ds.length)}),e.x.scale=w.scaleOrdinal().domain(e.x.domain).range(e.x.range),e.x.axis=w.axisBottom().scale(e.x.scale),e.x.xOffset=e.y.axisWidth+5,e.x.yOffset=t.height-e.x.axisHeight,e.y.xOffset=e.y.axisWidth,e.y.yOffset=0,a.append("g").attr("class","axis").attr("transform","translate("+e.x.xOffset+", "+e.x.yOffset+")").call(e.x.axis),a.append("g").attr("class","axis").attr("transform","translate("+e.y.xOffset+","+e.y.yOffset+")").call(e.y.axis),i.enter().append("circle").attr("class",t.selector).attr("r",2).on("mouseover",function(a){t.addTooltip(a,window.event)}).on("mouseout",function(a){t.removeTooltip(a)}).attr("cx",function(t){return e.x.scale(t.dim)+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric)}),function(t){t.transition().attr("cx",function(t){return e.x.scale(t.dim)+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric)}).attr("cx",function(t){return e.x.scale(t.dim)+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric)})}(i),i.exit().remove(),e},O=f()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),b=function(){var t=this,a=O.select("#"+this.chartData.selector),e={radius:null,ordinalColors:["#d1f4fa","#005792","#ffe6eb","#ffcdcd"]};e.radius=this.height>this.width?(this.width-.1*this.width)/2:(this.height-.1*this.height)/2;var i=O.scaleOrdinal().range(e.ordinalColors),r=function(t,a){return i(a)},s=function(a){t.addTooltip(a.data,window.event)},n=function(a){t.removeTooltip(a)},l=O.arc().outerRadius(e.radius-10).innerRadius(25),c=O.pie().sort(null).value(function(t){return t.metric}),h=a.selectAll(".arc").data(c(this.ds));return e=this.setOverrides(e,this.chartData.overrides),function(a){a.enter().append("g").attr("transform","translate("+t.width/2+","+t.height/2+")").append("path").merge(a).attr("class","arc").attr("d",l).attr("fill",r).on("mouseover",s).on("mouseout",n).attr("transform","translate(0,"+t.header+")")}(h),function(t){t.transition().attr("d",l).attr("fill",r)}(h),function(t){t.exit().remove()}(h),e},H=f()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),C=function(){var t=this,a=H.select("#"+this.chartData.selector),e={palette:{stroke:"#d1f4fa",fill:"#005792"},x:{domain:[],range:[],axisHeight:45,axisWidth:45},y:{axisWidth:45}},i=function(a){var i=" "+t.width+", "+e.x.yOffset+" ";return i+=" "+e.x.axisHeight+", "+e.x.yOffset+" ",i+=a.map(function(t){return[e.x.scale(t.dim)+e.y.axisWidth+5,e.y.scale(t.metric)].join(",")}).join(" ")},r=a.selectAll("polygon").data([this.ds]);return(e=this.setOverrides(e,this.chartData.overrides)).y.scale=H.scaleLinear().domain([0,t.max]).range([t.displayHeight-e.x.axisHeight,t.titleHeight]),e.y.axis=H.axisLeft().ticks(10,"s").scale(e.y.scale),t.ds.forEach(function(t){return e.x.domain.push(t.dim)}),t.ds.forEach(function(a,i){return e.x.range.push((t.width-e.x.axisWidth)*i/t.ds.length)}),e.x.scale=H.scaleOrdinal().domain(e.x.domain).range(e.x.range),e.x.axis=H.axisBottom().scale(e.x.scale),e.polyFunction=H.line().x(function(t){return e.x.scale(t.dim)+e.y.axisWidth+5}).y(function(t){return e.y.scale(t.metric)}),e.x.xOffset=e.y.axisWidth+5,e.x.yOffset=t.displayHeight-e.x.axisHeight,e.y.xOffset=e.y.axisWidth,e.y.yOffset=0,a.append("g").append("g").attr("class","axis").attr("transform","translate("+e.x.xOffset+", "+e.x.yOffset+")").call(e.x.axis),t.ds[0].dim&&a.append("g").append("g").attr("class","axis").attr("transform","translate("+e.y.xOffset+","+e.y.yOffset+")").call(e.y.axis),r.enter().append("polygon").attr("stroke",e.palette.stroke).attr("fill",e.palette.fill).attr("points",i),function(t){t.transition().attr("points",i)}(r),function(t){t.exit().remove()}(r),e},k=f()({},e("sHXk")),W={install:function(t){t.component("v-chart",{props:["chartData"],data:function(){return{selector:this.chartData.selector+"-"+this.chartData.chartType}},methods:d()({initalizeChart:function(){var t=this[this.chartData.chartType]("init");this.drawTitle(),this.generateLegend(t)},refreshChart:function(){this.clearAxis(),this[this.chartData.chartType]("refresh")},clearAxis:function(){k.select("#"+this.chartData.selector).selectAll(".axis").remove()},clearCanvas:function(){k.select("#"+this.chartData.selector).selectAll("*").remove()},drawTitle:function(){k.select("#"+this.chartData.selector).append("text").attr("x",this.width/2).attr("y",this.titleHeight-.1*this.titleHeight).style("text-anchor","middle").text(this.chartData.title),k.select("#"+this.chartData.selector).append("text").attr("x",this.width/2).attr("y",this.titleHeight-.1*this.titleHeight+this.subtitleHeight).style("text-anchor","middle").text(this.chartData.subtitle)},addTooltip:function(t,a){k.select("#"+this.chartData.selector).append("rect").attr("x",a.layerX-5-50).attr("y",a.layerY-13-25).attr("height","16px").attr("width","80px").attr("class","tt").attr("fill","white"),k.select("#"+this.chartData.selector).append("text").attr("x",a.layerX-50).attr("y",a.layerY-25).attr("class","tt").attr("font-size","10px").text(t.dim+":"+t.metric)},removeTooltip:function(){k.select("#"+this.chartData.selector).selectAll(".tt").remove()},setOverrides:function(t,a){a=a||{};var e=h()(t),i=!0,r=!1,s=void 0;try{for(var n,c=l()(e);!(i=(n=c.next()).done);i=!0){var o=n.value;f()(t[o],a[o])}}catch(t){r=!0,s=t}finally{try{!i&&c.return&&c.return()}finally{if(r)throw s}}return t},generateLegend:function(t){this.chartData.legends&&!0===this.chartData.legends.enabled&&(k.select("#"+this.chartData.selector).append("text").attr("x",this.width-60).attr("y",.95*this.height).style("text-anchor","middle").text(this.chartData.metric),k.select("#"+this.chartData.selector).append("g").attr("class","legends").append("rect").attr("x",this.width-30).attr("y",.95*this.height-10).attr("width",30).attr("height",10).style("fill",function(){return t.palette.lineFill||t.palette.fill}))}},{barChart:m},{vBarChart:y},{scatterPlot:D},{pieChart:b},{areaChart:C},{lineGraph:v}),computed:{ds:function(){var t=this;return this.chartData.data.map(function(a){var e={};return e.metric=t.chartData.metric?a[t.chartData.metric]:a,e.dim=t.chartData.dim?a[t.chartData.dim]:null,e})},height:function(){return this.chartData.height||200},width:function(){return this.chartData.width||200},max:function(){var t=0;return this.ds.forEach(function(a){t=t>a.metric?t:a.metric}),t},min:function(){return Math.min.apply(Math,s()(this.ds.map(function(t){return t.metric})))},titleHeight:function(){return this.chartData.title?this.chartData.textHeight||25:0},displayHeight:function(){return this.chartData.legends&&!0===this.chartData.legends.enabled?.8*this.height:this.height},subtitleHeight:function(){return this.chartData.subtitle?.66*this.chartData.textHeight||16.5:0},header:function(){return this.titleHeight+this.subtitleHeight}},mounted:function(){this.initalizeChart()},watch:{chartData:{handler:function(){this.refreshChart()},deep:!0}},template:""})}},_=W;"undefined"!=typeof window&&window.Vue&&window.Vue.use(W);var T=[{month:"Jan",year:2018,total:475,actual:!0},{month:"Feb",year:2018,total:515,actual:!0},{month:"Mar",year:2018,total:390,actual:!0},{month:"Apr",year:2018,total:430,actual:!0},{month:"May",year:2018,total:510,actual:!0},{month:"Jun",year:2018,total:399,actual:!0},{month:"Jul",year:2018,total:601,actual:!0},{month:"Aug",year:2018,total:496,actual:!0},{month:"Sep",year:2018,total:379,actual:!0},{month:"Oct",year:2018,total:410,actual:!1},{month:"Nov",year:2018,total:490,actual:!1},{month:"Dec",year:2018,total:610,actual:!1}],P={name:"barChartExample",methods:{newItem:function(){this.sales.push({month:null,year:null,total:null,actual:!1})},removeItem:function(t,a){a.preventDefault(),this.sales.splice(t,1)}},data:function(){return{sales:T,areaChartData:{chartType:"areaChart",selector:"areaChart",title:"Area Chart",width:300,height:200,metric:"total",dim:"month",data:T,legends:{enabled:!0,height:25,width:50}},barChartData:{chartType:"barChart",selector:"chart",title:"Bar Chart",subtitle:"Sales by month",height:200,metric:"total",dim:"month",data:T,legends:{enabled:!0,height:25,width:50}},lineGraphData:{chartType:"lineGraph",selector:"lineGraph",title:"Line Graph",width:600,subtitle:"Sales by month",height:200,metric:"total",dim:"month",data:T,legends:{enabled:!0,height:25,width:50}},vBarChartData:{chartType:"vBarChart",selector:"vChart",title:"Verticle Bar Chart",subtitle:"Sales by month",width:300,height:200,metric:"total",dim:"month",data:T,legends:{enabled:!0,height:25,width:50}},pieChartData:{chartType:"pieChart",selector:"pieChart",title:"Pie Chart",subtitle:"Sales by month",width:300,height:200,metric:"total",dim:"month",data:T},scatterPlotData:{chartType:"scatterPlot",selector:"scatterPlot",title:"Scatter Plot",subtitle:"Sales by month",width:300,height:200,metric:"total",dim:"month",data:T,legends:{enabled:!0,height:25,width:50}}}}},A={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"container"},[t._m(0),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-6 col-md-4"},[t._l(t.sales,function(a,i){return e("div",[e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.sales[i].total,expression:"sales[index].total",modifiers:{number:!0}}],attrs:{type:"number"},domProps:{value:t.sales[i].total},on:{input:function(a){a.target.composing||t.$set(t.sales[i],"total",t._n(a.target.value))},blur:function(a){t.$forceUpdate()}}}),t._v(" "),e("button",{attrs:{type:"submit"},on:{click:function(a){t.removeItem(i,a)}},model:{value:t.sales[i],callback:function(a){t.$set(t.sales,i,a)},expression:"sales[index]"}},[t._v(" [-] ")])])}),t._v(" "),e("button",{on:{click:t.newItem}},[t._v(" [+] ")])],2),t._v(" "),e("div",{staticClass:"col-6 col-md-8"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-12"},[e("v-chart",{attrs:{chartData:t.lineGraphData}})],1),t._v(" "),e("div",{staticClass:"col-12 col-lg-6"},[e("v-chart",{attrs:{chartData:t.areaChartData}})],1),t._v(" "),e("div",{staticClass:"col-12 col-lg-6"},[e("v-chart",{attrs:{chartData:t.barChartData}})],1),t._v(" "),e("div",{staticClass:"col-12 col-lg-6"},[e("v-chart",{attrs:{chartData:t.vBarChartData}})],1),t._v(" "),e("div",{staticClass:"col-12 col-lg-6"},[e("v-chart",{attrs:{chartData:t.pieChartData}})],1)])])]),t._v(" "),t._m(1)])},staticRenderFns:[function(){var t=this.$createElement,a=this._self._c||t;return a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("img",{staticClass:"logo",attrs:{src:e("dLd/")}})])])},function(){var t=this.$createElement,a=this._self._c||t;return a("a",{attrs:{href:"https://github.com/ignoreintuition/v-chart-plugin"}},[a("img",{staticStyle:{position:"absolute",top:"0",right:"0",border:"0"},attrs:{src:"https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png",alt:"Fork me on GitHub"}})])}]};var E={name:"App",components:{chartExample:e("VU/8")(P,A,!1,function(t){e("6r8H")},null,null).exports}},L={render:function(){var t=this.$createElement,a=this._self._c||t;return a("div",{attrs:{id:"app"}},[a("chartExample")],1)},staticRenderFns:[]};var F=e("VU/8")(E,L,!1,function(t){e("Gf/I")},null,null).exports;i.a.config.productionTip=!1,i.a.use(_),new i.a({el:"#app",components:{App:F},template:""})},"dLd/":function(t,a,e){t.exports=e.p+"static/img/logo.7eeeac5.png"}},["NHnr"]);
-//# sourceMappingURL=app.fa53c39ff82bc0000f0f.js.map
\ No newline at end of file
diff --git a/dist/static/js/app.fa53c39ff82bc0000f0f.js.map b/dist/static/js/app.fa53c39ff82bc0000f0f.js.map
deleted file mode 100644
index e9e02f7..0000000
--- a/dist/static/js/app.fa53c39ff82bc0000f0f.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///./src/import/barChart.js","webpack:///./src/import/vBarChart.js","webpack:///./src/import/lineGraph.js","webpack:///./src/import/scatterPlot.js","webpack:///./src/import/pieChart.js","webpack:///./src/import/areaChart.js","webpack:///./src/v-chart-plugin.js","webpack:///./src/assets/data/sales.js","webpack:///src/components/chartExample.vue","webpack:///./src/components/chartExample.vue?11ce","webpack:///./src/components/chartExample.vue","webpack:///src/App.vue","webpack:///./src/App.vue?b8d2","webpack:///./src/App.vue","webpack:///./src/main.js","webpack:///./src/assets/img/logo.png"],"names":["d3","assign_default","require","barChart","_this","this","svgContainer","select","chartData","selector","cs","palette","fill","stroke","bar","hPadding","vPadding","x","axisHeight","ticks","y","domain","range","axisWidth","getWidth","d","scale","metric","getHeight","displayHeight","header","ds","length","getYCoord","i","mouseOver","addTooltip","window","event","mouseOut","removeTooltip","rects","selectAll","data","setOverrides","overrides","dim","reduce","accumulator","currentValue","scaleLinear","max","width","forEach","t","push","scaleOrdinal","axis","axisBottom","axisLeft","yOffset","xOffset","append","attr","call","enter","on","transition","exit","remove","vBarChart","getXCoord","lineGraph","mode","lineFill","pointFill","pointStroke","lineFunction","line","points","path","min","scatterPlot","height","p","pieChart","radius","ordinalColors","color","getColor","arc","outerRadius","innerRadius","pie","sort","value","merge","areaChart","getPoints","poly","map","join","titleHeight","polyFunction","s","Chart","install","Vue","component","props","chartType","methods","initalizeChart","drawTitle","generateLegend","refreshChart","clearAxis","clearCanvas","style","text","title","subtitleHeight","subtitle","e","layerX","layerY","keys","keys_default","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","get_iterator_default","next","done","key","err","return","legends","enabled","computed","td","Math","apply","toConsumableArray_default","o","textHeight","mounted","watch","handler","deep","template","use","sales","month","year","total","actual","chartExample","name","newItem","removeItem","preventDefault","splice","areaChartData","barChartData","lineGraphData","vBarChartData","pieChartData","scatterPlotData","components_chartExample","render","_vm","_h","$createElement","_c","_self","staticClass","_m","_v","_l","index","directives","rawName","expression","modifiers","number","attrs","type","domProps","input","$event","target","composing","$set","_n","blur","$forceUpdate","click","model","callback","$$v","staticRenderFns","src","__webpack_require__","href","staticStyle","position","top","right","border","alt","App","components","normalizeComponent","ssrContext","selectortype_template_index_0_src_App","id","src_App","App_normalizeComponent","config","productionTip","el","module","exports"],"mappings":"4QAUMA,EAAKC,OACTC,EAAQ,QACRA,EAAQ,QACRA,EAAQ,QACRA,EAAQ,SAqLKC,EA/KE,WAAiB,IAAAC,EAAAC,KAK1BC,EAAeN,EAAGO,OAAH,IAAcF,KAAKG,UAAUC,UAK9CC,GACFC,SACEC,KAAM,UACNC,OAAQ,WAEVC,KACEC,SAAU,EACVC,SAAU,GAEZC,GACEC,WAAY,GACZC,MAAO,GAETC,GACEC,UACAC,SACAC,UAAW,OAUTC,EAAW,SAAAC,GAAA,OAAKf,EAAGO,EAAES,MAAMD,EAAEE,SAO7BC,EAAY,kBAChBxB,EAAKyB,cAAgBnB,EAAGO,EAAEC,WAAad,EAAK0B,OAASpB,EAAGI,IAAIE,UAAYZ,EAAK2B,GAAGC,OAAS,GASrFC,EAAY,SAACR,EAAGS,GAAJ,OAAUA,GAC1B9B,EAAKyB,cAAgBnB,EAAGO,EAAEC,WAAad,EAAK0B,QAAU1B,EAAK2B,GAAGC,OAAS,EAAI5B,EAAK0B,QAQ5EK,EAAY,SAACV,GACjBrB,EAAKgC,WAAWX,EAAGY,OAAOC,QAStBC,EAAW,S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C6K,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBE,YAAA,QAAkBF,EAAA,OAAYE,YAAA,QAAkBF,EAAA,OAAYE,YAAA,OAAAU,OAA0BgB,IAAMC,EAAQ,gBAAiC,WAAc,IAAa/B,EAAb1K,KAAa2K,eAA0BC,EAAvC5K,KAAuC6K,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,KAAeY,OAAOkB,KAAA,uDAA4D9B,EAAA,OAAY+B,aAAaC,SAAA,WAAAC,IAAA,IAAAC,MAAA,IAAAC,OAAA,KAAyDvB,OAAQgB,IAAA,sEAAAQ,IAAA,4BCElf,ICMAC,GACArD,KAAA,MACAsD,YACAvD,aDTyB8C,EAAQ,OAcjCU,CACExD,EACAY,GATF,EAVA,SAAA6C,GACEX,EAAQ,SAaV,KAEA,MAUgC,UEvBjBY,GADE7C,OAFP,WAAgB,IAAaE,EAAb1K,KAAa2K,eAA0BC,EAAvC5K,KAAuC6K,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBY,OAAO8B,GAAA,SAAY1C,EAAA,qBAE7F2B,oBCChC,IAuBegB,EAvBUd,EAAQ,OAcjBe,CACdP,EACAI,GAT6B,EAV/B,SAAoBD,GAClBX,EAAQ,SAaS,KAEU,MAUG,QCpBhCnG,IAAImH,OAAOC,eAAgB,EAE3BpH,IAAI+C,IAAIjD,GAGR,IAAIE,KACFqH,GAAI,OACJT,YAAcD,OACd7D,SAAU,mCCdZwE,EAAAC,QAAiBpB,EAAA1H,EAAuB","file":"static/js/app.fa53c39ff82bc0000f0f.js","sourcesContent":["/** \n * @fileOverview Bar chart component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n /* eslint-env browser */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-ease'));\n/**\n * Builds a Bar Chart.\n * @module barChart\n */\n\nconst barChart = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n palette: {\n fill: '#005792',\n stroke: '#d1f4fa',\n },\n bar: {\n hPadding: 8,\n vPadding: 5,\n },\n x: {\n axisHeight: 10,\n ticks: 5,\n },\n y: {\n domain: [],\n range: [],\n axisWidth: null,\n },\n };\n\n /**\n * Returns width of the bar\n * @member getWidth\n * @function\n * @param {Object} d (svg element)\n */\n const getWidth = d => cs.x.scale(d.metric);\n\n /**\n * Returns height of the bar\n * @member getHeight\n * @function\n */\n const getHeight = () => (\n this.displayHeight - cs.x.axisHeight - this.header - cs.bar.vPadding) / this.ds.length - 1;\n\n /**\n * Returns y axis co-ordinate of the bar\n * @member getYCoord\n * @function\n * @param {Object} d (svg element)\n * @param {Object} i (svg element)\n */\n const getYCoord = (d, i) => i * (\n this.displayHeight - cs.x.axisHeight - this.header) / this.ds.length + 1 + this.header;\n\n /**\n * Adds a tooltip on mouse over\n * @member mouseOver\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOver = (d) => {\n this.addTooltip(d, window.event);\n };\n\n /**\n * Removes tooltip on mouse out\n * @member mouseOut\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOut = (d) => {\n this.removeTooltip(d);\n };\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} rects (svg element)\n */\n const enter = (rects) => {\n rects.enter()\n .append('rect')\n .attr('fill', cs.palette.fill)\n .attr('stroke', cs.palette.stroke)\n .attr('class', this.selector)\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('y', getYCoord)\n .attr('x', cs.y.axisWidth + cs.bar.hPadding)\n .on('mouseover', mouseOver)\n .on('mouseout', mouseOut);\n return rects;\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} rects (svg element)\n */\n const transition = (rects) => {\n rects.transition()\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('y', getYCoord)\n .attr('x', cs.y.axisWidth + cs.bar.hPadding);\n return rects;\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} rect (svg element)\n */\n const exit = (rects) => {\n rects.exit().remove();\n return rects;\n };\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.x.scale = d3.scaleLinear()\n .domain([0, this.max])\n .range([0, this.width - cs.bar.hPadding - cs.y.axisWidth]);\n this.ds.forEach(t => cs.y.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.y.range.push(((\n this.displayHeight - cs.x.axisHeight - this.header + cs.bar.vPadding) * i) / this.ds.length));\n cs.y.scale = d3.scaleOrdinal().domain(cs.y.domain).range(cs.y.range);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.x.axis = d3.axisBottom().ticks(cs.x.ticks, 's').scale(cs.x.scale);\n cs.y.axis = d3.axisLeft().scale(cs.y.scale);\n cs.x.yOffset = this.displayHeight - cs.x.axisHeight;\n cs.x.xOffset = cs.bar.hPadding + cs.y.axisWidth;\n cs.y.yOffset = cs.bar.vPadding + this.header - 1;\n cs.y.xOffset = cs.y.axisWidth;\n if (this.ds[0].dim)\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`).call(cs.y.axis);\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`).call(cs.x.axis);\n };\n /**\n * Get the maximum dimension length\n * @member getMaxDimLength\n * @function\n * @param {number} accumulator\n * @param {number} currentValue\n */\n const getMaxDimLength = (accumulator, currentValue) => {\n return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator;\n }\n\n const rects = svgContainer.selectAll('rect').data(this.ds);\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n if (this.ds[0].dim)\n cs.y.axisWidth = cs.y.axisWidth || (this.ds.reduce(getMaxDimLength, 0)) * 10;\n\n buildScales(cs);\n drawAxis(cs);\n enter(rects);\n transition(rects);\n exit(rects);\n\n return cs;\n};\n\nexport default barChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/barChart.js","/** \n * @fileOverview Verticle Bar Chart component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n const d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-transition'));\n/**\n * Builds a Verticle Bar Chart.\n * @module vBarChart\n */\n\nconst vBarChart = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n palette: {\n fill: '#005792',\n stroke: '#d1f4fa',\n },\n bar: {\n hPadding: 0,\n vPadding: 0,\n },\n x: {\n axisHeight: 20,\n domain: [],\n range: [],\n },\n y: {\n axisWidth: 30,\n ticks: 5,\n },\n };\n /**\n * Returns width of the bar\n * @member getWidth\n * @function\n */\n\n const getWidth = () => ((this.width - cs.y.axisWidth) / this.chartData.data.length - 1);\n\n /**\n * Returns height of the bar\n * @member getHeight\n * @function\n * @param {Object} d (svg element)\n */\n const getHeight = d => this.displayHeight - cs.y.scale(d.metric);\n\n /**\n * Returns x axis co-ordinate of the bar\n * @member getXCoord\n * @function\n * @param {Object} d (svg element)\n * @param {Object} i (svg element)\n */\n const getXCoord = (d, i) => (\n i * (this.width - cs.y.axisWidth) / this.chartData.data.length) + cs.y.axisWidth;\n /**\n * Returns y axis co-ordinate of the bar\n * @member getYCoord\n * @function\n * @param {Object} d (svg element)\n */\n const getYCoord = d => cs.y.scale(d.metric);\n\n /**\n * Adds a tooltip on mouse over\n * @member mouseOver\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOver = (d) => {\n this.addTooltip(d, window.event);\n };\n\n /**\n * Removes tooltip on mouse out\n * @member mouseOut\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOut = (d) => {\n this.removeTooltip(d);\n };\n\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} rects (svg element)\n */\n const enter = (rects) => {\n rects.enter()\n .append('rect')\n .attr('fill', cs.palette.fill)\n .attr('stroke', cs.palette.stroke)\n .attr('class', this.selector)\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('x', getXCoord)\n .attr('y', getYCoord)\n .on('mouseover', mouseOver)\n .on('mouseout', mouseOut);\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} rects (svg element)\n */\n const transition = (rects) => {\n rects.transition()\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('x', getXCoord)\n .attr('y', getYCoord);\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} rects (svg element)\n */\n const exit = (rects) => {\n rects.exit().remove();\n };\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.y.scale = d3.scaleLinear()\n .domain([0, this.max])\n .range([this.displayHeight, this.header]);\n this.ds.forEach(t => cs.x.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.x.range.push(((\n this.chartData.width - cs.y.axisWidth + cs.bar.vPadding) * i) / this.ds.length));\n cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);\n cs.x.axis = d3.axisBottom().scale(cs.x.scale);\n cs.x.yOffset = this.displayHeight;\n cs.x.xOffset = cs.y.axisWidth;\n cs.y.yOffset = 0;\n cs.y.xOffset = cs.y.axisWidth;\n svgContainer.append('g').attr('class', 'axis')\n .attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`)\n .call(cs.y.axis);\n if (this.ds[0].dim)\n svgContainer.append('g').attr('class', 'axis')\n .attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)\n .call(cs.x.axis);\n };\n\n const rects = svgContainer.selectAll('rect').data(this.ds);\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n buildScales(cs);\n drawAxis(cs);\n enter(rects);\n transition(rects);\n exit(rects);\n\n return cs;\n};\n\nexport default vBarChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/vBarChart.js","/** \n * @fileOverview Line Graph component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-shape'));\n/**\n * Builds a Line Graph.\n * @module lineGraph\n */\n\nconst lineGraph = function chart(mode) {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n palette: {\n lineFill: '#ffcdcd',\n pointFill: '#005792',\n pointStroke: '#d1f4fa',\n },\n x: {\n domain: [],\n range: [],\n axisHeight: 20,\n },\n y: {\n axisWidth: 30,\n ticks: 5,\n },\n };\n\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} points (svg element) \n */\n const enter = (points, path) => {\n if (mode === 'init')\n path.enter()\n .append('path')\n .attr('d', cs.lineFunction(this.ds))\n .attr('fill', 'none')\n .attr('stroke', cs.palette.lineFill)\n .attr('stroke-width', 3);\n\n points.enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('r', 2)\n .on('mouseover', (d) => {\n this.addTooltip(d, window.event);\n })\n .on('mouseout', (d) => {\n this.removeTooltip(d);\n })\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric));\n return points;\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} points (svg element) \n */\n const transition = (points, path) => {\n path.transition()\n .attr('d', cs.lineFunction(this.ds));\n\n points.transition()\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric))\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric));\n return points;\n };\n\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} points (svg element)\n */\n const exit = (points, path) => {\n points.exit().remove();\n path.exit().remove();\n return points;\n };\n\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.y.scale = d3.scaleLinear()\n .domain([this.min, this.max])\n .range([this.displayHeight - cs.x.axisHeight, this.header]);\n cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);\n this.ds.forEach(t => cs.x.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.x.range.push(((this.width * i) - this.header) / this.ds.length));\n cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.x.axis = d3.axisBottom().scale(cs.x.scale);\n cs.x.xOffset = cs.y.axisWidth + 5;\n cs.x.yOffset = this.displayHeight - cs.x.axisHeight;\n cs.y.xOffset = cs.y.axisWidth;\n cs.y.yOffset = 0;\n };\n\n cs.lineFunction = d3.line()\n .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .y(d => cs.y.scale(d.metric));\n\n const points = svgContainer.selectAll('circle').data(this.ds);\n const path = svgContainer.selectAll('path').data(this.ds);\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n\n buildScales(cs);\n drawAxis(cs);\n enter(points, path);\n transition(points, path);\n exit(points, path);\n\n svgContainer.append('g').append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)\n .call(cs.x.axis);\n svgContainer.append('g').append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)\n .call(cs.y.axis);\n\n return cs;\n};\n\nexport default lineGraph;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/lineGraph.js","/** \n * @fileOverview Scatter Plot component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n /* eslint-env browser */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'));\n/**\n * Builds a Scatter Plot.\n * @module scatterPlot\n */\n\nconst scatterPlot = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n x: {\n domain: [],\n range: [],\n axisHeight: 20,\n },\n y: {\n axisWidth: 30,\n ticks: 5,\n },\n };\n const points = svgContainer.selectAll('circle').data(this.ds);\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} p (svg element)\n */\n const enter = (p) => {\n p.enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('r', 2)\n .on('mouseover', (d) => {\n this.addTooltip(d, window.event);\n })\n .on('mouseout', (d) => {\n this.removeTooltip(d);\n })\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric));\n return points;\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} p (svg element)\n */\n const transition = (p) => {\n p.transition()\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric))\n .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric));\n return points;\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} rect (svg element)\n */\n const exit = () => {\n points.exit().remove();\n return points;\n };\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.y.scale = d3.scaleLinear()\n .domain([this.min, this.max])\n .range([this.displayHeight - cs.x.axisHeight, this.header]);\n cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);\n this.ds.forEach(t => cs.x.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.x.range.push(((this.width * i) - this.header) / this.ds.length));\n cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.x.axis = d3.axisBottom().scale(cs.x.scale);\n cs.x.xOffset = cs.y.axisWidth + 5;\n cs.x.yOffset = this.height - cs.x.axisHeight;\n cs.y.xOffset = cs.y.axisWidth;\n cs.y.yOffset = 0;\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`).call(cs.x.axis);\n svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`).call(cs.y.axis);\n };\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n buildScales(cs);\n drawAxis(cs);\n enter(points);\n transition(points);\n exit(points);\n\n return cs;\n};\n\nexport default scatterPlot;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/scatterPlot.js","/** \n * @fileOverview Pie Chart component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n /* eslint-env browser */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-shape'));\n/**\n * Builds an Pie Chart.\n * @module pieChart\n */\n\nconst pieChart = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n radius: null,\n ordinalColors: ['#d1f4fa', '#005792', '#ffe6eb', '#ffcdcd'],\n };\n cs.radius = this.height > this.width ? (\n this.width - this.width * 0.1) / 2 : (this.height - this.height * 0.1) / 2;\n\n const color = d3.scaleOrdinal()\n .range(cs.ordinalColors);\n\n /**\n * Returns colors for pie chart\n * @member getColor\n * @function\n */\n const getColor = (d, i) => color(i);\n\n /**\n * Adds a tooltip on mouse over\n * @member mouseOver\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOver = (d) => {\n this.addTooltip(d.data, window.event);\n };\n\n /**\n * Removes tooltip on mouse out\n * @member mouseOut\n * @function\n * @param {Object} d (svg element)\n */\n const mouseOut = (d) => {\n this.removeTooltip(d);\n };\n\n const path = d3.arc()\n .outerRadius(cs.radius - 10)\n .innerRadius(25);\n\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} arc (svg element)\n */\n const enter = (arc) => {\n arc.enter()\n .append('g')\n .attr('transform', `translate(${this.width / 2},${this.height / 2})`)\n .append('path')\n .merge(arc)\n .attr('class', 'arc')\n .attr('d', path)\n .attr('fill', getColor)\n .on('mouseover', mouseOver)\n .on('mouseout', mouseOut)\n .attr('transform', `translate(0,${this.header})`);\n return arc;\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} arc (svg element)\n */\n const transition = (arc) => {\n arc.transition()\n .attr('d', path)\n .attr('fill', getColor);\n return arc;\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} arc (svg element)\n */\n const exit = (arc) => {\n arc.exit().remove();\n return arc;\n };\n\n const pie = d3.pie()\n .sort(null)\n .value(d => d.metric);\n\n const arc = svgContainer.selectAll('.arc')\n .data(pie(this.ds));\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n enter(arc);\n transition(arc);\n exit(arc);\n\n return cs;\n};\n\nexport default pieChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/pieChart.js","/** \n * @fileOverview Area chart component definition\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n * @requires src/v-chart-plugin.js\n */\n\n /* eslint-env browser */\nconst d3 = Object.assign({},\n require('d3-selection'),\n require('d3-scale'),\n require('d3-axis'),\n require('d3-shape'));\n/**\n * Builds an Area Chart.\n * @module areaChart\n */\nconst areaChart = function chart() {\n /**\n * The SVG that stores the chart\n * @member svgContainer\n */\n const svgContainer = d3.select(`#${this.chartData.selector}`);\n /**\n * The configuration of the coordinate system\n * @member cs\n */\n let cs = {\n palette: {\n stroke: '#d1f4fa',\n fill: '#005792',\n },\n x: {\n domain: [],\n range: [],\n axisHeight: 45,\n axisWidth: 45,\n },\n y: {\n axisWidth: 45,\n },\n };\n /**\n * Returns plot points \n * @member getPoints\n * @function\n * @param {Object} p\n */\n const getPoints = (p) => {\n let poly = (` ${this.width}, ${cs.x.yOffset} `);\n poly += (` ${cs.x.axisHeight}, ${cs.x.yOffset} `);\n poly += p.map(d => [cs.x.scale(d.dim) + cs.y.axisWidth + 5, cs.y.scale(d.metric)].join(',')).join(' ');\n return poly;\n };\n\n const poly = svgContainer.selectAll('polygon').data([this.ds]);\n\n /**\n * Runs when a new element is added to the dataset\n * @member enter\n * @function\n * @param {Object} s (svg element)\n */\n const enter = (s) => {\n s.enter()\n .append('polygon')\n .attr('stroke', cs.palette.stroke)\n .attr('fill', cs.palette.fill)\n .attr('points', getPoints);\n };\n /**\n * Runs when a value of an element in dataset is changed\n * @member transition\n * @function\n * @param {Object} s (svg element)\n */\n const transition = (s) => {\n s.transition()\n .attr('points', getPoints);\n };\n /**\n * Runs when an element is removed from the dataset\n * @member exit\n * @function\n * @param {Object} s (svg element)\n */\n const exit = (s) => {\n s.exit().remove();\n return s;\n };\n /**\n * Builds the scales for the x and y axes\n * @member buildScales\n * @function\n */\n const buildScales = () => {\n cs.y.scale = d3.scaleLinear()\n .domain([0, this.max])\n .range([this.displayHeight - cs.x.axisHeight, this.titleHeight]);\n cs.y.axis = d3.axisLeft().ticks(10, 's').scale(cs.y.scale);\n this.ds.forEach(t => cs.x.domain.push(t.dim));\n this.ds.forEach((t, i) => cs.x.range.push((((\n this.width - cs.x.axisWidth) * i)) / this.ds.length));\n cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);\n cs.x.axis = d3.axisBottom().scale(cs.x.scale);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = () => {\n cs.polyFunction = d3.line()\n .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)\n .y(d => cs.y.scale(d.metric));\n cs.x.xOffset = cs.y.axisWidth + 5;\n cs.x.yOffset = this.displayHeight - cs.x.axisHeight;\n cs.y.xOffset = cs.y.axisWidth;\n cs.y.yOffset = 0;\n svgContainer.append('g').append('g')\n .attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)\n .call(cs.x.axis);\n if (this.ds[0].dim)\n svgContainer.append('g').append('g').attr('class', 'axis')\n .attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)\n .call(cs.y.axis);\n };\n \n cs = this.setOverrides(cs, this.chartData.overrides);\n buildScales(cs);\n drawAxis(cs);\n enter(poly);\n transition(poly);\n exit(poly);\n\n return cs;\n};\n\nexport default areaChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/areaChart.js","/** \n * @fileOverview Chart component containing all of the generic components required for charts\n *\n * @author Brian Greig\n *\n * @requires NPM:d3:Vue\n */\n\n/* eslint-env browser */\nimport barChart from './import/barChart';\nimport vBarChart from './import/vBarChart';\nimport lineGraph from './import/lineGraph';\nimport scatterPlot from './import/scatterPlot';\nimport pieChart from './import/pieChart';\nimport areaChart from './import/areaChart';\n\nconst d3 = Object.assign({},\n require('d3-selection'));\n\n/**\n * Chart is the generic component used for any chart type\n * @namespace\n */\n \nconst Chart = {\n install(Vue) {\n Vue.component('v-chart', {\n props: ['chartData'],\n data() {\n return {\n selector: `${this.chartData.selector}-${this.chartData.chartType}`,\n };\n },\n methods: {\n /**\n * Generate a new Chart of type chartType\n * @memberOf Chart\n */\n initalizeChart() {\n const cs = this[this.chartData.chartType]('init');\n this.drawTitle();\n this.generateLegend(cs);\n },\n /**\n * Redraw the Chart when the data is recycled\n * @memberOf Chart\n */\n refreshChart() {\n this.clearAxis();\n this[this.chartData.chartType]('refresh');\n },\n /**\n * Remove x and y axes\n * @memberOf Chart\n */\n clearAxis() {\n d3.select(`#${this.chartData.selector}`).selectAll('.axis').remove();\n },\n /**\n * Remove all content from the SVG\n * @memberOf Chart\n */\n clearCanvas() {\n d3.select(`#${this.chartData.selector}`).selectAll('*').remove();\n },\n /**\n * Appends title and subtitle to the chart\n * @memberOf Chart\n */\n drawTitle() {\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', this.width / 2)\n .attr('y', this.titleHeight - this.titleHeight * 0.1)\n .style('text-anchor', 'middle')\n .text(this.chartData.title);\n\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', this.width / 2)\n .attr('y', this.titleHeight - this.titleHeight * 0.1 + this.subtitleHeight)\n .style('text-anchor', 'middle')\n .text(this.chartData.subtitle);\n },\n /**\n * Adds a tooltip to the SVG\n * @memberOf Chart\n * @param {Object} d dataset\n * @param {Object} e event x and y coordinates\n */\n addTooltip(d, e) {\n d3.select(`#${this.chartData.selector}`)\n .append('rect')\n .attr('x', e.layerX - 5 - 50)\n .attr('y', e.layerY - 13 - 25)\n .attr('height', '16px')\n .attr('width', '80px')\n .attr('class', 'tt')\n .attr('fill', 'white');\n\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', e.layerX - 50)\n .attr('y', e.layerY - 25)\n .attr('class', 'tt')\n .attr('font-size', '10px')\n .text(`${d.dim}:${d.metric}`);\n },\n /**\n * Removes all tooltips from the SVG\n * @memberOf Chart\n * @param {Object} d dataset\n */\n removeTooltip() {\n d3.select(`#${this.chartData.selector}`)\n .selectAll('.tt').remove();\n },\n /**\n * Override default values \n * @param {Object} cs configuration of the coordinate systems\n * @param {Object} overrides the additional values that can be used for an object\n * @returns {Object} updated configuration of coordinate system \n */\n setOverrides(cs, overrides) {\n overrides = overrides || {};\n const keys = Object.keys(cs);\n for (const key of keys)\n Object.assign(cs[key], overrides[key]);\n return cs;\n },\n /**\n * Generate legend if option -legends- defined as true\n * @memberOf Chart\n * @param {Object} cs configuration of the coordinate system\n */\n generateLegend(cs) {\n if (this.chartData.legends && this.chartData.legends.enabled === true) {\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', this.width - 60)\n .attr('y', this.height * 0.95)\n .style('text-anchor', 'middle')\n .text(this.chartData.metric);\n\n d3.select(`#${this.chartData.selector}`)\n .append(\"g\")\n .attr(\"class\", \"legends\")\n .append(\"rect\")\n .attr('x', this.width - 30)\n .attr('y', this.height * 0.95 - 10)\n .attr(\"width\", 30)\n .attr(\"height\", 10)\n .style(\"fill\", function () {\n const fill = cs.palette.lineFill || cs.palette.fill;\n return fill;\n });\n }\n },\n\n ...((typeof barChart !== 'undefined') && { barChart }),\n ...((typeof vBarChart !== 'undefined') && { vBarChart }),\n ...((typeof scatterPlot !== 'undefined') && { scatterPlot }),\n ...((typeof pieChart !== 'undefined') && { pieChart }),\n ...((typeof areaChart !== 'undefined') && { areaChart }),\n ...((typeof lineGraph !== 'undefined') && { lineGraph }),\n },\n computed: {\n /**\n * Dataset getter function\n * @memberOf Chart\n * @returns {Object} normalized dataset\n */\n ds() {\n return this.chartData.data.map((d) => {\n const td = {};\n td.metric = this.chartData.metric ? d[this.chartData.metric] : d;\n td.dim = this.chartData.dim ? d[this.chartData.dim] : null;\n return td;\n });\n },\n /**\n * Height getter function\n * @memberOf Chart\n * @returns {number} Chart Height\n */\n height() {\n return this.chartData.height || 200;\n },\n /**\n * Width getter function\n * @memberOf Chart\n * @returns {number} Chart width\n */\n width() {\n return this.chartData.width || 200;\n },\n /**\n * Get the maxium value for metric\n * @memberOf Chart\n * @returns {number} Max value for metric\n */\n max() {\n let max = 0;\n this.ds.forEach((e) => {\n max = max > e.metric ? max : e.metric;\n });\n return max;\n },\n /**\n * Get the minimum value for dataset\n * @memberOf Chart\n * @returns {number} Min value for metric\n */\n min() {\n return Math.min(...this.ds.map(o => o.metric));\n },\n /**\n * Gets the height of the title \n * @memberOf Chart\n * @returns {number} Height of the chart title\n */\n titleHeight() {\n if (this.chartData.title) return this.chartData.textHeight || 25;\n return 0;\n },\n /**\n * Gets the height of the dispaly area\n * @memberOf Chart\n * @returns {number} Height of the chart display\n */\n displayHeight() {\n if (this.chartData.legends && this.chartData.legends.enabled === true) {\n return this.height * .80;\n } else {\n return this.height;\n }\n },\n /**\n * Gets the subtitle height\n * @memberOf Chart\n * @returns {number} Height of chart subtitle\n */\n subtitleHeight() {\n if (this.chartData.subtitle) return this.chartData.textHeight * 0.66 || 25 * 0.66;\n return 0;\n },\n /**\n * Gets the combined height of the title and subtitle\n * @memberOf Chart\n * @returns {number} Total header height\n */\n header() {\n return (this.titleHeight + this.subtitleHeight);\n },\n },\n mounted() {\n this.initalizeChart();\n },\n watch: {\n chartData: {\n handler() {\n this.refreshChart();\n },\n deep: true,\n },\n },\n template:\n '',\n });\n },\n};\n\nexport default Chart;\n\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(Chart);\n}\n\n\n// WEBPACK FOOTER //\n// ./src/v-chart-plugin.js","\nexport default [\n {\n month: 'Jan',\n year: 2018,\n total: 475,\n actual: true,\n },\n {\n month: 'Feb',\n year: 2018,\n total: 515,\n actual: true,\n },\n {\n month: 'Mar',\n year: 2018,\n total: 390,\n actual: true,\n },\n {\n month: 'Apr',\n year: 2018,\n total: 430,\n actual: true,\n },\n {\n month: 'May',\n year: 2018,\n total: 510,\n actual: true,\n },\n {\n month: 'Jun',\n year: 2018,\n total: 399,\n actual: true,\n },\n {\n month: 'Jul',\n year: 2018,\n total: 601,\n actual: true,\n },\n {\n month: 'Aug',\n year: 2018,\n total: 496,\n actual: true,\n },\n {\n month: 'Sep',\n year: 2018,\n total: 379,\n actual: true,\n },\n {\n month: 'Oct',\n year: 2018,\n total: 410,\n actual: false,\n },\n {\n month: 'Nov',\n year: 2018,\n total: 490,\n actual: false,\n },\n {\n month: 'Dec',\n year: 2018,\n total: 610,\n actual: false,\n },\n\n\n];\n\n\n\n// WEBPACK FOOTER //\n// ./src/assets/data/sales.js","\n \n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/chartExample.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container\"},[_vm._m(0),_vm._v(\" \"),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"form-group col-6 col-md-4\"},[_vm._l((_vm.sales),function(t,index){return _c('div',[_c('input',{directives:[{name:\"model\",rawName:\"v-model.number\",value:(_vm.sales[index].total),expression:\"sales[index].total\",modifiers:{\"number\":true}}],attrs:{\"type\":\"number\"},domProps:{\"value\":(_vm.sales[index].total)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.sales[index], \"total\", _vm._n($event.target.value))},\"blur\":function($event){_vm.$forceUpdate()}}}),_vm._v(\" \"),_c('button',{attrs:{\"type\":\"submit\"},on:{\"click\":function($event){_vm.removeItem(index, $event)}},model:{value:(_vm.sales[index]),callback:function ($$v) {_vm.$set(_vm.sales, index, $$v)},expression:\"sales[index]\"}},[_vm._v(\" [-] \")])])}),_vm._v(\" \"),_c('button',{on:{\"click\":_vm.newItem}},[_vm._v(\" [+] \")])],2),_vm._v(\" \"),_c('div',{staticClass:\"col-6 col-md-8\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-12\"},[_c('v-chart',{attrs:{\"chartData\":_vm.lineGraphData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12 col-lg-6\"},[_c('v-chart',{attrs:{\"chartData\":_vm.areaChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12 col-lg-6\"},[_c('v-chart',{attrs:{\"chartData\":_vm.barChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12 col-lg-6\"},[_c('v-chart',{attrs:{\"chartData\":_vm.vBarChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12 col-lg-6\"},[_c('v-chart',{attrs:{\"chartData\":_vm.pieChartData}})],1)])])]),_vm._v(\" \"),_vm._m(1)])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col\"},[_c('img',{staticClass:\"logo\",attrs:{\"src\":require(\"../assets/img/logo.png\")}})])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('a',{attrs:{\"href\":\"https://github.com/ignoreintuition/v-chart-plugin\"}},[_c('img',{staticStyle:{\"position\":\"absolute\",\"top\":\"0\",\"right\":\"0\",\"border\":\"0\"},attrs:{\"src\":\"https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png\",\"alt\":\"Fork me on GitHub\"}})])}]\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-79f7a81d\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/chartExample.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-79f7a81d\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./chartExample.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./chartExample.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./chartExample.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-79f7a81d\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./chartExample.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/chartExample.vue\n// module id = null\n// module chunks = ","\n \n \n
\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/App.vue","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[_c('chartExample')],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-233405e9\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/App.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-233405e9\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../node_modules/vue-loader/lib/selector?type=styles&index=0!./App.vue\")\n}\nvar normalizeComponent = require(\"!../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\nimport __vue_script__ from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\n/* template */\nimport __vue_template__ from \"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-233405e9\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../node_modules/vue-loader/lib/selector?type=template&index=0!./App.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/App.vue\n// module id = null\n// module chunks = ","// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue';\nimport Chart from './v-chart-plugin';\nimport App from './App.vue';\n\nVue.config.productionTip = false;\n\nVue.use(Chart);\n\n/* eslint-disable no-new */\nnew Vue({\n el: '#app',\n components: { App },\n template: '',\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","module.exports = __webpack_public_path__ + \"static/img/logo.7eeeac5.png\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/assets/img/logo.png\n// module id = dLd/\n// module chunks = 1"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/static/js/manifest.c423efaf7696a83d1404.js.map b/dist/static/js/manifest.c423efaf7696a83d1404.js.map
index 1dc5107..c30537d 100644
--- a/dist/static/js/manifest.c423efaf7696a83d1404.js.map
+++ b/dist/static/js/manifest.c423efaf7696a83d1404.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/bootstrap f03efa80f08d2d5cdb4e"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,wBAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.c423efaf7696a83d1404.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/v-chart-plugin-demo/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f03efa80f08d2d5cdb4e"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/bootstrap 523384c07f267f713757"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,wBAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.c423efaf7696a83d1404.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/v-chart-plugin-demo/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 523384c07f267f713757"],"sourceRoot":""}
\ No newline at end of file
diff --git a/src/assets/data/sales.js b/src/assets/data/sales.js
index e120c59..ff21abd 100644
--- a/src/assets/data/sales.js
+++ b/src/assets/data/sales.js
@@ -4,74 +4,96 @@ export default [
month: 'Jan',
year: 2018,
total: 475,
+ forecast: 500,
+ yoy: 1.05,
actual: true,
},
{
month: 'Feb',
year: 2018,
total: 515,
+ forecast: 525,
+ yoy: 1.03,
actual: true,
},
{
month: 'Mar',
year: 2018,
total: 390,
+ forecast: 480,
+ yoy: .95,
actual: true,
},
{
month: 'Apr',
year: 2018,
total: 430,
+ forecast: 440,
+ yoy: .80,
actual: true,
},
{
month: 'May',
year: 2018,
total: 510,
+ forecast: 500,
+ yoy: .70,
actual: true,
},
{
month: 'Jun',
year: 2018,
total: 399,
+ forecast: 450,
+ yoy: .75,
actual: true,
},
{
month: 'Jul',
year: 2018,
total: 601,
+ forecast: 550,
+ yoy: 1.00,
actual: true,
},
{
month: 'Aug',
year: 2018,
total: 496,
+ forecast: 480,
+ yoy: 1.15,
actual: true,
},
{
month: 'Sep',
year: 2018,
total: 379,
+ forecast: 440,
+ yoy: 1.10,
actual: true,
},
{
month: 'Oct',
year: 2018,
total: 410,
+ forecast: 430,
+ yoy: .85,
actual: false,
},
{
month: 'Nov',
year: 2018,
total: 490,
+ forecast: 500,
+ yoy: .95,
actual: false,
},
{
month: 'Dec',
year: 2018,
total: 610,
+ forecast: 625,
+ yoy: 1.01,
actual: false,
},
-
-
];
diff --git a/src/components/chartExample.vue b/src/components/chartExample.vue
index baa2f65..c31654a 100644
--- a/src/components/chartExample.vue
+++ b/src/components/chartExample.vue
@@ -66,7 +66,7 @@ export default {
title: "Area Chart",
width: 300,
height: 200,
- metric: "total",
+ metric: ["total"],
dim: "month",
data: sales,
legends: {
@@ -97,7 +97,7 @@ export default {
width: 600,
subtitle: "Sales by month",
height: 200,
- metric: "total",
+ metric: ["total", "forecast"],
dim: "month",
data: sales,
legends: {
diff --git a/src/import/lineGraph.js b/src/import/lineGraph.js
index 5e219e9..895c807 100644
--- a/src/import/lineGraph.js
+++ b/src/import/lineGraph.js
@@ -28,7 +28,7 @@ const lineGraph = function chart(mode) {
*/
let cs = {
palette: {
- lineFill: '#ffcdcd',
+ lineFill: ['#ffcdcd', '#005792'],
pointFill: '#005792',
pointStroke: '#d1f4fa',
},
@@ -50,27 +50,28 @@ const lineGraph = function chart(mode) {
* @param {Object} points (svg element)
*/
const enter = (points, path) => {
- if (mode === 'init')
- path.enter()
- .append('path')
- .attr('d', cs.lineFunction(this.ds))
+ this.metric.forEach( (e, i) => {
+ path[i].enter().append('path')
+ .attr('d', cs.lineFunction[i](this.ds))
.attr('fill', 'none')
- .attr('stroke', cs.palette.lineFill)
- .attr('stroke-width', 3);
-
- points.enter()
- .append('circle')
- .attr('class', this.selector)
- .attr('r', 2)
- .on('mouseover', (d) => {
- this.addTooltip(d, window.event);
- })
- .on('mouseout', (d) => {
- this.removeTooltip(d);
- })
- .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
- .attr('cy', d => cs.y.scale(d.metric));
- return points;
+ .attr('id', 'p' + i)
+ .attr('stroke', cs.palette.lineFill[i])
+ .attr('stroke-width', 3)
+ })
+
+ // points.enter()
+ // .append('circle')
+ // .attr('class', this.selector)
+ // .attr('r', 2)
+ // .on('mouseover', (d) => {
+ // this.addTooltip(d, window.event);
+ // })
+ // .on('mouseout', (d) => {
+ // this.removeTooltip(d);
+ // })
+ // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
+ // .attr('cy', d => cs.y.scale(d.metric[0]));
+ // return points;
};
/**
* Runs when a value of an element in dataset is changed
@@ -79,15 +80,17 @@ const lineGraph = function chart(mode) {
* @param {Object} points (svg element)
*/
const transition = (points, path) => {
- path.transition()
- .attr('d', cs.lineFunction(this.ds));
-
- points.transition()
- .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
- .attr('cy', d => cs.y.scale(d.metric))
- .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
- .attr('cy', d => cs.y.scale(d.metric));
- return points;
+ this.metric.forEach( (e, i) => {
+ path[i].transition()
+ .attr('d', cs.lineFunction[i](this.ds));
+ })
+
+ // points.transition()
+ // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
+ // .attr('cy', d => cs.y.scale(d.metric[0]))
+ // .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
+ // .attr('cy', d => cs.y.scale(d.metric[0]));
+ // return points;
};
/**
@@ -98,7 +101,9 @@ const lineGraph = function chart(mode) {
*/
const exit = (points, path) => {
points.exit().remove();
- path.exit().remove();
+ this.metric.forEach( (e, i) => {
+ path[i].exit().remove();
+ })
return points;
};
@@ -107,11 +112,10 @@ const lineGraph = function chart(mode) {
* @member buildScales
* @function
*/
- const buildScales = () => {
+ const buildScales = cs => {
cs.y.scale = d3.scaleLinear()
.domain([this.min, this.max])
.range([this.displayHeight - cs.x.axisHeight, this.header]);
- cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);
this.ds.forEach(t => cs.x.domain.push(t.dim));
this.ds.forEach((t, i) => cs.x.range.push(((this.width * i) - this.header) / this.ds.length));
cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);
@@ -121,20 +125,33 @@ const lineGraph = function chart(mode) {
* @member drawAxis
* @function
*/
- const drawAxis = () => {
+ const drawAxis = cs => {
cs.x.axis = d3.axisBottom().scale(cs.x.scale);
cs.x.xOffset = cs.y.axisWidth + 5;
cs.x.yOffset = this.displayHeight - cs.x.axisHeight;
+ cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);
cs.y.xOffset = cs.y.axisWidth;
cs.y.yOffset = 0;
+ svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)
+ .call(cs.x.axis);
+ svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)
+ .call(cs.y.axis);
};
- cs.lineFunction = d3.line()
- .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
- .y(d => cs.y.scale(d.metric));
-
+ cs.lineFunction = [];
+ this.metric.forEach( (e, i) => {
+ cs.lineFunction.push(
+ d3.line()
+ .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
+ .y(d => cs.y.scale(d.metric[i]))
+ )
+ });
+
const points = svgContainer.selectAll('circle').data(this.ds);
- const path = svgContainer.selectAll('path').data(this.ds);
+ const path = []
+ this.metric.forEach( (e, i) => {
+ path.push(svgContainer.selectAll('path#p' + i).data(this.ds))
+ })
cs = this.setOverrides(cs, this.chartData.overrides);
@@ -144,11 +161,6 @@ const lineGraph = function chart(mode) {
transition(points, path);
exit(points, path);
- svgContainer.append('g').append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)
- .call(cs.x.axis);
- svgContainer.append('g').append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)
- .call(cs.y.axis);
-
return cs;
};
diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js
index f25b8ed..e532173 100644
--- a/src/v-chart-plugin.js
+++ b/src/v-chart-plugin.js
@@ -146,25 +146,29 @@ const Chart = {
*/
generateLegend(cs) {
if (this.chartData.legends && this.chartData.legends.enabled === true) {
- d3.select(`#${this.chartData.selector}`)
+ cs.palette.lineFill = (Array.isArray(cs.palette.lineFill)) ? cs.palette.lineFill : new Array(cs.palette.lineFill);
+ cs.palette.fill = (Array.isArray(cs.palette.fill)) ? cs.palette.fill : new Array(cs.palette.fill);
+ this.metric.forEach( (e, i) => {
+ d3.select(`#${this.chartData.selector}`)
.append('text')
.attr('x', this.width - 60)
- .attr('y', this.height * 0.95)
+ .attr('y', this.height * 0.95 - (i * 15))
.style('text-anchor', 'middle')
- .text(this.chartData.metric);
+ .text(this.metric[i]);
d3.select(`#${this.chartData.selector}`)
.append("g")
.attr("class", "legends")
.append("rect")
.attr('x', this.width - 30)
- .attr('y', this.height * 0.95 - 10)
+ .attr('y', this.height * 0.95 - (i * 15) - 10)
.attr("width", 30)
.attr("height", 10)
.style("fill", function () {
- const fill = cs.palette.lineFill || cs.palette.fill;
+ const fill = cs.palette.lineFill[i] || cs.palette.fill[i];
return fill;
});
+ })
}
},
@@ -182,13 +186,35 @@ const Chart = {
* @returns {Object} normalized dataset
*/
ds() {
- return this.chartData.data.map((d) => {
- const td = {};
- td.metric = this.chartData.metric ? d[this.chartData.metric] : d;
+ //TODO add in support for arrays with undefined metric
+ const ds = { metric: [] };
+ if (!Array.isArray(this.chartData.metric)){
+ ds.metric.push(this.chartData.metric);
+ } else {
+ ds.metric = this.chartData.metric;
+ }
+ ds.dim = this.chartData.dim;
+ ds.data = this.chartData.data;
+
+ return ds.data.map((d) => {
+ const td = {
+ metric: []
+ };
+ ds.metric.forEach(function(e, i){
+ td.metric[i] = d[e] || 0;
+ })
td.dim = this.chartData.dim ? d[this.chartData.dim] : null;
return td;
});
},
+ /**
+ * Metric getter function
+ * @memberOf Chart
+ * @returns {array} Metrics
+ */
+ metric() {
+ return (Array.isArray(this.chartData.metric)) ? this.chartData.metric : new Array(this.chartData.metric);
+ },
/**
* Height getter function
* @memberOf Chart
@@ -212,8 +238,12 @@ const Chart = {
*/
max() {
let max = 0;
- this.ds.forEach((e) => {
- max = max > e.metric ? max : e.metric;
+ var results = [];
+ this.ds.forEach(e => {
+ results = results.concat([...e.metric]);
+ });
+ results.forEach((e) => {
+ max = max > e ? max : e;
});
return max;
},
@@ -223,16 +253,12 @@ const Chart = {
* @returns {number} Min value for metric
*/
min() {
- return Math.min(...this.ds.map(o => o.metric));
- },
- /**
- * Gets the height of the title
- * @memberOf Chart
- * @returns {number} Height of the chart title
- */
- titleHeight() {
- if (this.chartData.title) return this.chartData.textHeight || 25;
- return 0;
+ let max = 0;
+ var results = [];
+ this.ds.forEach(e => {
+ results = results.concat([...e.metric]);
+ });
+ return Math.min(...results.map(o => o));
},
/**
* Gets the height of the dispaly area
@@ -246,6 +272,15 @@ const Chart = {
return this.height;
}
},
+ /**
+ * Gets the height of the title
+ * @memberOf Chart
+ * @returns {number} Height of the chart title
+ */
+ titleHeight() {
+ if (this.chartData.title) return this.chartData.textHeight || 25;
+ return 0;
+ },
/**
* Gets the subtitle height
* @memberOf Chart
diff --git a/test/unit/coverage/lcov.info b/test/unit/coverage/lcov.info
index f02e11e..d0f48f1 100644
--- a/test/unit/coverage/lcov.info
+++ b/test/unit/coverage/lcov.info
@@ -1,72 +1,93 @@
TN:
SF:/Users/briangreig/workspace/http/v-chart-plugin/src/v-chart-plugin.js
FN:153,(anonymous_0)
-FN:174,(anonymous_1)
-FN:204,(anonymous_2)
-FN:215,(anonymous_3)
-FNF:4
-FNH:3
+FN:184,(anonymous_1)
+FN:188,(anonymous_2)
+FN:227,(anonymous_3)
+FN:230,(anonymous_4)
+FN:243,(anonymous_5)
+FN:246,(anonymous_6)
+FNF:7
+FNH:6
FNDA:0,(anonymous_0)
-FNDA:12,(anonymous_1)
+FNDA:10,(anonymous_1)
FNDA:10,(anonymous_2)
-FNDA:4,(anonymous_3)
+FNDA:8,(anonymous_3)
+FNDA:8,(anonymous_4)
+FNDA:2,(anonymous_5)
+FNDA:2,(anonymous_6)
DA:17,1
DA:25,1
DA:27,1
DA:30,6
DA:40,6
-DA:41,6
-DA:42,6
+DA:41,5
+DA:42,5
DA:49,0
DA:50,0
DA:57,0
DA:64,0
-DA:71,6
-DA:78,6
+DA:71,5
+DA:78,5
DA:92,0
DA:101,0
DA:115,0
-DA:125,6
-DA:126,6
-DA:127,6
-DA:128,19
-DA:129,6
-DA:137,6
+DA:125,5
+DA:126,5
+DA:127,5
+DA:128,15
+DA:129,5
+DA:137,5
DA:138,0
DA:145,0
DA:154,0
DA:155,0
-DA:174,6
-DA:175,12
-DA:176,12
-DA:177,12
-DA:178,12
-DA:187,6
-DA:195,6
-DA:203,5
-DA:204,5
-DA:205,10
-DA:207,5
-DA:215,4
-DA:223,6
-DA:224,0
-DA:232,5
-DA:233,0
-DA:235,5
-DA:244,6
-DA:245,6
-DA:253,5
-DA:257,6
-DA:262,0
-DA:275,1
-DA:276,0
-LF:50
-LH:35
-BRDA:125,0,0,6
-BRDA:125,0,1,6
+DA:175,5
+DA:176,5
+DA:177,5
+DA:179,0
+DA:181,5
+DA:182,5
+DA:184,5
+DA:185,10
+DA:188,10
+DA:189,10
+DA:191,10
+DA:192,10
+DA:201,1
+DA:209,6
+DA:217,6
+DA:225,4
+DA:226,4
+DA:227,4
+DA:228,8
+DA:230,4
+DA:231,8
+DA:233,4
+DA:241,1
+DA:242,1
+DA:243,1
+DA:244,2
+DA:246,2
+DA:254,4
+DA:255,0
+DA:257,4
+DA:266,5
+DA:267,0
+DA:275,5
+DA:276,5
+DA:284,4
+DA:288,6
+DA:293,0
+DA:306,1
+DA:307,0
+LF:65
+LH:49
+BRDA:125,0,0,5
+BRDA:125,0,1,5
BRDA:137,1,0,0
-BRDA:137,1,1,6
-BRDA:137,2,0,6
+BRDA:137,1,1,5
+BRDA:137,2,0,5
BRDA:137,2,1,0
BRDA:154,3,0,0
BRDA:154,3,1,0
@@ -82,34 +103,36 @@ BRDA:164,8,0,1
BRDA:164,8,1,1
BRDA:165,9,0,1
BRDA:165,9,1,1
-BRDA:176,10,0,0
-BRDA:176,10,1,12
-BRDA:177,11,0,0
-BRDA:177,11,1,12
-BRDA:187,12,0,6
-BRDA:187,12,1,0
-BRDA:195,13,0,6
-BRDA:195,13,1,0
-BRDA:205,14,0,0
-BRDA:205,14,1,10
-BRDA:223,15,0,6
-BRDA:223,15,1,0
-BRDA:223,16,0,6
-BRDA:223,16,1,6
-BRDA:232,17,0,0
-BRDA:232,17,1,5
-BRDA:232,18,0,5
-BRDA:232,18,1,0
-BRDA:244,19,0,0
-BRDA:244,19,1,6
-BRDA:244,20,0,0
-BRDA:244,20,1,0
+BRDA:176,10,0,5
+BRDA:176,10,1,0
+BRDA:189,11,0,10
+BRDA:189,11,1,10
+BRDA:191,12,0,0
+BRDA:191,12,1,10
+BRDA:209,13,0,6
+BRDA:209,13,1,0
+BRDA:217,14,0,6
+BRDA:217,14,1,0
+BRDA:231,15,0,0
+BRDA:231,15,1,8
+BRDA:254,16,0,0
+BRDA:254,16,1,4
+BRDA:254,17,0,4
+BRDA:254,17,1,0
+BRDA:266,18,0,5
+BRDA:266,18,1,0
+BRDA:266,19,0,5
+BRDA:266,19,1,5
+BRDA:275,20,0,0
+BRDA:275,20,1,5
BRDA:275,21,0,0
-BRDA:275,21,1,1
-BRDA:275,22,0,1
-BRDA:275,22,1,1
-BRF:46
-BRH:30
+BRDA:275,21,1,0
+BRDA:306,22,0,0
+BRDA:306,22,1,1
+BRDA:306,23,0,1
+BRDA:306,23,1,1
+BRF:48
+BRH:32
end_of_record
TN:
SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/barChart.js
@@ -287,99 +310,85 @@ TN:
SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/lineGraph.js
FN:19,chart
FN:52,(anonymous_1)
-FN:65,(anonymous_2)
-FN:68,(anonymous_3)
-FN:71,(anonymous_4)
-FN:72,(anonymous_5)
-FN:81,(anonymous_6)
-FN:86,(anonymous_7)
-FN:87,(anonymous_8)
-FN:88,(anonymous_9)
-FN:89,(anonymous_10)
-FN:99,(anonymous_11)
-FN:110,(anonymous_12)
-FN:115,(anonymous_13)
-FN:116,(anonymous_14)
-FN:124,(anonymous_15)
-FN:133,(anonymous_16)
-FN:134,(anonymous_17)
-FNF:18
-FNH:10
+FN:53,(anonymous_2)
+FN:82,(anonymous_3)
+FN:83,(anonymous_4)
+FN:102,(anonymous_5)
+FN:104,(anonymous_6)
+FN:115,(anonymous_7)
+FN:119,(anonymous_8)
+FN:120,(anonymous_9)
+FN:128,(anonymous_10)
+FN:142,(anonymous_11)
+FN:145,(anonymous_12)
+FN:146,(anonymous_13)
+FN:152,(anonymous_14)
+FNF:15
+FNH:1
FNDA:1,chart
-FNDA:1,(anonymous_1)
+FNDA:0,(anonymous_1)
FNDA:0,(anonymous_2)
FNDA:0,(anonymous_3)
FNDA:0,(anonymous_4)
FNDA:0,(anonymous_5)
-FNDA:1,(anonymous_6)
+FNDA:0,(anonymous_6)
FNDA:0,(anonymous_7)
FNDA:0,(anonymous_8)
FNDA:0,(anonymous_9)
FNDA:0,(anonymous_10)
-FNDA:1,(anonymous_11)
-FNDA:1,(anonymous_12)
-FNDA:2,(anonymous_13)
-FNDA:2,(anonymous_14)
-FNDA:1,(anonymous_15)
-FNDA:4,(anonymous_16)
-FNDA:4,(anonymous_17)
+FNDA:0,(anonymous_11)
+FNDA:0,(anonymous_12)
+FNDA:0,(anonymous_13)
+FNDA:0,(anonymous_14)
DA:9,1
DA:19,1
DA:24,1
DA:29,1
DA:52,1
-DA:53,1
-DA:54,1
-DA:61,1
-DA:66,0
-DA:69,0
-DA:71,0
-DA:72,0
-DA:73,1
-DA:81,1
+DA:53,0
+DA:54,0
DA:82,1
-DA:85,1
-DA:86,0
-DA:87,0
-DA:88,0
-DA:89,0
-DA:90,1
-DA:99,1
-DA:100,1
-DA:101,1
+DA:83,0
+DA:84,0
DA:102,1
-DA:110,1
-DA:111,1
-DA:114,1
-DA:115,2
-DA:116,2
-DA:117,1
-DA:124,1
-DA:125,1
-DA:126,1
-DA:127,1
+DA:103,0
+DA:104,0
+DA:105,0
+DA:107,0
+DA:115,1
+DA:116,0
+DA:119,0
+DA:120,0
+DA:121,0
DA:128,1
-DA:129,1
-DA:132,1
-DA:133,4
-DA:134,4
-DA:136,1
-DA:137,1
-DA:139,1
+DA:129,0
+DA:130,0
+DA:131,0
+DA:132,0
+DA:133,0
+DA:134,0
+DA:135,0
+DA:137,0
DA:141,1
DA:142,1
-DA:143,1
-DA:144,1
-DA:145,1
-DA:147,1
-DA:149,1
-DA:152,1
-LF:51
-LH:43
-BRDA:53,0,0,1
-BRDA:53,0,1,0
-BRF:2
-BRH:1
+DA:143,0
+DA:145,0
+DA:146,0
+DA:150,0
+DA:151,0
+DA:152,0
+DA:153,0
+DA:156,0
+DA:158,0
+DA:159,0
+DA:160,0
+DA:161,0
+DA:162,0
+DA:164,0
+LF:45
+LH:11
+BRF:0
+BRH:0
end_of_record
TN:
SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/scatterPlot.js