From 201f009fad08166695688c1ee126724c3c0da584 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Mon, 5 Nov 2018 23:10:02 -0500 Subject: [PATCH 01/10] modified configuration to allow for multiple metrics --- src/assets/data/sales.js | 14 ++++++++++++-- src/components/chartExample.vue | 2 +- src/v-chart-plugin.js | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/assets/data/sales.js b/src/assets/data/sales.js index e120c59..0195504 100644 --- a/src/assets/data/sales.js +++ b/src/assets/data/sales.js @@ -4,74 +4,84 @@ export default [ month: 'Jan', year: 2018, total: 475, + yoy: 1.05, actual: true, }, { month: 'Feb', year: 2018, total: 515, + yoy: 1.03, actual: true, }, { month: 'Mar', year: 2018, total: 390, + yoy: .95, actual: true, }, { month: 'Apr', year: 2018, total: 430, + yoy: .80, actual: true, }, { month: 'May', year: 2018, total: 510, + yoy: .70, actual: true, }, { month: 'Jun', year: 2018, total: 399, + yoy: .75, actual: true, }, { month: 'Jul', year: 2018, total: 601, + yoy: 1.00, actual: true, }, { month: 'Aug', year: 2018, total: 496, + yoy: 1.15, actual: true, }, { month: 'Sep', year: 2018, total: 379, + yoy: 1.10, actual: true, }, { month: 'Oct', year: 2018, total: 410, + yoy: .85, actual: false, }, { month: 'Nov', year: 2018, total: 490, + yoy: .95, actual: false, }, { month: 'Dec', year: 2018, total: 610, + yoy: 1.01, actual: false, }, - - ]; diff --git a/src/components/chartExample.vue b/src/components/chartExample.vue index baa2f65..5b25afd 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: ["yoy"], dim: "month", data: sales, legends: { diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index 1e4e15e..b9201c9 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -172,8 +172,18 @@ const Chart = { */ ds() { return this.chartData.data.map((d) => { - const td = {}; - td.metric = this.chartData.metric ? d[this.chartData.metric] : d; + const td = { + metric: [], + }; + if (!this.chartData.metric) { + td.metric.push(d); + } else { + if (!Array.isArray(this.chartData.metric)){ + td.metric.push(d[this.chartData.metric]); + } else { + td.metric.push(d[this.chartData.metric[0]]); + } + } td.dim = this.chartData.dim ? d[this.chartData.dim] : null; return td; }); From 14d707c9cac8f95c92399c9fbc6155fd88c25902 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Thu, 8 Nov 2018 23:29:54 -0500 Subject: [PATCH 02/10] support multiple variables --- src/assets/data/sales.js | 12 ++++++++++++ src/components/chartExample.vue | 4 ++-- src/import/lineGraph.js | 7 +++---- src/v-chart-plugin.js | 26 +++++++++++++++----------- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/assets/data/sales.js b/src/assets/data/sales.js index 0195504..ff21abd 100644 --- a/src/assets/data/sales.js +++ b/src/assets/data/sales.js @@ -4,6 +4,7 @@ export default [ month: 'Jan', year: 2018, total: 475, + forecast: 500, yoy: 1.05, actual: true, }, @@ -11,6 +12,7 @@ export default [ month: 'Feb', year: 2018, total: 515, + forecast: 525, yoy: 1.03, actual: true, }, @@ -18,6 +20,7 @@ export default [ month: 'Mar', year: 2018, total: 390, + forecast: 480, yoy: .95, actual: true, }, @@ -25,6 +28,7 @@ export default [ month: 'Apr', year: 2018, total: 430, + forecast: 440, yoy: .80, actual: true, }, @@ -32,6 +36,7 @@ export default [ month: 'May', year: 2018, total: 510, + forecast: 500, yoy: .70, actual: true, }, @@ -39,6 +44,7 @@ export default [ month: 'Jun', year: 2018, total: 399, + forecast: 450, yoy: .75, actual: true, }, @@ -46,6 +52,7 @@ export default [ month: 'Jul', year: 2018, total: 601, + forecast: 550, yoy: 1.00, actual: true, }, @@ -53,6 +60,7 @@ export default [ month: 'Aug', year: 2018, total: 496, + forecast: 480, yoy: 1.15, actual: true, }, @@ -60,6 +68,7 @@ export default [ month: 'Sep', year: 2018, total: 379, + forecast: 440, yoy: 1.10, actual: true, }, @@ -67,6 +76,7 @@ export default [ month: 'Oct', year: 2018, total: 410, + forecast: 430, yoy: .85, actual: false, }, @@ -74,6 +84,7 @@ export default [ month: 'Nov', year: 2018, total: 490, + forecast: 500, yoy: .95, actual: false, }, @@ -81,6 +92,7 @@ export default [ 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 5b25afd..398c3e5 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: ["yoy"], + metric: ["total"], dim: "month", data: sales, legends: { @@ -97,7 +97,7 @@ export default { width: 600, subtitle: "Sales by month", height: 200, - metric: "total", + metric: ["yoy", "total"], dim: "month", data: sales, legends: { diff --git a/src/import/lineGraph.js b/src/import/lineGraph.js index 5e219e9..8aeb5a0 100644 --- a/src/import/lineGraph.js +++ b/src/import/lineGraph.js @@ -51,13 +51,12 @@ const lineGraph = function chart(mode) { */ const enter = (points, path) => { if (mode === 'init') - path.enter() + path.enter() .append('path') - .attr('d', cs.lineFunction(this.ds)) + .attr('d', cs.lineFunction) .attr('fill', 'none') .attr('stroke', cs.palette.lineFill) .attr('stroke-width', 3); - points.enter() .append('circle') .attr('class', this.selector) @@ -131,7 +130,7 @@ const lineGraph = function chart(mode) { cs.lineFunction = d3.line() .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .y(d => cs.y.scale(d.metric)); + .y(d => cs.y.scale(d.metric[0])); const points = svgContainer.selectAll('circle').data(this.ds); const path = svgContainer.selectAll('path').data(this.ds); diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index b9201c9..2bf3a5c 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -171,19 +171,23 @@ const Chart = { * @returns {Object} normalized dataset */ ds() { - return this.chartData.data.map((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: [], + metric: [] }; - if (!this.chartData.metric) { - td.metric.push(d); - } else { - if (!Array.isArray(this.chartData.metric)){ - td.metric.push(d[this.chartData.metric]); - } else { - td.metric.push(d[this.chartData.metric[0]]); - } - } + ds.metric.forEach(function(e, i){ + td.metric[i] = d[e]; + }) td.dim = this.chartData.dim ? d[this.chartData.dim] : null; return td; }); From ef0185ed684127adc783ef223e6e8afab18b0157 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Fri, 9 Nov 2018 23:13:22 -0500 Subject: [PATCH 03/10] line chart support for multi variable --- src/import/lineGraph.js | 15 +++++++++------ src/v-chart-plugin.js | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/import/lineGraph.js b/src/import/lineGraph.js index 8aeb5a0..b897fc7 100644 --- a/src/import/lineGraph.js +++ b/src/import/lineGraph.js @@ -50,13 +50,13 @@ const lineGraph = function chart(mode) { * @param {Object} points (svg element) */ const enter = (points, path) => { - if (mode === 'init') - path.enter() + path.enter() .append('path') .attr('d', cs.lineFunction) .attr('fill', 'none') .attr('stroke', cs.palette.lineFill) .attr('stroke-width', 3); + points.enter() .append('circle') .attr('class', this.selector) @@ -68,7 +68,7 @@ const lineGraph = function chart(mode) { this.removeTooltip(d); }) .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .attr('cy', d => cs.y.scale(d.metric)); + .attr('cy', d => cs.y.scale(d.metric[0])); return points; }; /** @@ -83,9 +83,9 @@ const lineGraph = function chart(mode) { points.transition() .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .attr('cy', d => cs.y.scale(d.metric)) + .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)); + .attr('cy', d => cs.y.scale(d.metric[0])); return points; }; @@ -129,7 +129,10 @@ const lineGraph = function chart(mode) { }; cs.lineFunction = d3.line() - .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) + .x(d => { + cs.x.scale(d.dim) + cs.y.axisWidth + 5; + console.log(cs.x.scale(d.dim) + cs.y.axisWidth + 5); + }) .y(d => cs.y.scale(d.metric[0])); const points = svgContainer.selectAll('circle').data(this.ds); diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index 2bf3a5c..ca1a97f 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -216,7 +216,7 @@ const Chart = { max() { let max = 0; this.ds.forEach((e) => { - max = max > e.metric ? max : e.metric; + max = max > e.metric[0] ? max : e.metric[0]; }); return max; }, @@ -226,7 +226,7 @@ const Chart = { * @returns {number} Min value for metric */ min() { - return Math.min(...this.ds.map(o => o.metric)); + return Math.min(...this.ds.map(o => o.metric[0])); }, /** * Gets the height of the title From 5f50153fa8d2075e57e9dcdf757ba89346ce7682 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Fri, 9 Nov 2018 23:24:31 -0500 Subject: [PATCH 04/10] multi-variate support for line charts --- src/import/lineGraph.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/import/lineGraph.js b/src/import/lineGraph.js index b897fc7..2f1e363 100644 --- a/src/import/lineGraph.js +++ b/src/import/lineGraph.js @@ -52,7 +52,7 @@ const lineGraph = function chart(mode) { const enter = (points, path) => { path.enter() .append('path') - .attr('d', cs.lineFunction) + .attr('d', cs.lineFunction(this.ds)) .attr('fill', 'none') .attr('stroke', cs.palette.lineFill) .attr('stroke-width', 3); @@ -129,10 +129,7 @@ const lineGraph = function chart(mode) { }; cs.lineFunction = d3.line() - .x(d => { - cs.x.scale(d.dim) + cs.y.axisWidth + 5; - console.log(cs.x.scale(d.dim) + cs.y.axisWidth + 5); - }) + .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) .y(d => cs.y.scale(d.metric[0])); const points = svgContainer.selectAll('circle').data(this.ds); From 3af38a6f1c7c31169eca687fa080b6be5a5c594b Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Fri, 9 Nov 2018 23:49:48 -0500 Subject: [PATCH 05/10] update readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e44251d..9c73001 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ![logo](https://user-images.githubusercontent.com/5210420/46899802-2d7db800-ce66-11e8-896c-115ce3dcfb98.png) > A plugin for adding charts to Vue +![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. @@ -108,9 +110,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. From d0f5daefb59963d36cbe2c9881d371a7b49d58c4 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Sat, 10 Nov 2018 22:24:53 -0500 Subject: [PATCH 06/10] iterate through all datapoints on line graph --- src/components/chartExample.vue | 2 +- src/import/lineGraph.js | 84 +++++++++++++++++++-------------- src/v-chart-plugin.js | 10 +++- 3 files changed, 59 insertions(+), 37 deletions(-) diff --git a/src/components/chartExample.vue b/src/components/chartExample.vue index 398c3e5..ca91924 100644 --- a/src/components/chartExample.vue +++ b/src/components/chartExample.vue @@ -97,7 +97,7 @@ export default { width: 600, subtitle: "Sales by month", height: 200, - metric: ["yoy", "total"], + metric: ["forecast", "total"], dim: "month", data: sales, legends: { diff --git a/src/import/lineGraph.js b/src/import/lineGraph.js index 2f1e363..d6aa8a6 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,26 +50,28 @@ const lineGraph = function chart(mode) { * @param {Object} points (svg element) */ const enter = (points, path) => { - 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[0])); - 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 @@ -78,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[0])) - .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .attr('cy', d => cs.y.scale(d.metric[0])); - 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; }; /** @@ -97,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; }; @@ -128,12 +134,20 @@ const lineGraph = function chart(mode) { cs.y.yOffset = 0; }; - cs.lineFunction = d3.line() - .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .y(d => cs.y.scale(d.metric[0])); - + 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); diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index ca1a97f..fde95df 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -186,12 +186,20 @@ const Chart = { metric: [] }; ds.metric.forEach(function(e, i){ - td.metric[i] = d[e]; + 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 this.chartData.metric; + }, /** * Height getter function * @memberOf Chart From 722924881e4f6f0bcc57df68a9b138f5faf02a35 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Sun, 11 Nov 2018 17:01:55 -0500 Subject: [PATCH 07/10] updated max function for multiple variables --- src/components/chartExample.vue | 2 +- src/import/lineGraph.js | 15 +++++++-------- src/v-chart-plugin.js | 26 +++++++++++++++----------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/components/chartExample.vue b/src/components/chartExample.vue index ca91924..c31654a 100644 --- a/src/components/chartExample.vue +++ b/src/components/chartExample.vue @@ -97,7 +97,7 @@ export default { width: 600, subtitle: "Sales by month", height: 200, - metric: ["forecast", "total"], + metric: ["total", "forecast"], dim: "month", data: sales, legends: { diff --git a/src/import/lineGraph.js b/src/import/lineGraph.js index d6aa8a6..895c807 100644 --- a/src/import/lineGraph.js +++ b/src/import/lineGraph.js @@ -112,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); @@ -126,12 +125,17 @@ 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 = []; @@ -157,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 fde95df..8f91ca1 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -223,8 +223,12 @@ const Chart = { */ max() { let max = 0; - this.ds.forEach((e) => { - max = max > e.metric[0] ? max : e.metric[0]; + var results = []; + this.ds.forEach(e => { + results = results.concat([...e.metric]); + }); + results.forEach((e) => { + max = max > e ? max : e; }); return max; }, @@ -236,15 +240,6 @@ const Chart = { min() { return Math.min(...this.ds.map(o => o.metric[0])); }, - /** - * 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 height of the dispaly area * @memberOf Chart @@ -257,6 +252,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 From 7e80c5d223903c9b461b27e79fcb747d5147ffa3 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Mon, 12 Nov 2018 09:48:07 -0500 Subject: [PATCH 08/10] multivariate charting - line charts --- dist/index.html | 2 +- dist/module/assets/data/sales.js | 24 + dist/module/import/lineGraph.js | 80 +- dist/module/v-chart-plugin.js | 66 +- dist/static/js/app.d0cfa1f5b8fb363d2216.js | 2 + .../static/js/app.d0cfa1f5b8fb363d2216.js.map | 1 + dist/static/js/app.fa53c39ff82bc0000f0f.js | 2 - .../static/js/app.fa53c39ff82bc0000f0f.js.map | 1 - .../js/manifest.c423efaf7696a83d1404.js.map | 2 +- package.json | 2 +- src/v-chart-plugin.js | 9 +- test/unit/coverage/lcov-report/base.css | 213 ++ test/unit/coverage/lcov-report/index.html | 132 + test/unit/coverage/lcov-report/prettify.css | 1 + test/unit/coverage/lcov-report/prettify.js | 1 + .../lcov-report/sort-arrow-sprite.png | Bin 0 -> 209 bytes test/unit/coverage/lcov-report/sorter.js | 158 ++ .../coverage/lcov-report/src/App.vue.html | 146 + .../lcov-report/src/assets/data/index.html | 106 + .../lcov-report/src/assets/data/pop.js.html | 2498 +++++++++++++++++ .../lcov-report/src/assets/data/sales.js.html | 362 +++ .../src/components/chartExample.vue.html | 554 ++++ .../lcov-report/src/components/index.html | 93 + .../lcov-report/src/import/areaChart.js.html | 488 ++++ .../lcov-report/src/import/barChart.js.html | 653 +++++ .../lcov-report/src/import/index.html | 158 ++ .../lcov-report/src/import/lineGraph.js.html | 566 ++++ .../lcov-report/src/import/pieChart.js.html | 455 +++ .../src/import/scatterPlot.js.html | 443 +++ .../lcov-report/src/import/vBarChart.js.html | 635 +++++ test/unit/coverage/lcov-report/src/index.html | 106 + .../lcov-report/src/v-chart-plugin.js.html | 986 +++++++ test/unit/coverage/lcov.info | 305 +- 33 files changed, 9042 insertions(+), 208 deletions(-) create mode 100644 dist/static/js/app.d0cfa1f5b8fb363d2216.js create mode 100644 dist/static/js/app.d0cfa1f5b8fb363d2216.js.map delete mode 100644 dist/static/js/app.fa53c39ff82bc0000f0f.js delete mode 100644 dist/static/js/app.fa53c39ff82bc0000f0f.js.map create mode 100644 test/unit/coverage/lcov-report/base.css create mode 100644 test/unit/coverage/lcov-report/index.html create mode 100644 test/unit/coverage/lcov-report/prettify.css create mode 100644 test/unit/coverage/lcov-report/prettify.js create mode 100644 test/unit/coverage/lcov-report/sort-arrow-sprite.png create mode 100644 test/unit/coverage/lcov-report/sorter.js create mode 100644 test/unit/coverage/lcov-report/src/App.vue.html create mode 100644 test/unit/coverage/lcov-report/src/assets/data/index.html create mode 100644 test/unit/coverage/lcov-report/src/assets/data/pop.js.html create mode 100644 test/unit/coverage/lcov-report/src/assets/data/sales.js.html create mode 100644 test/unit/coverage/lcov-report/src/components/chartExample.vue.html create mode 100644 test/unit/coverage/lcov-report/src/components/index.html create mode 100644 test/unit/coverage/lcov-report/src/import/areaChart.js.html create mode 100644 test/unit/coverage/lcov-report/src/import/barChart.js.html create mode 100644 test/unit/coverage/lcov-report/src/import/index.html create mode 100644 test/unit/coverage/lcov-report/src/import/lineGraph.js.html create mode 100644 test/unit/coverage/lcov-report/src/import/pieChart.js.html create mode 100644 test/unit/coverage/lcov-report/src/import/scatterPlot.js.html create mode 100644 test/unit/coverage/lcov-report/src/import/vBarChart.js.html create mode 100644 test/unit/coverage/lcov-report/src/index.html create mode 100644 test/unit/coverage/lcov-report/src/v-chart-plugin.js.html 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,EA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,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// 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// 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,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Q,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// 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// 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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a83d1404.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/package.json b/package.json index e586fbf..4db9f9a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "v-chart-plugin", "main": "./dist/module/v-chart-plugin.js", - "version": "0.2.14", + "version": "0.2.15", "description": "This plugin is designed to allow Vue.js developers to incorporate fully reactive and customizable charts into your applications. Uses D3.js for charting.", "keywords": [ "vue", diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index 8f91ca1..902e4a0 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -140,7 +140,7 @@ const Chart = { .attr('x', this.width - 60) .attr('y', this.height * 0.95) .style('text-anchor', 'middle') - .text(this.chartData.metric); + .text(this.chartData.metric[0]); d3.select(`#${this.chartData.selector}`) .append("g") @@ -238,7 +238,12 @@ const Chart = { * @returns {number} Min value for metric */ min() { - return Math.min(...this.ds.map(o => o.metric[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 diff --git a/test/unit/coverage/lcov-report/base.css b/test/unit/coverage/lcov-report/base.css new file mode 100644 index 0000000..29737bc --- /dev/null +++ b/test/unit/coverage/lcov-report/base.css @@ -0,0 +1,213 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.medium .chart { border:1px solid #f9cd0b; } +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } +/* light gray */ +span.cline-neutral { background: #eaeaea; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/test/unit/coverage/lcov-report/index.html b/test/unit/coverage/lcov-report/index.html new file mode 100644 index 0000000..8742d57 --- /dev/null +++ b/test/unit/coverage/lcov-report/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 73.08% + Statements + 247/338 +
+
+ 59.68% + Branches + 37/62 +
+
+ 50% + Functions + 44/88 +
+
+ 75% + Lines + 237/316 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
src/
75%51/6866.67%32/4885.71%6/775.38%49/65
src/assets/data/
100%0/0100%0/0100%0/0100%0/0
src/components/
0%0/4100%0/00%0/20%0/4
src/import/
73.68%196/26635.71%5/1448.1%38/7976.11%188/247
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/prettify.css b/test/unit/coverage/lcov-report/prettify.css new file mode 100644 index 0000000..b317a7c --- /dev/null +++ b/test/unit/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/test/unit/coverage/lcov-report/prettify.js b/test/unit/coverage/lcov-report/prettify.js new file mode 100644 index 0000000..ef51e03 --- /dev/null +++ b/test/unit/coverage/lcov-report/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/test/unit/coverage/lcov-report/sort-arrow-sprite.png b/test/unit/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..03f704a609c6fd0dbfdac63466a7d7c958b5cbf3 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/test/unit/coverage/lcov-report/src/App.vue.html b/test/unit/coverage/lcov-report/src/App.vue.html new file mode 100644 index 0000000..e58a087 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/App.vue.html @@ -0,0 +1,146 @@ + + + + Code coverage report for src/App.vue + + + + + + + +
+
+

+ all files / src/ App.vue +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
<template>
+  <div id='app'>
+    <chartExample/>
+  </div>
+</template>
+ 
+<script>
+import chartExample from './components/chartExample'
+ 
+export default {
+  name: 'App',
+  components: {
+    chartExample
+  }
+}
+</script>
+ 
+<style>
+#app {
+  font-family: 'Avenir', Helvetica, Arial, sans-serif;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+  text-align: center;
+  color: #2c3e50;
+  margin-top: 60px;
+}
+</style>
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/assets/data/index.html b/test/unit/coverage/lcov-report/src/assets/data/index.html new file mode 100644 index 0000000..89dbb68 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/assets/data/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for src/assets/data/ + + + + + + + +
+
+

+ all files src/assets/data/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
pop.js
100%0/0100%0/0100%0/0100%0/0
sales.js
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/assets/data/pop.js.html b/test/unit/coverage/lcov-report/src/assets/data/pop.js.html new file mode 100644 index 0000000..8b73b81 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/assets/data/pop.js.html @@ -0,0 +1,2498 @@ + + + + Code coverage report for src/assets/data/pop.js + + + + + + + +
+
+

+ all files / src/assets/data/ pop.js +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
 
+export default [
+  {
+    females: 1840000,
+    country: 'United States',
+    age: 0,
+    males: 1923000,
+    year: 1950,
+    total: 3763000,
+  },
+  {
+    females: 1760000,
+    country: 'United States',
+    age: 1,
+    males: 1840000,
+    year: 1950,
+    total: 3600000,
+  },
+  {
+    females: 1682000,
+    country: 'United States',
+    age: 2,
+    males: 1760000,
+    year: 1950,
+    total: 3442000,
+  },
+  {
+    females: 1607000,
+    country: 'United States',
+    age: 3,
+    males: 1682000,
+    year: 1950,
+    total: 3289000,
+  },
+  {
+    females: 1535000,
+    country: 'United States',
+    age: 4,
+    males: 1607000,
+    year: 1950,
+    total: 3142000,
+  },
+  {
+    females: 1467000,
+    country: 'United States',
+    age: 5,
+    males: 1535000,
+    year: 1950,
+    total: 3002000,
+  },
+  {
+    females: 1403000,
+    country: 'United States',
+    age: 6,
+    males: 1467000,
+    year: 1950,
+    total: 2870000,
+  },
+  {
+    females: 1343000,
+    country: 'United States',
+    age: 7,
+    males: 1404000,
+    year: 1950,
+    total: 2747000,
+  },
+  {
+    females: 1288000,
+    country: 'United States',
+    age: 8,
+    males: 1345000,
+    year: 1950,
+    total: 2634000,
+  },
+  {
+    females: 1239000,
+    country: 'United States',
+    age: 9,
+    males: 1292000,
+    year: 1950,
+    total: 2532000,
+  },
+  {
+    females: 1195000,
+    country: 'United States',
+    age: 10,
+    males: 1244000,
+    year: 1950,
+    total: 2439000,
+  },
+  {
+    females: 1156000,
+    country: 'United States',
+    age: 11,
+    males: 1200000,
+    year: 1950,
+    total: 2357000,
+  },
+  {
+    females: 1126000,
+    country: 'United States',
+    age: 12,
+    males: 1167000,
+    year: 1950,
+    total: 2293000,
+  },
+  {
+    females: 1108000,
+    country: 'United States',
+    age: 13,
+    males: 1145000,
+    year: 1950,
+    total: 2253000,
+  },
+  {
+    females: 1099000,
+    country: 'United States',
+    age: 14,
+    males: 1133000,
+    year: 1950,
+    total: 2232000,
+  },
+  {
+    females: 1093000,
+    country: 'United States',
+    age: 15,
+    males: 1125000,
+    year: 1950,
+    total: 2219000,
+  },
+  {
+    females: 1091000,
+    country: 'United States',
+    age: 16,
+    males: 1121000,
+    year: 1950,
+    total: 2212000,
+  },
+  {
+    females: 1099000,
+    country: 'United States',
+    age: 17,
+    males: 1125000,
+    year: 1950,
+    total: 2224000,
+  },
+  {
+    females: 1119000,
+    country: 'United States',
+    age: 18,
+    males: 1138000,
+    year: 1950,
+    total: 2257000,
+  },
+  {
+    females: 1147000,
+    country: 'United States',
+    age: 19,
+    males: 1158000,
+    year: 1950,
+    total: 2305000,
+  },
+  {
+    females: 1177000,
+    country: 'United States',
+    age: 20,
+    males: 1179000,
+    year: 1950,
+    total: 2356000,
+  },
+  {
+    females: 1208000,
+    country: 'United States',
+    age: 21,
+    males: 1202000,
+    year: 1950,
+    total: 2410000,
+  },
+  {
+    females: 1235000,
+    country: 'United States',
+    age: 22,
+    males: 1224000,
+    year: 1950,
+    total: 2459000,
+  },
+  {
+    females: 1256000,
+    country: 'United States',
+    age: 23,
+    males: 1242000,
+    year: 1950,
+    total: 2498000,
+  },
+  {
+    females: 1270000,
+    country: 'United States',
+    age: 24,
+    males: 1258000,
+    year: 1950,
+    total: 2528000,
+  },
+  {
+    females: 1285000,
+    country: 'United States',
+    age: 25,
+    males: 1273000,
+    year: 1950,
+    total: 2558000,
+  },
+  {
+    females: 1301000,
+    country: 'United States',
+    age: 26,
+    males: 1289000,
+    year: 1950,
+    total: 2590000,
+  },
+  {
+    females: 1306000,
+    country: 'United States',
+    age: 27,
+    males: 1295000,
+    year: 1950,
+    total: 2601000,
+  },
+  {
+    females: 1296000,
+    country: 'United States',
+    age: 28,
+    males: 1285000,
+    year: 1950,
+    total: 2581000,
+  },
+  {
+    females: 1277000,
+    country: 'United States',
+    age: 29,
+    males: 1265000,
+    year: 1950,
+    total: 2542000,
+  },
+  {
+    females: 1256000,
+    country: 'United States',
+    age: 30,
+    males: 1245000,
+    year: 1950,
+    total: 2501000,
+  },
+  {
+    females: 1232000,
+    country: 'United States',
+    age: 31,
+    males: 1222000,
+    year: 1950,
+    total: 2454000,
+  },
+  {
+    females: 1213000,
+    country: 'United States',
+    age: 32,
+    males: 1202000,
+    year: 1950,
+    total: 2415000,
+  },
+  {
+    females: 1202000,
+    country: 'United States',
+    age: 33,
+    males: 1191000,
+    year: 1950,
+    total: 2393000,
+  },
+  {
+    females: 1196000,
+    country: 'United States',
+    age: 34,
+    males: 1185000,
+    year: 1950,
+    total: 2381000,
+  },
+  {
+    females: 1187000,
+    country: 'United States',
+    age: 35,
+    males: 1175000,
+    year: 1950,
+    total: 2361000,
+  },
+  {
+    females: 1174000,
+    country: 'United States',
+    age: 36,
+    males: 1162000,
+    year: 1950,
+    total: 2336000,
+  },
+  {
+    females: 1162000,
+    country: 'United States',
+    age: 37,
+    males: 1150000,
+    year: 1950,
+    total: 2311000,
+  },
+  {
+    females: 1151000,
+    country: 'United States',
+    age: 38,
+    males: 1138000,
+    year: 1950,
+    total: 2289000,
+  },
+  {
+    females: 1139000,
+    country: 'United States',
+    age: 39,
+    males: 1127000,
+    year: 1950,
+    total: 2265000,
+  },
+  {
+    females: 1127000,
+    country: 'United States',
+    age: 40,
+    males: 1115000,
+    year: 1950,
+    total: 2242000,
+  },
+  {
+    females: 1119000,
+    country: 'United States',
+    age: 41,
+    males: 1106000,
+    year: 1950,
+    total: 2225000,
+  },
+  {
+    females: 1094000,
+    country: 'United States',
+    age: 42,
+    males: 1083000,
+    year: 1950,
+    total: 2177000,
+  },
+  {
+    females: 1041000,
+    country: 'United States',
+    age: 43,
+    males: 1040000,
+    year: 1950,
+    total: 2081000,
+  },
+  {
+    females: 973000,
+    country: 'United States',
+    age: 44,
+    males: 985000,
+    year: 1950,
+    total: 1958000,
+  },
+  {
+    females: 908000,
+    country: 'United States',
+    age: 45,
+    males: 932000,
+    year: 1950,
+    total: 1840000,
+  },
+  {
+    females: 838000,
+    country: 'United States',
+    age: 46,
+    males: 875000,
+    year: 1950,
+    total: 1713000,
+  },
+  {
+    females: 796000,
+    country: 'United States',
+    age: 47,
+    males: 838000,
+    year: 1950,
+    total: 1634000,
+  },
+  {
+    females: 797000,
+    country: 'United States',
+    age: 48,
+    males: 833000,
+    year: 1950,
+    total: 1630000,
+  },
+  {
+    females: 827000,
+    country: 'United States',
+    age: 49,
+    males: 847000,
+    year: 1950,
+    total: 1674000,
+  },
+  {
+    females: 852000,
+    country: 'United States',
+    age: 50,
+    males: 858000,
+    year: 1950,
+    total: 1710000,
+  },
+  {
+    females: 880000,
+    country: 'United States',
+    age: 51,
+    males: 871000,
+    year: 1950,
+    total: 1751000,
+  },
+  {
+    females: 893000,
+    country: 'United States',
+    age: 52,
+    males: 873000,
+    year: 1950,
+    total: 1766000,
+  },
+  {
+    females: 878000,
+    country: 'United States',
+    age: 53,
+    males: 857000,
+    year: 1950,
+    total: 1735000,
+  },
+  {
+    females: 846000,
+    country: 'United States',
+    age: 54,
+    males: 828000,
+    year: 1950,
+    total: 1674000,
+  },
+  {
+    females: 818000,
+    country: 'United States',
+    age: 55,
+    males: 802000,
+    year: 1950,
+    total: 1620000,
+  },
+  {
+    females: 791000,
+    country: 'United States',
+    age: 56,
+    males: 775000,
+    year: 1950,
+    total: 1566000,
+  },
+  {
+    females: 766000,
+    country: 'United States',
+    age: 57,
+    males: 751000,
+    year: 1950,
+    total: 1517000,
+  },
+  {
+    females: 747000,
+    country: 'United States',
+    age: 58,
+    males: 734000,
+    year: 1950,
+    total: 1481000,
+  },
+  {
+    females: 732000,
+    country: 'United States',
+    age: 59,
+    males: 719000,
+    year: 1950,
+    total: 1451000,
+  },
+  {
+    females: 714000,
+    country: 'United States',
+    age: 60,
+    males: 703000,
+    year: 1950,
+    total: 1416000,
+  },
+  {
+    females: 693000,
+    country: 'United States',
+    age: 61,
+    males: 684000,
+    year: 1950,
+    total: 1377000,
+  },
+  {
+    females: 674000,
+    country: 'United States',
+    age: 62,
+    males: 664000,
+    year: 1950,
+    total: 1338000,
+  },
+  {
+    females: 658000,
+    country: 'United States',
+    age: 63,
+    males: 640000,
+    year: 1950,
+    total: 1298000,
+  },
+  {
+    females: 643000,
+    country: 'United States',
+    age: 64,
+    males: 613000,
+    year: 1950,
+    total: 1256000,
+  },
+  {
+    females: 626000,
+    country: 'United States',
+    age: 65,
+    males: 586000,
+    year: 1950,
+    total: 1213000,
+  },
+  {
+    females: 611000,
+    country: 'United States',
+    age: 66,
+    males: 560000,
+    year: 1950,
+    total: 1171000,
+  },
+  {
+    females: 587000,
+    country: 'United States',
+    age: 67,
+    males: 528000,
+    year: 1950,
+    total: 1115000,
+  },
+  {
+    females: 548000,
+    country: 'United States',
+    age: 68,
+    males: 490000,
+    year: 1950,
+    total: 1038000,
+  },
+  {
+    females: 500000,
+    country: 'United States',
+    age: 69,
+    males: 449000,
+    year: 1950,
+    total: 949000,
+  },
+  {
+    females: 453000,
+    country: 'United States',
+    age: 70,
+    males: 407000,
+    year: 1950,
+    total: 861000,
+  },
+  {
+    females: 405000,
+    country: 'United States',
+    age: 71,
+    males: 365000,
+    year: 1950,
+    total: 770000,
+  },
+  {
+    females: 364000,
+    country: 'United States',
+    age: 72,
+    males: 328000,
+    year: 1950,
+    total: 692000,
+  },
+  {
+    females: 334000,
+    country: 'United States',
+    age: 73,
+    males: 298000,
+    year: 1950,
+    total: 632000,
+  },
+  {
+    females: 311000,
+    country: 'United States',
+    age: 74,
+    males: 275000,
+    year: 1950,
+    total: 586000,
+  },
+  {
+    females: 288000,
+    country: 'United States',
+    age: 75,
+    males: 251000,
+    year: 1950,
+    total: 539000,
+  },
+  {
+    females: 266000,
+    country: 'United States',
+    age: 76,
+    males: 228000,
+    year: 1950,
+    total: 494000,
+  },
+  {
+    females: 242000,
+    country: 'United States',
+    age: 77,
+    males: 206000,
+    year: 1950,
+    total: 448000,
+  },
+  {
+    females: 214000,
+    country: 'United States',
+    age: 78,
+    males: 181000,
+    year: 1950,
+    total: 395000,
+  },
+  {
+    females: 183000,
+    country: 'United States',
+    age: 79,
+    males: 157000,
+    year: 1950,
+    total: 340000,
+  },
+  {
+    females: 134000,
+    country: 'United States',
+    age: 80,
+    males: 134000,
+    year: 1950,
+    total: 134000,
+  },
+  {
+    females: 113000,
+    country: 'United States',
+    age: 81,
+    males: 113000,
+    year: 1950,
+    total: 113000,
+  },
+  {
+    females: 94200,
+    country: 'United States',
+    age: 82,
+    males: 94200,
+    year: 1950,
+    total: 94200,
+  },
+  {
+    females: 79900,
+    country: 'United States',
+    age: 83,
+    males: 79900,
+    year: 1950,
+    total: 79900,
+  },
+  {
+    females: 68700,
+    country: 'United States',
+    age: 84,
+    males: 68700,
+    year: 1950,
+    total: 68700,
+  },
+  {
+    females: 58400,
+    country: 'United States',
+    age: 85,
+    males: 58400,
+    year: 1950,
+    total: 58400,
+  },
+  {
+    females: 49400,
+    country: 'United States',
+    age: 86,
+    males: 49400,
+    year: 1950,
+    total: 49400,
+  },
+  {
+    females: 41200,
+    country: 'United States',
+    age: 87,
+    males: 41200,
+    year: 1950,
+    total: 41200,
+  },
+  {
+    females: 33600,
+    country: 'United States',
+    age: 88,
+    males: 33600,
+    year: 1950,
+    total: 33600,
+  },
+  {
+    females: 26500,
+    country: 'United States',
+    age: 89,
+    males: 26500,
+    year: 1950,
+    total: 26500,
+  },
+  {
+    females: 20700,
+    country: 'United States',
+    age: 90,
+    males: 20700,
+    year: 1950,
+    total: 20700,
+  },
+  {
+    females: 15800,
+    country: 'United States',
+    age: 91,
+    males: 15800,
+    year: 1950,
+    total: 15800,
+  },
+  {
+    females: 11800,
+    country: 'United States',
+    age: 92,
+    males: 11800,
+    year: 1950,
+    total: 11800,
+  },
+  {
+    females: 8620,
+    country: 'United States',
+    age: 93,
+    males: 8620,
+    year: 1950,
+    total: 8620,
+  },
+  {
+    females: 6230,
+    country: 'United States',
+    age: 94,
+    males: 6230,
+    year: 1950,
+    total: 6230,
+  },
+  {
+    females: 4420,
+    country: 'United States',
+    age: 95,
+    males: 4420,
+    year: 1950,
+    total: 4420,
+  },
+  {
+    females: 3150,
+    country: 'United States',
+    age: 96,
+    males: 3150,
+    year: 1950,
+    total: 3150,
+  },
+  {
+    females: 2190,
+    country: 'United States',
+    age: 97,
+    males: 2190,
+    year: 1950,
+    total: 2190,
+  },
+  {
+    females: 1360,
+    country: 'United States',
+    age: 98,
+    males: 1360,
+    year: 1950,
+    total: 1360,
+  },
+  {
+    females: 686,
+    country: 'United States',
+    age: 99,
+    males: 686,
+    year: 1950,
+    total: 686,
+  },
+  {
+    females: 1200,
+    country: 'United States',
+    age: 100,
+    males: 1200,
+    year: 1950,
+    total: 1200,
+  },
+];
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/assets/data/sales.js.html b/test/unit/coverage/lcov-report/src/assets/data/sales.js.html new file mode 100644 index 0000000..1a0a097 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/assets/data/sales.js.html @@ -0,0 +1,362 @@ + + + + Code coverage report for src/assets/data/sales.js + + + + + + + +
+
+

+ all files / src/assets/data/ sales.js +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
 
+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/test/unit/coverage/lcov-report/src/components/chartExample.vue.html b/test/unit/coverage/lcov-report/src/components/chartExample.vue.html new file mode 100644 index 0000000..3284dc8 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/components/chartExample.vue.html @@ -0,0 +1,554 @@ + + + + Code coverage report for src/components/chartExample.vue + + + + + + + +
+
+

+ all files / src/components/ chartExample.vue +

+
+
+ 0% + Statements + 0/4 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
<template>
+  <div class="container">
+    <div class="row">
+      <div class="col">
+        <img class = "logo" src="../assets/img/logo.png">
+        </div>
+    </div>
+ 
+    <div class="row">
+      <div class="form-group col-6 col-md-4">
+        <div v-for="(t, index) in sales">
+            <input v-model.number="sales[index].total" type="number"> 
+            <button v-model="sales[index]" type="submit" @click="removeItem(index, $event)"> [-] </button>             
+        </div>
+        <button v-on:click="newItem"> [+] </button>
+      </div>
+      <div class="col-6 col-md-8">
+        <div class="row">
+          <div class="col-12">
+            <v-chart v-bind:chartData="lineGraphData"></v-chart>
+          </div>
+          <div class="col-12 col-lg-6">
+            <v-chart v-bind:chartData="areaChartData"></v-chart>
+          </div>
+          <div class="col-12 col-lg-6">
+            <v-chart v-bind:chartData="barChartData"></v-chart>
+          </div>
+          <div class="col-12 col-lg-6">
+            <v-chart v-bind:chartData="vBarChartData"></v-chart>
+          </div>
+          <div class="col-12 col-lg-6">
+            <v-chart v-bind:chartData="pieChartData"></v-chart>
+          </div>
+        </div>  
+      </div>
+    </div>
+    <a href="https://github.com/ignoreintuition/v-chart-plugin"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
+  </div>
+</template>
+ 
+<script>
+import sales from "../assets/data/sales";
+ 
+export default {
+  name: "barChartExample",
+  methods: {
+    newItem: function(){
+      this.sales.push({
+        "month": null,
+        "year": null,
+        "total": null,
+        "actual": false
+      })
+    },
+    removeItem: function(d, e){
+      e.preventDefault();
+      this.sales.splice(d, 1)
+    }
+  },
+  data() {
+    return {
+      sales: sales,
+      areaChartData: {
+        chartType: "areaChart",
+        selector: "areaChart",
+        title: "Area Chart",
+        width: 300,
+        height: 200,
+        metric: ["total"],
+        dim: "month",
+        data: sales,
+        legends: {
+          enabled: true,
+          height: 25,
+          width: 50
+        },                      
+      },
+      barChartData: {
+        chartType: "barChart",
+        selector: "chart",
+        title: "Bar Chart",
+        subtitle: "Sales by month",
+        height: 200,
+        metric: "total",
+        dim: "month",
+        data: sales,
+        legends: {
+          enabled: true,
+          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: sales,
+        legends: {
+          enabled: true,
+          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: sales,
+        legends: {
+          enabled: true,
+          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: sales,
+      },
+      scatterPlotData: {
+        chartType: "scatterPlot",
+        selector: "scatterPlot",
+        title: "Scatter Plot",
+        subtitle: "Sales by month",
+        width: 300,
+        height: 200,
+        metric: "total",
+        dim: "month",
+        data: sales,
+        legends: {
+          enabled: true,
+          height: 25,
+          width: 50
+        },              
+      }
+      
+    };
+  }
+};
+</script>
+ 
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style> 
+  .logo {
+    width: 200px
+  }
+</style>
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/components/index.html b/test/unit/coverage/lcov-report/src/components/index.html new file mode 100644 index 0000000..784c4f4 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/components/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for src/components/ + + + + + + + +
+
+

+ all files src/components/ +

+
+
+ 0% + Statements + 0/4 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/4 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
chartExample.vue
0%0/4100%0/00%0/20%0/4
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/import/areaChart.js.html b/test/unit/coverage/lcov-report/src/import/areaChart.js.html new file mode 100644 index 0000000..f66eec1 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/areaChart.js.html @@ -0,0 +1,488 @@ + + + + Code coverage report for src/import/areaChart.js + + + + + + + +
+
+

+ all files / src/import/ areaChart.js +

+
+
+ 82.22% + Statements + 37/45 +
+
+ 50% + Branches + 1/2 +
+
+ 66.67% + Functions + 8/12 +
+
+ 83.33% + Lines + 35/42 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  + + +  +  + + + +  + + +  +  +  +  +  +  + + +  +  + + + + + +  +  + +  +  +  +  +  + + + + + + +  + +  +  +  + 
/** 
+ *  @fileOverview Area chart component definition
+ *
+ *  @author       Brian Greig
+ *
+ *  @requires     NPM:d3:Vue
+ *  @requires     src/v-chart-plugin.js
+ */
+ 
+ /* eslint-env browser */
+const d3 = Object.assign({},
+  require('d3-selection'),
+  require('d3-scale'),
+  require('d3-axis'),
+  require('d3-shape'));
+/**
+ * Builds an Area Chart.
+ * @module areaChart
+ */
+const areaChart = function chart() {
+  /**
+   * The SVG that stores the chart
+   * @member svgContainer
+   */
+  const svgContainer = d3.select(`#${this.chartData.selector}`);
+  /**
+   * The configuration of the coordinate system
+   * @member cs
+   */
+  let cs = {
+    palette: {
+      stroke: '#d1f4fa',
+      fill: '#005792',
+    },
+    x: {
+      domain: [],
+      range: [],
+      axisHeight: 45,
+      axisWidth: 45,
+    },
+    y: {
+      axisWidth: 45,
+    },
+  };
+  /**
+   * Returns plot points  
+   * @member getPoints
+   * @function
+   * @param {Object} p
+   */
+  const getPoints = (p) => {
+    let poly = (` ${this.width}, ${cs.x.yOffset} `);
+    poly += (` ${cs.x.axisHeight}, ${cs.x.yOffset} `);
+    poly += p.map(d => [cs.x.scale(d.dim) + cs.y.axisWidth + 5, cs.y.scale(d.metric)].join(',')).join(' ');
+    return poly;
+  };
+ 
+  const poly = svgContainer.selectAll('polygon').data([this.ds]);
+ 
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} s (svg element)
+   */
+  const enter = (s) => {
+    s.enter()
+      .append('polygon')
+      .attr('stroke', cs.palette.stroke)
+      .attr('fill', cs.palette.fill)
+      .attr('points', getPoints);
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} s (svg element)
+   */
+  const transition = (s) => {
+    s.transition()
+      .attr('points', getPoints);
+  };
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} s (svg element)
+   */
+  const exit = (s) => {
+    s.exit().remove();
+    return s;
+  };
+  /**
+   * Builds the scales for the x and y axes
+   * @member buildScales
+   * @function
+   */
+  const buildScales = () => {
+    cs.y.scale = d3.scaleLinear()
+      .domain([0, this.max])
+      .range([this.displayHeight - cs.x.axisHeight, this.titleHeight]);
+    cs.y.axis = d3.axisLeft().ticks(10, '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 - cs.x.axisWidth) * i)) / this.ds.length));
+    cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);
+    cs.x.axis = d3.axisBottom().scale(cs.x.scale);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  const drawAxis = () => {
+    cs.polyFunction = d3.line()
+      .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
+      .y(d => cs.y.scale(d.metric));
+    cs.x.xOffset = cs.y.axisWidth + 5;
+    cs.x.yOffset = this.displayHeight - cs.x.axisHeight;
+    cs.y.xOffset = cs.y.axisWidth;
+    cs.y.yOffset = 0;
+    svgContainer.append('g').append('g')
+      .attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)
+      .call(cs.x.axis);
+    Iif (this.ds[0].dim)
+      svgContainer.append('g').append('g').attr('class', 'axis')
+        .attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)
+        .call(cs.y.axis);
+  };
+  
+  cs = this.setOverrides(cs, this.chartData.overrides);
+  buildScales(cs);
+  drawAxis(cs);
+  enter(poly);
+  transition(poly);
+  exit(poly);
+ 
+  return cs;
+};
+ 
+export default areaChart;
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/import/barChart.js.html b/test/unit/coverage/lcov-report/src/import/barChart.js.html new file mode 100644 index 0000000..d6327d8 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/barChart.js.html @@ -0,0 +1,653 @@ + + + + Code coverage report for src/import/barChart.js + + + + + + + +
+
+

+ all files / src/import/ barChart.js +

+
+
+ 84.62% + Statements + 44/52 +
+
+ 25% + Branches + 2/8 +
+
+ 57.14% + Functions + 8/14 +
+
+ 89.36% + Lines + 42/47 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + + +  +  +  +  + +  +  +  +  +  +  +  + + + +  +  +  +  +  +  + + +  +  + + +  + +  +  +  +  +  +  + + + + + + + + +  + +  +  +  +  +  +  +  +  + +  +  +  + +  + + +  +  + + + + + +  + +  +  +  + 
/** 
+ *  @fileOverview Bar chart component definition
+ *
+ *  @author       Brian Greig
+ *
+ *  @requires     NPM:d3:Vue
+ *  @requires     src/v-chart-plugin.js
+ */
+ 
+ /* eslint-env browser */
+const d3 = Object.assign({},
+  require('d3-selection'),
+  require('d3-scale'),
+  require('d3-axis'),
+  require('d3-ease'));
+/**
+ * Builds a Bar Chart.
+ * @module barChart
+ */
+ 
+const barChart = function chart() {
+  /**
+   * The SVG that stores the chart
+   * @member svgContainer
+   */
+  const svgContainer = d3.select(`#${this.chartData.selector}`);
+  /**
+   * The configuration of the coordinate system
+   * @member cs
+   */
+  let cs = {
+    palette: {
+      fill: '#005792',
+      stroke: '#d1f4fa',
+    },
+    bar: {
+      hPadding: 8,
+      vPadding: 5,
+    },
+    x: {
+      axisHeight: 10,
+      ticks: 5,
+    },
+    y: {
+      domain: [],
+      range: [],
+      axisWidth: null,
+    },
+  };
+ 
+  /**
+   * Returns width of the bar
+   * @member getWidth
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const getWidth = d => cs.x.scale(d.metric);
+ 
+  /**
+   * Returns height of the bar
+   * @member getHeight
+   * @function
+   */
+  const getHeight = () => (
+    this.displayHeight - cs.x.axisHeight - this.header - cs.bar.vPadding) / this.ds.length - 1;
+ 
+  /**
+   * Returns y axis co-ordinate of the bar
+   * @member getYCoord
+   * @function
+   * @param {Object} d (svg element)
+   * @param {Object} i (svg element)
+   */
+  const getYCoord = (d, i) => i * (
+    this.displayHeight - cs.x.axisHeight - this.header) / this.ds.length + 1 + this.header;
+ 
+  /**
+   * Adds a tooltip on mouse over
+   * @member mouseOver
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const mouseOver = (d) => {
+    this.addTooltip(d, window.event);
+  };
+ 
+  /**
+   * Removes tooltip on mouse out
+   * @member mouseOut
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const mouseOut = (d) => {
+    this.removeTooltip(d);
+  };
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} rects (svg element)
+   */
+  const enter = (rects) => {
+    rects.enter()
+      .append('rect')
+      .attr('fill', cs.palette.fill)
+      .attr('stroke', cs.palette.stroke)
+      .attr('class', this.selector)
+      .attr('width', getWidth)
+      .attr('height', getHeight)
+      .attr('y', getYCoord)
+      .attr('x', cs.y.axisWidth + cs.bar.hPadding)
+      .on('mouseover', mouseOver)
+      .on('mouseout', mouseOut);
+    return rects;
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} rects (svg element)
+   */
+  const transition = (rects) => {
+    rects.transition()
+      .attr('width', getWidth)
+      .attr('height', getHeight)
+      .attr('y', getYCoord)
+      .attr('x', cs.y.axisWidth + cs.bar.hPadding);
+    return rects;
+  };
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} rect (svg element)
+   */
+  const exit = (rects) => {
+    rects.exit().remove();
+    return rects;
+  };
+  /**
+   * Builds the scales for the x and y axes
+   * @member buildScales
+   * @function
+   */
+  const buildScales = () => {
+    cs.x.scale = d3.scaleLinear()
+      .domain([0, this.max])
+      .range([0, this.width - cs.bar.hPadding - cs.y.axisWidth]);
+    this.ds.forEach(t => cs.y.domain.push(t.dim));
+    this.ds.forEach((t, i) => cs.y.range.push(((
+      this.displayHeight - cs.x.axisHeight - this.header + cs.bar.vPadding) * i) / this.ds.length));
+    cs.y.scale = d3.scaleOrdinal().domain(cs.y.domain).range(cs.y.range);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  const drawAxis = () => {
+    cs.x.axis = d3.axisBottom().ticks(cs.x.ticks, 's').scale(cs.x.scale);
+    cs.y.axis = d3.axisLeft().scale(cs.y.scale);
+    cs.x.yOffset = this.displayHeight - cs.x.axisHeight;
+    cs.x.xOffset = cs.bar.hPadding + cs.y.axisWidth;
+    cs.y.yOffset = cs.bar.vPadding + this.header - 1;
+    cs.y.xOffset = cs.y.axisWidth;
+    Iif (this.ds[0].dim)
+      svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`).call(cs.y.axis);
+    svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`).call(cs.x.axis);
+  };
+  /**
+   * Get the maximum dimension length
+   * @member getMaxDimLength
+   * @function
+   * @param {number} accumulator
+   * @param {number} currentValue
+   */
+  const getMaxDimLength = (accumulator, currentValue) => {
+    return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator;
+  }
+ 
+  const rects = svgContainer.selectAll('rect').data(this.ds);
+ 
+  cs = this.setOverrides(cs, this.chartData.overrides);
+  Iif (this.ds[0].dim)
+    cs.y.axisWidth = cs.y.axisWidth || (this.ds.reduce(getMaxDimLength, 0)) * 10;
+ 
+  buildScales(cs);
+  drawAxis(cs);
+  enter(rects);
+  transition(rects);
+  exit(rects);
+ 
+  return cs;
+};
+ 
+export default barChart;
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/import/index.html b/test/unit/coverage/lcov-report/src/import/index.html new file mode 100644 index 0000000..ed68f2e --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/index.html @@ -0,0 +1,158 @@ + + + + Code coverage report for src/import/ + + + + + + + +
+
+

+ all files src/import/ +

+
+
+ 73.68% + Statements + 196/266 +
+
+ 35.71% + Branches + 5/14 +
+
+ 48.1% + Functions + 38/79 +
+
+ 76.11% + Lines + 188/247 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
areaChart.js
82.22%37/4550%1/266.67%8/1283.33%35/42
barChart.js
84.62%44/5225%2/857.14%8/1489.36%42/47
lineGraph.js
23.4%11/47100%0/06.67%1/1524.44%11/45
pieChart.js
90%27/3050%1/262.5%5/893.1%27/29
scatterPlot.js
82.22%37/45100%0/050%8/1681.4%35/43
vBarChart.js
85.11%40/4750%1/257.14%8/1492.68%38/41
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/import/lineGraph.js.html b/test/unit/coverage/lcov-report/src/import/lineGraph.js.html new file mode 100644 index 0000000..f8034c7 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/lineGraph.js.html @@ -0,0 +1,566 @@ + + + + Code coverage report for src/import/lineGraph.js + + + + + + + +
+
+

+ all files / src/import/ lineGraph.js +

+
+
+ 23.4% + Statements + 11/47 +
+
+ 100% + Branches + 0/0 +
+
+ 6.67% + Functions + 1/15 +
+
+ 24.44% + Lines + 11/45 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
/** 
+ *  @fileOverview Line Graph component definition
+ *
+ *  @author       Brian Greig
+ *
+ *  @requires     NPM:d3:Vue
+ *  @requires     src/v-chart-plugin.js
+ */
+const d3 = Object.assign({},
+  require('d3-selection'),
+  require('d3-scale'),
+  require('d3-axis'),
+  require('d3-shape'));
+/**
+ * Builds a Line Graph.
+ * @module lineGraph
+ */
+ 
+const lineGraph = function chart(mode) {
+  /**
+   * The SVG that stores the chart
+   * @member svgContainer
+   */
+  const svgContainer = d3.select(`#${this.chartData.selector}`);
+  /**
+   * The configuration of the coordinate system
+   * @member cs
+   */
+  let cs = {
+    palette: {
+      lineFill: ['#ffcdcd', '#005792'],
+      pointFill: '#005792',
+      pointStroke: '#d1f4fa',
+    },
+    x: {
+      domain: [],
+      range: [],
+      axisHeight: 20,
+    },
+    y: {
+      axisWidth: 30,
+      ticks: 5,
+    },
+  };
+ 
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} points (svg element) 
+   */
+  const enter = (points, path) => {
+    this.metric.forEach( (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)
+    })    
+        
+    // 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
+   * @member transition
+   * @function
+   * @param {Object} points (svg element) 
+   */
+  const transition = (points, path) => {
+    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;
+  };
+ 
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} points (svg element)
+   */
+  const exit = (points, path) => {
+    points.exit().remove();
+    this.metric.forEach( (e, i) => {
+      path[i].exit().remove();
+    })
+    return points;
+  };
+ 
+  /**
+   * Builds the scales for the x and y axes
+   * @member buildScales
+   * @function
+   */
+  const buildScales = cs => {
+    cs.y.scale = d3.scaleLinear()
+      .domain([this.min, this.max])
+      .range([this.displayHeight - cs.x.axisHeight, this.header]);
+    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);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  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 = [];
+  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 = []
+  this.metric.forEach( (e, i) => {
+    path.push(svgContainer.selectAll('path#p' + i).data(this.ds))
+  })
+ 
+  cs = this.setOverrides(cs, this.chartData.overrides);
+ 
+  buildScales(cs);
+  drawAxis(cs);
+  enter(points, path);
+  transition(points, path);
+  exit(points, path);
+ 
+  return cs;
+};
+ 
+export default lineGraph;
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/import/pieChart.js.html b/test/unit/coverage/lcov-report/src/import/pieChart.js.html new file mode 100644 index 0000000..a676b11 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/pieChart.js.html @@ -0,0 +1,455 @@ + + + + Code coverage report for src/import/pieChart.js + + + + + + + +
+
+

+ all files / src/import/ pieChart.js +

+
+
+ 90% + Statements + 27/30 +
+
+ 50% + Branches + 1/2 +
+
+ 62.5% + Functions + 5/8 +
+
+ 93.1% + Lines + 27/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  + +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + + +  +  + +  +  +  +  +  +  +  + + + +  +  + +  + +  + +  +  + + + + +  + +  +  +  + 
/** 
+ *  @fileOverview Pie Chart component definition
+ *
+ *  @author       Brian Greig
+ *
+ *  @requires     NPM:d3:Vue
+ *  @requires     src/v-chart-plugin.js
+ */
+ 
+ /* eslint-env browser */
+const d3 = Object.assign({},
+  require('d3-selection'),
+  require('d3-scale'),
+  require('d3-axis'),
+  require('d3-shape'));
+/**
+ * Builds an Pie Chart.
+ * @module pieChart
+ */
+ 
+const pieChart = function chart() {
+  /**
+   * The SVG that stores the chart
+   * @member svgContainer
+   */
+  const svgContainer = d3.select(`#${this.chartData.selector}`);
+  /**
+   * The configuration of the coordinate system
+   * @member cs
+   */
+  let cs = {
+    radius: null,
+    ordinalColors: ['#d1f4fa', '#005792', '#ffe6eb', '#ffcdcd'],
+  };
+  cs.radius = this.height > this.width ? (
+    this.width - this.width * 0.1) / 2 : (this.height - this.height * 0.1) / 2;
+ 
+  const color = d3.scaleOrdinal()
+    .range(cs.ordinalColors);
+ 
+  /**
+   * Returns colors for pie chart
+   * @member getColor
+   * @function
+   */
+  const getColor = (d, i) => color(i);
+ 
+  /**
+   * Adds a tooltip on mouse over
+   * @member mouseOver
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const mouseOver = (d) => {
+    this.addTooltip(d.data, window.event);
+  };
+ 
+  /**
+   * Removes tooltip on mouse out
+   * @member mouseOut
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const mouseOut = (d) => {
+    this.removeTooltip(d);
+  };
+ 
+  const path = d3.arc()
+    .outerRadius(cs.radius - 10)
+    .innerRadius(25);
+ 
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} arc (svg element)
+   */
+  const enter = (arc) => {
+    arc.enter()
+      .append('g')
+      .attr('transform', `translate(${this.width / 2},${this.height / 2})`)
+      .append('path')
+      .merge(arc)
+      .attr('class', 'arc')
+      .attr('d', path)
+      .attr('fill', getColor)
+      .on('mouseover', mouseOver)
+      .on('mouseout', mouseOut)
+      .attr('transform', `translate(0,${this.header})`);
+    return arc;
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} arc (svg element)
+   */
+  const transition = (arc) => {
+    arc.transition()
+      .attr('d', path)
+      .attr('fill', getColor);
+    return arc;
+  };
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} arc (svg element)
+   */
+  const exit = (arc) => {
+    arc.exit().remove();
+    return arc;
+  };
+ 
+  const pie = d3.pie()
+    .sort(null)
+    .value(d => d.metric);
+ 
+  const arc = svgContainer.selectAll('.arc')
+    .data(pie(this.ds));
+ 
+  cs = this.setOverrides(cs, this.chartData.overrides);
+  enter(arc);
+  transition(arc);
+  exit(arc);
+ 
+  return cs;
+};
+ 
+export default pieChart;
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html b/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html new file mode 100644 index 0000000..f4e3477 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html @@ -0,0 +1,443 @@ + + + + Code coverage report for src/import/scatterPlot.js + + + + + + + +
+
+

+ all files / src/import/ scatterPlot.js +

+
+
+ 82.22% + Statements + 37/45 +
+
+ 100% + Branches + 0/0 +
+
+ 50% + Functions + 8/16 +
+
+ 81.4% + Lines + 35/43 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + + +  +  +  +  + +  +  +  +  +  +  +  + + + +  +  +  +  +  +  + + +  +  + + + + +  +  +  +  +  +  + + + + + + + + +  +  + + + + + + +  + +  +  +  + 
/** 
+ *  @fileOverview Scatter Plot component definition
+ *
+ *  @author       Brian Greig
+ *
+ *  @requires     NPM:d3:Vue
+ *  @requires     src/v-chart-plugin.js
+ */
+ 
+ /* eslint-env browser */
+const d3 = Object.assign({},
+  require('d3-selection'),
+  require('d3-scale'),
+  require('d3-axis'));
+/**
+ * Builds a Scatter Plot.
+ * @module scatterPlot
+ */
+ 
+const scatterPlot = function chart() {
+  /**
+   * The SVG that stores the chart
+   * @member svgContainer
+   */
+  const svgContainer = d3.select(`#${this.chartData.selector}`);
+  /**
+   * The configuration of the coordinate system
+   * @member cs
+   */
+  let cs = {
+    x: {
+      domain: [],
+      range: [],
+      axisHeight: 20,
+    },
+    y: {
+      axisWidth: 30,
+      ticks: 5,
+    },
+  };
+  const points = svgContainer.selectAll('circle').data(this.ds);
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} p (svg element)
+   */
+  const enter = (p) => {
+    p.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;
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} p (svg element)
+   */
+  const transition = (p) => {
+    p.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;
+  };
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} rect (svg element)
+   */
+  const exit = () => {
+    points.exit().remove();
+    return points;
+  };
+  /**
+   * Builds the scales for the x and y axes
+   * @member buildScales
+   * @function
+   */
+  const buildScales = () => {
+    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);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  const drawAxis = () => {
+    cs.x.axis = d3.axisBottom().scale(cs.x.scale);
+    cs.x.xOffset = cs.y.axisWidth + 5;
+    cs.x.yOffset = this.height - cs.x.axisHeight;
+    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 = this.setOverrides(cs, this.chartData.overrides);
+  buildScales(cs);
+  drawAxis(cs);
+  enter(points);
+  transition(points);
+  exit(points);
+ 
+  return cs;
+};
+ 
+export default scatterPlot;
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/import/vBarChart.js.html b/test/unit/coverage/lcov-report/src/import/vBarChart.js.html new file mode 100644 index 0000000..ffc343e --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/vBarChart.js.html @@ -0,0 +1,635 @@ + + + + Code coverage report for src/import/vBarChart.js + + + + + + + +
+
+

+ all files / src/import/ vBarChart.js +

+
+
+ 85.11% + Statements + 40/47 +
+
+ 50% + Branches + 1/2 +
+
+ 57.14% + Functions + 8/14 +
+
+ 92.68% + Lines + 38/41 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + + +  +  + + +  + +  +  +  +  +  +  + + + + + + + + +  +  + +  +  +  +  +  + +  + + + + + + +  + +  +  +  + 
/** 
+ *  @fileOverview Verticle Bar Chart component definition
+ *
+ *  @author       Brian Greig
+ *
+ *  @requires     NPM:d3:Vue
+ *  @requires     src/v-chart-plugin.js
+ */
+ 
+ const d3 = Object.assign({},
+  require('d3-selection'),
+  require('d3-scale'),
+  require('d3-axis'),
+  require('d3-transition'));
+/**
+ * Builds a Verticle Bar Chart.
+ * @module vBarChart
+ */
+ 
+const vBarChart = function chart() {
+  /**
+   * The SVG that stores the chart
+   * @member svgContainer
+   */
+  const svgContainer = d3.select(`#${this.chartData.selector}`);
+  /**
+   * The configuration of the coordinate system
+   * @member cs
+   */
+  let cs = {
+    palette: {
+      fill: '#005792',
+      stroke: '#d1f4fa',
+    },
+    bar: {
+      hPadding: 0,
+      vPadding: 0,
+    },
+    x: {
+      axisHeight: 20,
+      domain: [],
+      range: [],
+    },
+    y: {
+      axisWidth: 30,
+      ticks: 5,
+    },
+  };
+  /**
+   * Returns width of the bar
+   * @member getWidth
+   * @function
+   */
+ 
+  const getWidth = () => ((this.width - cs.y.axisWidth) / this.chartData.data.length - 1);
+ 
+  /**
+   * Returns height of the bar
+   * @member getHeight
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const getHeight = d => this.displayHeight - cs.y.scale(d.metric);
+ 
+  /**
+   * Returns x axis co-ordinate of the bar
+   * @member getXCoord
+   * @function
+   * @param {Object} d (svg element)
+   * @param {Object} i (svg element)
+   */
+  const getXCoord = (d, i) => (
+    i * (this.width - cs.y.axisWidth) / this.chartData.data.length) + cs.y.axisWidth;
+  /**
+   * Returns y axis co-ordinate of the bar
+   * @member getYCoord
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const getYCoord = d => cs.y.scale(d.metric);
+ 
+  /**
+   * Adds a tooltip on mouse over
+   * @member mouseOver
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const mouseOver = (d) => {
+    this.addTooltip(d, window.event);
+  };
+ 
+  /**
+   * Removes tooltip on mouse out
+   * @member mouseOut
+   * @function
+   * @param {Object} d (svg element)
+   */
+  const mouseOut = (d) => {
+    this.removeTooltip(d);
+  };
+ 
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} rects (svg element)
+   */
+  const enter = (rects) => {
+    rects.enter()
+      .append('rect')
+      .attr('fill', cs.palette.fill)
+      .attr('stroke', cs.palette.stroke)
+      .attr('class', this.selector)
+      .attr('width', getWidth)
+      .attr('height', getHeight)
+      .attr('x', getXCoord)
+      .attr('y', getYCoord)
+      .on('mouseover', mouseOver)
+      .on('mouseout', mouseOut);
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} rects (svg element)
+   */
+  const transition = (rects) => {
+    rects.transition()
+      .attr('width', getWidth)
+      .attr('height', getHeight)
+      .attr('x', getXCoord)
+      .attr('y', getYCoord);
+  };
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} rects (svg element)
+   */
+  const exit = (rects) => {
+    rects.exit().remove();
+  };
+  /**
+   * Builds the scales for the x and y axes
+   * @member buildScales
+   * @function
+   */
+  const buildScales = () => {
+    cs.y.scale = d3.scaleLinear()
+      .domain([0, this.max])
+      .range([this.displayHeight, this.header]);
+    this.ds.forEach(t => cs.x.domain.push(t.dim));
+    this.ds.forEach((t, i) => cs.x.range.push(((
+      this.chartData.width - cs.y.axisWidth + cs.bar.vPadding) * i) / this.ds.length));
+    cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  const drawAxis = () => {
+    cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);
+    cs.x.axis = d3.axisBottom().scale(cs.x.scale);
+    cs.x.yOffset = this.displayHeight;
+    cs.x.xOffset = cs.y.axisWidth;
+    cs.y.yOffset = 0;
+    cs.y.xOffset = cs.y.axisWidth;
+    svgContainer.append('g').attr('class', 'axis')
+      .attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`)
+      .call(cs.y.axis);
+    Iif (this.ds[0].dim)
+      svgContainer.append('g').attr('class', 'axis')
+        .attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)
+        .call(cs.x.axis);
+  };
+ 
+  const rects = svgContainer.selectAll('rect').data(this.ds);
+ 
+  cs = this.setOverrides(cs, this.chartData.overrides);
+  buildScales(cs);
+  drawAxis(cs);
+  enter(rects);
+  transition(rects);
+  exit(rects);
+ 
+  return cs;
+};
+ 
+export default vBarChart;
+ 
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/index.html b/test/unit/coverage/lcov-report/src/index.html new file mode 100644 index 0000000..2024c8f --- /dev/null +++ b/test/unit/coverage/lcov-report/src/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for src/ + + + + + + + +
+
+

+ all files src/ +

+
+
+ 75% + Statements + 51/68 +
+
+ 66.67% + Branches + 32/48 +
+
+ 85.71% + Functions + 6/7 +
+
+ 75.38% + Lines + 49/65 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
App.vue
100%0/0100%0/0100%0/0100%0/0
v-chart-plugin.js
75%51/6866.67%32/4885.71%6/775.38%49/65
+
+
+ + + + + + + diff --git a/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html b/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html new file mode 100644 index 0000000..12db272 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html @@ -0,0 +1,986 @@ + + + + Code coverage report for src/v-chart-plugin.js + + + + + + + +
+
+

+ all files / src/ v-chart-plugin.js +

+
+
+ 75% + Statements + 51/68 +
+
+ 66.67% + Branches + 32/48 +
+
+ 85.71% + Functions + 6/7 +
+
+ 75.38% + Lines + 49/65 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  + +  +  + +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +15× + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  + + +  + +10× +  +  +10× +10× +  +10× +10× +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + + + + +  + + +  + +  +  +  +  +  +  +  + + + + +  + +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + 
/** 
+ *  @fileOverview Chart component containing all of the generic components required for charts
+ *
+ *  @author       Brian Greig
+ *
+ *  @requires     NPM:d3:Vue
+ */
+ 
+/* eslint-env browser */
+import barChart from './import/barChart';
+import vBarChart from './import/vBarChart';
+import lineGraph from './import/lineGraph';
+import scatterPlot from './import/scatterPlot';
+import pieChart from './import/pieChart';
+import areaChart from './import/areaChart';
+ 
+const d3 = Object.assign({},
+  require('d3-selection'));
+ 
+/**
+ *  Chart is the generic component used for any chart type
+ *  @namespace
+ */
+  
+const Chart = {
+  install(Vue) {
+    Vue.component('v-chart', {
+      props: ['chartData'],
+      data() {
+        return {
+          selector: `${this.chartData.selector}-${this.chartData.chartType}`,
+        };
+      },
+      methods: {
+        /**
+         * Generate a new Chart of type chartType
+         * @memberOf Chart
+         */
+        initalizeChart() {
+          const cs = this[this.chartData.chartType]('init');
+          this.drawTitle();
+          this.generateLegend(cs);
+        },
+        /**
+         * Redraw the Chart when the data is recycled
+         * @memberOf Chart
+         */
+        refreshChart() {
+          this.clearAxis();
+          this[this.chartData.chartType]('refresh');
+        },
+        /**
+         * Remove x and y axes
+         * @memberOf Chart
+         */
+        clearAxis() {
+          d3.select(`#${this.chartData.selector}`).selectAll('.axis').remove();
+        },
+        /**
+         * Remove all content from the SVG
+         * @memberOf Chart
+         */
+        clearCanvas() {
+          d3.select(`#${this.chartData.selector}`).selectAll('*').remove();
+        },
+        /**
+         * Appends title and subtitle to the chart
+         * @memberOf Chart
+         */
+        drawTitle() {
+          d3.select(`#${this.chartData.selector}`)
+            .append('text')
+            .attr('x', this.width / 2)
+            .attr('y', this.titleHeight - this.titleHeight * 0.1)
+            .style('text-anchor', 'middle')
+            .text(this.chartData.title);
+ 
+          d3.select(`#${this.chartData.selector}`)
+            .append('text')
+            .attr('x', this.width / 2)
+            .attr('y', this.titleHeight - this.titleHeight * 0.1 + this.subtitleHeight)
+            .style('text-anchor', 'middle')
+            .text(this.chartData.subtitle);
+        },
+        /**
+         * Adds a tooltip to the SVG
+         * @memberOf Chart
+         * @param {Object} d dataset
+         * @param {Object} e event x and y coordinates
+         */
+        addTooltip(d, e) {
+          d3.select(`#${this.chartData.selector}`)
+            .append('rect')
+            .attr('x', e.layerX - 5 - 50)
+            .attr('y', e.layerY - 13 - 25)
+            .attr('height', '16px')
+            .attr('width', '80px')
+            .attr('class', 'tt')
+            .attr('fill', 'white');
+ 
+          d3.select(`#${this.chartData.selector}`)
+            .append('text')
+            .attr('x', e.layerX - 50)
+            .attr('y', e.layerY - 25)
+            .attr('class', 'tt')
+            .attr('font-size', '10px')
+            .text(`${d.dim}:${d.metric}`);
+        },
+        /**
+         * Removes all tooltips from the SVG
+         * @memberOf Chart
+         * @param {Object} d dataset
+         */
+        removeTooltip() {
+          d3.select(`#${this.chartData.selector}`)
+            .selectAll('.tt').remove();
+        },
+        /**
+         * Override default values 
+         * @param {Object} cs configuration of the coordinate systems
+         * @param {Object} overrides the additional values that can be used for an object
+         * @returns {Object} updated configuration of coordinate system 
+         */
+        setOverrides(cs, overrides) {
+          overrides = overrides || {};
+          const keys = Object.keys(cs);
+          for (const key of keys)
+            Object.assign(cs[key], overrides[key]);
+          return cs;
+        },
+        /**
+         * Generate legend if option -legends- defined as true
+         * @memberOf Chart
+         * @param {Object} cs configuration of the coordinate system
+         */
+        generateLegend(cs) {
+          Iif (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[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 () {
+                const fill = cs.palette.lineFill || cs.palette.fill;
+                return fill;
+              });
+          }
+        },
+ 
+        ...((typeof barChart !== 'undefined') && { barChart }),
+        ...((typeof vBarChart !== 'undefined') && { vBarChart }),
+        ...((typeof scatterPlot !== 'undefined') && { scatterPlot }),
+        ...((typeof pieChart !== 'undefined') && { pieChart }),
+        ...((typeof areaChart !== 'undefined') && { areaChart }),
+        ...((typeof lineGraph !== 'undefined') && { lineGraph }),
+      },
+      computed: {
+        /**
+         * Dataset getter function
+         * @memberOf Chart
+         * @returns {Object} normalized dataset
+         */
+        ds() {
+          //TODO add in support for arrays with undefined metric
+          const ds = { metric: [] };
+          Eif (!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 this.chartData.metric;
+        },
+        /**
+         * Height getter function
+         * @memberOf Chart
+         * @returns {number} Chart Height
+         */
+        height() {
+          return this.chartData.height || 200;
+        },
+        /**
+         * Width getter function
+         * @memberOf Chart
+         * @returns {number} Chart width
+         */
+        width() {
+          return this.chartData.width || 200;
+        },
+        /**
+         * Get the maxium value for metric
+         * @memberOf Chart
+         * @returns {number} Max value for metric
+         */
+        max() {
+          let max = 0;
+          var results = []; 
+          this.ds.forEach(e => {
+            results = results.concat([...e.metric]);
+          });
+          results.forEach((e) => {
+            max = max > e ? max : e;
+          });
+          return max;
+        },
+        /**
+         * Get the minimum value for dataset
+         * @memberOf Chart
+         * @returns {number} Min value for metric
+         */
+        min() {
+          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
+         * @memberOf Chart
+         * @returns {number} Height of the chart display
+         */
+        displayHeight() {
+          Iif (this.chartData.legends && this.chartData.legends.enabled === true) {
+            return this.height * .80;
+          } else {
+            return this.height;
+          }
+        },
+        /**
+         * Gets the height of the title 
+         * @memberOf Chart
+         * @returns {number} Height of the chart title
+         */
+        titleHeight() {
+          Eif (this.chartData.title) return this.chartData.textHeight || 25;
+          return 0;
+        },
+        /**
+         * Gets the subtitle height
+         * @memberOf Chart
+         * @returns {number} Height of chart subtitle
+         */
+        subtitleHeight() {
+          Iif (this.chartData.subtitle) return this.chartData.textHeight * 0.66 || 25 * 0.66;
+          return 0;
+        },
+        /**
+         * Gets the combined height of the title and subtitle
+         * @memberOf Chart
+         * @returns {number} Total header height
+         */
+        header() {
+          return (this.titleHeight + this.subtitleHeight);
+        },
+      },
+      mounted() {
+        this.initalizeChart();
+      },
+      watch: {
+        chartData: {
+          handler() {
+            this.refreshChart();
+          },
+          deep: true,
+        },
+      },
+      template:
+        '<svg :id=\'this.chartData.selector\' x=\'5\' y=\'5\' :height=\'this.height + 20\' :width=\'this.width + 20\'> </svg>',
+    });
+  },
+};
+ 
+export default Chart;
+ 
+Iif (typeof window !== 'undefined' && window.Vue) {
+  window.Vue.use(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 From ffae94687c9a48fdb2e0452d7d72ba62852dcdda Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Mon, 12 Nov 2018 09:52:05 -0500 Subject: [PATCH 09/10] multivariate charting - line charts --- test/unit/coverage/lcov-report/base.css | 213 -- test/unit/coverage/lcov-report/index.html | 132 - test/unit/coverage/lcov-report/prettify.css | 1 - test/unit/coverage/lcov-report/prettify.js | 1 - .../lcov-report/sort-arrow-sprite.png | Bin 209 -> 0 bytes test/unit/coverage/lcov-report/sorter.js | 158 -- .../coverage/lcov-report/src/App.vue.html | 146 - .../lcov-report/src/assets/data/index.html | 106 - .../lcov-report/src/assets/data/pop.js.html | 2498 ----------------- .../lcov-report/src/assets/data/sales.js.html | 362 --- .../src/components/chartExample.vue.html | 554 ---- .../lcov-report/src/components/index.html | 93 - .../lcov-report/src/import/areaChart.js.html | 488 ---- .../lcov-report/src/import/barChart.js.html | 653 ----- .../lcov-report/src/import/index.html | 158 -- .../lcov-report/src/import/lineGraph.js.html | 566 ---- .../lcov-report/src/import/pieChart.js.html | 455 --- .../src/import/scatterPlot.js.html | 443 --- .../lcov-report/src/import/vBarChart.js.html | 635 ----- test/unit/coverage/lcov-report/src/index.html | 106 - .../lcov-report/src/v-chart-plugin.js.html | 986 ------- 21 files changed, 8754 deletions(-) delete mode 100644 test/unit/coverage/lcov-report/base.css delete mode 100644 test/unit/coverage/lcov-report/index.html delete mode 100644 test/unit/coverage/lcov-report/prettify.css delete mode 100644 test/unit/coverage/lcov-report/prettify.js delete mode 100644 test/unit/coverage/lcov-report/sort-arrow-sprite.png delete mode 100644 test/unit/coverage/lcov-report/sorter.js delete mode 100644 test/unit/coverage/lcov-report/src/App.vue.html delete mode 100644 test/unit/coverage/lcov-report/src/assets/data/index.html delete mode 100644 test/unit/coverage/lcov-report/src/assets/data/pop.js.html delete mode 100644 test/unit/coverage/lcov-report/src/assets/data/sales.js.html delete mode 100644 test/unit/coverage/lcov-report/src/components/chartExample.vue.html delete mode 100644 test/unit/coverage/lcov-report/src/components/index.html delete mode 100644 test/unit/coverage/lcov-report/src/import/areaChart.js.html delete mode 100644 test/unit/coverage/lcov-report/src/import/barChart.js.html delete mode 100644 test/unit/coverage/lcov-report/src/import/index.html delete mode 100644 test/unit/coverage/lcov-report/src/import/lineGraph.js.html delete mode 100644 test/unit/coverage/lcov-report/src/import/pieChart.js.html delete mode 100644 test/unit/coverage/lcov-report/src/import/scatterPlot.js.html delete mode 100644 test/unit/coverage/lcov-report/src/import/vBarChart.js.html delete mode 100644 test/unit/coverage/lcov-report/src/index.html delete mode 100644 test/unit/coverage/lcov-report/src/v-chart-plugin.js.html diff --git a/test/unit/coverage/lcov-report/base.css b/test/unit/coverage/lcov-report/base.css deleted file mode 100644 index 29737bc..0000000 --- a/test/unit/coverage/lcov-report/base.css +++ /dev/null @@ -1,213 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.medium .chart { border:1px solid #f9cd0b; } -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } -/* light gray */ -span.cline-neutral { background: #eaeaea; } - -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/test/unit/coverage/lcov-report/index.html b/test/unit/coverage/lcov-report/index.html deleted file mode 100644 index 8742d57..0000000 --- a/test/unit/coverage/lcov-report/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
-
-

- / -

-
-
- 73.08% - Statements - 247/338 -
-
- 59.68% - Branches - 37/62 -
-
- 50% - Functions - 44/88 -
-
- 75% - Lines - 237/316 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
src/
75%51/6866.67%32/4885.71%6/775.38%49/65
src/assets/data/
100%0/0100%0/0100%0/0100%0/0
src/components/
0%0/4100%0/00%0/20%0/4
src/import/
73.68%196/26635.71%5/1448.1%38/7976.11%188/247
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/prettify.css b/test/unit/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/test/unit/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/test/unit/coverage/lcov-report/prettify.js b/test/unit/coverage/lcov-report/prettify.js deleted file mode 100644 index ef51e03..0000000 --- a/test/unit/coverage/lcov-report/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/test/unit/coverage/lcov-report/sort-arrow-sprite.png b/test/unit/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd0dbfdac63466a7d7c958b5cbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/test/unit/coverage/lcov-report/src/App.vue.html b/test/unit/coverage/lcov-report/src/App.vue.html deleted file mode 100644 index e58a087..0000000 --- a/test/unit/coverage/lcov-report/src/App.vue.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - Code coverage report for src/App.vue - - - - - - - -
-
-

- all files / src/ App.vue -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
<template>
-  <div id='app'>
-    <chartExample/>
-  </div>
-</template>
- 
-<script>
-import chartExample from './components/chartExample'
- 
-export default {
-  name: 'App',
-  components: {
-    chartExample
-  }
-}
-</script>
- 
-<style>
-#app {
-  font-family: 'Avenir', Helvetica, Arial, sans-serif;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-  text-align: center;
-  color: #2c3e50;
-  margin-top: 60px;
-}
-</style>
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/assets/data/index.html b/test/unit/coverage/lcov-report/src/assets/data/index.html deleted file mode 100644 index 89dbb68..0000000 --- a/test/unit/coverage/lcov-report/src/assets/data/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for src/assets/data/ - - - - - - - -
-
-

- all files src/assets/data/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
pop.js
100%0/0100%0/0100%0/0100%0/0
sales.js
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/assets/data/pop.js.html b/test/unit/coverage/lcov-report/src/assets/data/pop.js.html deleted file mode 100644 index 8b73b81..0000000 --- a/test/unit/coverage/lcov-report/src/assets/data/pop.js.html +++ /dev/null @@ -1,2498 +0,0 @@ - - - - Code coverage report for src/assets/data/pop.js - - - - - - - -
-
-

- all files / src/assets/data/ pop.js -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
 
-export default [
-  {
-    females: 1840000,
-    country: 'United States',
-    age: 0,
-    males: 1923000,
-    year: 1950,
-    total: 3763000,
-  },
-  {
-    females: 1760000,
-    country: 'United States',
-    age: 1,
-    males: 1840000,
-    year: 1950,
-    total: 3600000,
-  },
-  {
-    females: 1682000,
-    country: 'United States',
-    age: 2,
-    males: 1760000,
-    year: 1950,
-    total: 3442000,
-  },
-  {
-    females: 1607000,
-    country: 'United States',
-    age: 3,
-    males: 1682000,
-    year: 1950,
-    total: 3289000,
-  },
-  {
-    females: 1535000,
-    country: 'United States',
-    age: 4,
-    males: 1607000,
-    year: 1950,
-    total: 3142000,
-  },
-  {
-    females: 1467000,
-    country: 'United States',
-    age: 5,
-    males: 1535000,
-    year: 1950,
-    total: 3002000,
-  },
-  {
-    females: 1403000,
-    country: 'United States',
-    age: 6,
-    males: 1467000,
-    year: 1950,
-    total: 2870000,
-  },
-  {
-    females: 1343000,
-    country: 'United States',
-    age: 7,
-    males: 1404000,
-    year: 1950,
-    total: 2747000,
-  },
-  {
-    females: 1288000,
-    country: 'United States',
-    age: 8,
-    males: 1345000,
-    year: 1950,
-    total: 2634000,
-  },
-  {
-    females: 1239000,
-    country: 'United States',
-    age: 9,
-    males: 1292000,
-    year: 1950,
-    total: 2532000,
-  },
-  {
-    females: 1195000,
-    country: 'United States',
-    age: 10,
-    males: 1244000,
-    year: 1950,
-    total: 2439000,
-  },
-  {
-    females: 1156000,
-    country: 'United States',
-    age: 11,
-    males: 1200000,
-    year: 1950,
-    total: 2357000,
-  },
-  {
-    females: 1126000,
-    country: 'United States',
-    age: 12,
-    males: 1167000,
-    year: 1950,
-    total: 2293000,
-  },
-  {
-    females: 1108000,
-    country: 'United States',
-    age: 13,
-    males: 1145000,
-    year: 1950,
-    total: 2253000,
-  },
-  {
-    females: 1099000,
-    country: 'United States',
-    age: 14,
-    males: 1133000,
-    year: 1950,
-    total: 2232000,
-  },
-  {
-    females: 1093000,
-    country: 'United States',
-    age: 15,
-    males: 1125000,
-    year: 1950,
-    total: 2219000,
-  },
-  {
-    females: 1091000,
-    country: 'United States',
-    age: 16,
-    males: 1121000,
-    year: 1950,
-    total: 2212000,
-  },
-  {
-    females: 1099000,
-    country: 'United States',
-    age: 17,
-    males: 1125000,
-    year: 1950,
-    total: 2224000,
-  },
-  {
-    females: 1119000,
-    country: 'United States',
-    age: 18,
-    males: 1138000,
-    year: 1950,
-    total: 2257000,
-  },
-  {
-    females: 1147000,
-    country: 'United States',
-    age: 19,
-    males: 1158000,
-    year: 1950,
-    total: 2305000,
-  },
-  {
-    females: 1177000,
-    country: 'United States',
-    age: 20,
-    males: 1179000,
-    year: 1950,
-    total: 2356000,
-  },
-  {
-    females: 1208000,
-    country: 'United States',
-    age: 21,
-    males: 1202000,
-    year: 1950,
-    total: 2410000,
-  },
-  {
-    females: 1235000,
-    country: 'United States',
-    age: 22,
-    males: 1224000,
-    year: 1950,
-    total: 2459000,
-  },
-  {
-    females: 1256000,
-    country: 'United States',
-    age: 23,
-    males: 1242000,
-    year: 1950,
-    total: 2498000,
-  },
-  {
-    females: 1270000,
-    country: 'United States',
-    age: 24,
-    males: 1258000,
-    year: 1950,
-    total: 2528000,
-  },
-  {
-    females: 1285000,
-    country: 'United States',
-    age: 25,
-    males: 1273000,
-    year: 1950,
-    total: 2558000,
-  },
-  {
-    females: 1301000,
-    country: 'United States',
-    age: 26,
-    males: 1289000,
-    year: 1950,
-    total: 2590000,
-  },
-  {
-    females: 1306000,
-    country: 'United States',
-    age: 27,
-    males: 1295000,
-    year: 1950,
-    total: 2601000,
-  },
-  {
-    females: 1296000,
-    country: 'United States',
-    age: 28,
-    males: 1285000,
-    year: 1950,
-    total: 2581000,
-  },
-  {
-    females: 1277000,
-    country: 'United States',
-    age: 29,
-    males: 1265000,
-    year: 1950,
-    total: 2542000,
-  },
-  {
-    females: 1256000,
-    country: 'United States',
-    age: 30,
-    males: 1245000,
-    year: 1950,
-    total: 2501000,
-  },
-  {
-    females: 1232000,
-    country: 'United States',
-    age: 31,
-    males: 1222000,
-    year: 1950,
-    total: 2454000,
-  },
-  {
-    females: 1213000,
-    country: 'United States',
-    age: 32,
-    males: 1202000,
-    year: 1950,
-    total: 2415000,
-  },
-  {
-    females: 1202000,
-    country: 'United States',
-    age: 33,
-    males: 1191000,
-    year: 1950,
-    total: 2393000,
-  },
-  {
-    females: 1196000,
-    country: 'United States',
-    age: 34,
-    males: 1185000,
-    year: 1950,
-    total: 2381000,
-  },
-  {
-    females: 1187000,
-    country: 'United States',
-    age: 35,
-    males: 1175000,
-    year: 1950,
-    total: 2361000,
-  },
-  {
-    females: 1174000,
-    country: 'United States',
-    age: 36,
-    males: 1162000,
-    year: 1950,
-    total: 2336000,
-  },
-  {
-    females: 1162000,
-    country: 'United States',
-    age: 37,
-    males: 1150000,
-    year: 1950,
-    total: 2311000,
-  },
-  {
-    females: 1151000,
-    country: 'United States',
-    age: 38,
-    males: 1138000,
-    year: 1950,
-    total: 2289000,
-  },
-  {
-    females: 1139000,
-    country: 'United States',
-    age: 39,
-    males: 1127000,
-    year: 1950,
-    total: 2265000,
-  },
-  {
-    females: 1127000,
-    country: 'United States',
-    age: 40,
-    males: 1115000,
-    year: 1950,
-    total: 2242000,
-  },
-  {
-    females: 1119000,
-    country: 'United States',
-    age: 41,
-    males: 1106000,
-    year: 1950,
-    total: 2225000,
-  },
-  {
-    females: 1094000,
-    country: 'United States',
-    age: 42,
-    males: 1083000,
-    year: 1950,
-    total: 2177000,
-  },
-  {
-    females: 1041000,
-    country: 'United States',
-    age: 43,
-    males: 1040000,
-    year: 1950,
-    total: 2081000,
-  },
-  {
-    females: 973000,
-    country: 'United States',
-    age: 44,
-    males: 985000,
-    year: 1950,
-    total: 1958000,
-  },
-  {
-    females: 908000,
-    country: 'United States',
-    age: 45,
-    males: 932000,
-    year: 1950,
-    total: 1840000,
-  },
-  {
-    females: 838000,
-    country: 'United States',
-    age: 46,
-    males: 875000,
-    year: 1950,
-    total: 1713000,
-  },
-  {
-    females: 796000,
-    country: 'United States',
-    age: 47,
-    males: 838000,
-    year: 1950,
-    total: 1634000,
-  },
-  {
-    females: 797000,
-    country: 'United States',
-    age: 48,
-    males: 833000,
-    year: 1950,
-    total: 1630000,
-  },
-  {
-    females: 827000,
-    country: 'United States',
-    age: 49,
-    males: 847000,
-    year: 1950,
-    total: 1674000,
-  },
-  {
-    females: 852000,
-    country: 'United States',
-    age: 50,
-    males: 858000,
-    year: 1950,
-    total: 1710000,
-  },
-  {
-    females: 880000,
-    country: 'United States',
-    age: 51,
-    males: 871000,
-    year: 1950,
-    total: 1751000,
-  },
-  {
-    females: 893000,
-    country: 'United States',
-    age: 52,
-    males: 873000,
-    year: 1950,
-    total: 1766000,
-  },
-  {
-    females: 878000,
-    country: 'United States',
-    age: 53,
-    males: 857000,
-    year: 1950,
-    total: 1735000,
-  },
-  {
-    females: 846000,
-    country: 'United States',
-    age: 54,
-    males: 828000,
-    year: 1950,
-    total: 1674000,
-  },
-  {
-    females: 818000,
-    country: 'United States',
-    age: 55,
-    males: 802000,
-    year: 1950,
-    total: 1620000,
-  },
-  {
-    females: 791000,
-    country: 'United States',
-    age: 56,
-    males: 775000,
-    year: 1950,
-    total: 1566000,
-  },
-  {
-    females: 766000,
-    country: 'United States',
-    age: 57,
-    males: 751000,
-    year: 1950,
-    total: 1517000,
-  },
-  {
-    females: 747000,
-    country: 'United States',
-    age: 58,
-    males: 734000,
-    year: 1950,
-    total: 1481000,
-  },
-  {
-    females: 732000,
-    country: 'United States',
-    age: 59,
-    males: 719000,
-    year: 1950,
-    total: 1451000,
-  },
-  {
-    females: 714000,
-    country: 'United States',
-    age: 60,
-    males: 703000,
-    year: 1950,
-    total: 1416000,
-  },
-  {
-    females: 693000,
-    country: 'United States',
-    age: 61,
-    males: 684000,
-    year: 1950,
-    total: 1377000,
-  },
-  {
-    females: 674000,
-    country: 'United States',
-    age: 62,
-    males: 664000,
-    year: 1950,
-    total: 1338000,
-  },
-  {
-    females: 658000,
-    country: 'United States',
-    age: 63,
-    males: 640000,
-    year: 1950,
-    total: 1298000,
-  },
-  {
-    females: 643000,
-    country: 'United States',
-    age: 64,
-    males: 613000,
-    year: 1950,
-    total: 1256000,
-  },
-  {
-    females: 626000,
-    country: 'United States',
-    age: 65,
-    males: 586000,
-    year: 1950,
-    total: 1213000,
-  },
-  {
-    females: 611000,
-    country: 'United States',
-    age: 66,
-    males: 560000,
-    year: 1950,
-    total: 1171000,
-  },
-  {
-    females: 587000,
-    country: 'United States',
-    age: 67,
-    males: 528000,
-    year: 1950,
-    total: 1115000,
-  },
-  {
-    females: 548000,
-    country: 'United States',
-    age: 68,
-    males: 490000,
-    year: 1950,
-    total: 1038000,
-  },
-  {
-    females: 500000,
-    country: 'United States',
-    age: 69,
-    males: 449000,
-    year: 1950,
-    total: 949000,
-  },
-  {
-    females: 453000,
-    country: 'United States',
-    age: 70,
-    males: 407000,
-    year: 1950,
-    total: 861000,
-  },
-  {
-    females: 405000,
-    country: 'United States',
-    age: 71,
-    males: 365000,
-    year: 1950,
-    total: 770000,
-  },
-  {
-    females: 364000,
-    country: 'United States',
-    age: 72,
-    males: 328000,
-    year: 1950,
-    total: 692000,
-  },
-  {
-    females: 334000,
-    country: 'United States',
-    age: 73,
-    males: 298000,
-    year: 1950,
-    total: 632000,
-  },
-  {
-    females: 311000,
-    country: 'United States',
-    age: 74,
-    males: 275000,
-    year: 1950,
-    total: 586000,
-  },
-  {
-    females: 288000,
-    country: 'United States',
-    age: 75,
-    males: 251000,
-    year: 1950,
-    total: 539000,
-  },
-  {
-    females: 266000,
-    country: 'United States',
-    age: 76,
-    males: 228000,
-    year: 1950,
-    total: 494000,
-  },
-  {
-    females: 242000,
-    country: 'United States',
-    age: 77,
-    males: 206000,
-    year: 1950,
-    total: 448000,
-  },
-  {
-    females: 214000,
-    country: 'United States',
-    age: 78,
-    males: 181000,
-    year: 1950,
-    total: 395000,
-  },
-  {
-    females: 183000,
-    country: 'United States',
-    age: 79,
-    males: 157000,
-    year: 1950,
-    total: 340000,
-  },
-  {
-    females: 134000,
-    country: 'United States',
-    age: 80,
-    males: 134000,
-    year: 1950,
-    total: 134000,
-  },
-  {
-    females: 113000,
-    country: 'United States',
-    age: 81,
-    males: 113000,
-    year: 1950,
-    total: 113000,
-  },
-  {
-    females: 94200,
-    country: 'United States',
-    age: 82,
-    males: 94200,
-    year: 1950,
-    total: 94200,
-  },
-  {
-    females: 79900,
-    country: 'United States',
-    age: 83,
-    males: 79900,
-    year: 1950,
-    total: 79900,
-  },
-  {
-    females: 68700,
-    country: 'United States',
-    age: 84,
-    males: 68700,
-    year: 1950,
-    total: 68700,
-  },
-  {
-    females: 58400,
-    country: 'United States',
-    age: 85,
-    males: 58400,
-    year: 1950,
-    total: 58400,
-  },
-  {
-    females: 49400,
-    country: 'United States',
-    age: 86,
-    males: 49400,
-    year: 1950,
-    total: 49400,
-  },
-  {
-    females: 41200,
-    country: 'United States',
-    age: 87,
-    males: 41200,
-    year: 1950,
-    total: 41200,
-  },
-  {
-    females: 33600,
-    country: 'United States',
-    age: 88,
-    males: 33600,
-    year: 1950,
-    total: 33600,
-  },
-  {
-    females: 26500,
-    country: 'United States',
-    age: 89,
-    males: 26500,
-    year: 1950,
-    total: 26500,
-  },
-  {
-    females: 20700,
-    country: 'United States',
-    age: 90,
-    males: 20700,
-    year: 1950,
-    total: 20700,
-  },
-  {
-    females: 15800,
-    country: 'United States',
-    age: 91,
-    males: 15800,
-    year: 1950,
-    total: 15800,
-  },
-  {
-    females: 11800,
-    country: 'United States',
-    age: 92,
-    males: 11800,
-    year: 1950,
-    total: 11800,
-  },
-  {
-    females: 8620,
-    country: 'United States',
-    age: 93,
-    males: 8620,
-    year: 1950,
-    total: 8620,
-  },
-  {
-    females: 6230,
-    country: 'United States',
-    age: 94,
-    males: 6230,
-    year: 1950,
-    total: 6230,
-  },
-  {
-    females: 4420,
-    country: 'United States',
-    age: 95,
-    males: 4420,
-    year: 1950,
-    total: 4420,
-  },
-  {
-    females: 3150,
-    country: 'United States',
-    age: 96,
-    males: 3150,
-    year: 1950,
-    total: 3150,
-  },
-  {
-    females: 2190,
-    country: 'United States',
-    age: 97,
-    males: 2190,
-    year: 1950,
-    total: 2190,
-  },
-  {
-    females: 1360,
-    country: 'United States',
-    age: 98,
-    males: 1360,
-    year: 1950,
-    total: 1360,
-  },
-  {
-    females: 686,
-    country: 'United States',
-    age: 99,
-    males: 686,
-    year: 1950,
-    total: 686,
-  },
-  {
-    females: 1200,
-    country: 'United States',
-    age: 100,
-    males: 1200,
-    year: 1950,
-    total: 1200,
-  },
-];
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/assets/data/sales.js.html b/test/unit/coverage/lcov-report/src/assets/data/sales.js.html deleted file mode 100644 index 1a0a097..0000000 --- a/test/unit/coverage/lcov-report/src/assets/data/sales.js.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - Code coverage report for src/assets/data/sales.js - - - - - - - -
-
-

- all files / src/assets/data/ sales.js -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
 
-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/test/unit/coverage/lcov-report/src/components/chartExample.vue.html b/test/unit/coverage/lcov-report/src/components/chartExample.vue.html deleted file mode 100644 index 3284dc8..0000000 --- a/test/unit/coverage/lcov-report/src/components/chartExample.vue.html +++ /dev/null @@ -1,554 +0,0 @@ - - - - Code coverage report for src/components/chartExample.vue - - - - - - - -
-
-

- all files / src/components/ chartExample.vue -

-
-
- 0% - Statements - 0/4 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/2 -
-
- 0% - Lines - 0/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
<template>
-  <div class="container">
-    <div class="row">
-      <div class="col">
-        <img class = "logo" src="../assets/img/logo.png">
-        </div>
-    </div>
- 
-    <div class="row">
-      <div class="form-group col-6 col-md-4">
-        <div v-for="(t, index) in sales">
-            <input v-model.number="sales[index].total" type="number"> 
-            <button v-model="sales[index]" type="submit" @click="removeItem(index, $event)"> [-] </button>             
-        </div>
-        <button v-on:click="newItem"> [+] </button>
-      </div>
-      <div class="col-6 col-md-8">
-        <div class="row">
-          <div class="col-12">
-            <v-chart v-bind:chartData="lineGraphData"></v-chart>
-          </div>
-          <div class="col-12 col-lg-6">
-            <v-chart v-bind:chartData="areaChartData"></v-chart>
-          </div>
-          <div class="col-12 col-lg-6">
-            <v-chart v-bind:chartData="barChartData"></v-chart>
-          </div>
-          <div class="col-12 col-lg-6">
-            <v-chart v-bind:chartData="vBarChartData"></v-chart>
-          </div>
-          <div class="col-12 col-lg-6">
-            <v-chart v-bind:chartData="pieChartData"></v-chart>
-          </div>
-        </div>  
-      </div>
-    </div>
-    <a href="https://github.com/ignoreintuition/v-chart-plugin"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
-  </div>
-</template>
- 
-<script>
-import sales from "../assets/data/sales";
- 
-export default {
-  name: "barChartExample",
-  methods: {
-    newItem: function(){
-      this.sales.push({
-        "month": null,
-        "year": null,
-        "total": null,
-        "actual": false
-      })
-    },
-    removeItem: function(d, e){
-      e.preventDefault();
-      this.sales.splice(d, 1)
-    }
-  },
-  data() {
-    return {
-      sales: sales,
-      areaChartData: {
-        chartType: "areaChart",
-        selector: "areaChart",
-        title: "Area Chart",
-        width: 300,
-        height: 200,
-        metric: ["total"],
-        dim: "month",
-        data: sales,
-        legends: {
-          enabled: true,
-          height: 25,
-          width: 50
-        },                      
-      },
-      barChartData: {
-        chartType: "barChart",
-        selector: "chart",
-        title: "Bar Chart",
-        subtitle: "Sales by month",
-        height: 200,
-        metric: "total",
-        dim: "month",
-        data: sales,
-        legends: {
-          enabled: true,
-          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: sales,
-        legends: {
-          enabled: true,
-          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: sales,
-        legends: {
-          enabled: true,
-          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: sales,
-      },
-      scatterPlotData: {
-        chartType: "scatterPlot",
-        selector: "scatterPlot",
-        title: "Scatter Plot",
-        subtitle: "Sales by month",
-        width: 300,
-        height: 200,
-        metric: "total",
-        dim: "month",
-        data: sales,
-        legends: {
-          enabled: true,
-          height: 25,
-          width: 50
-        },              
-      }
-      
-    };
-  }
-};
-</script>
- 
-<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style> 
-  .logo {
-    width: 200px
-  }
-</style>
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/components/index.html b/test/unit/coverage/lcov-report/src/components/index.html deleted file mode 100644 index 784c4f4..0000000 --- a/test/unit/coverage/lcov-report/src/components/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for src/components/ - - - - - - - -
-
-

- all files src/components/ -

-
-
- 0% - Statements - 0/4 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/2 -
-
- 0% - Lines - 0/4 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
chartExample.vue
0%0/4100%0/00%0/20%0/4
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/import/areaChart.js.html b/test/unit/coverage/lcov-report/src/import/areaChart.js.html deleted file mode 100644 index f66eec1..0000000 --- a/test/unit/coverage/lcov-report/src/import/areaChart.js.html +++ /dev/null @@ -1,488 +0,0 @@ - - - - Code coverage report for src/import/areaChart.js - - - - - - - -
-
-

- all files / src/import/ areaChart.js -

-
-
- 82.22% - Statements - 37/45 -
-
- 50% - Branches - 1/2 -
-
- 66.67% - Functions - 8/12 -
-
- 83.33% - Lines - 35/42 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  - - - -  -  -  -  -  -  - - -  -  - - - -  - - -  -  -  -  -  -  - - -  -  - - - - - -  -  - -  -  -  -  -  - - - - - - -  - -  -  -  - 
/** 
- *  @fileOverview Area chart component definition
- *
- *  @author       Brian Greig
- *
- *  @requires     NPM:d3:Vue
- *  @requires     src/v-chart-plugin.js
- */
- 
- /* eslint-env browser */
-const d3 = Object.assign({},
-  require('d3-selection'),
-  require('d3-scale'),
-  require('d3-axis'),
-  require('d3-shape'));
-/**
- * Builds an Area Chart.
- * @module areaChart
- */
-const areaChart = function chart() {
-  /**
-   * The SVG that stores the chart
-   * @member svgContainer
-   */
-  const svgContainer = d3.select(`#${this.chartData.selector}`);
-  /**
-   * The configuration of the coordinate system
-   * @member cs
-   */
-  let cs = {
-    palette: {
-      stroke: '#d1f4fa',
-      fill: '#005792',
-    },
-    x: {
-      domain: [],
-      range: [],
-      axisHeight: 45,
-      axisWidth: 45,
-    },
-    y: {
-      axisWidth: 45,
-    },
-  };
-  /**
-   * Returns plot points  
-   * @member getPoints
-   * @function
-   * @param {Object} p
-   */
-  const getPoints = (p) => {
-    let poly = (` ${this.width}, ${cs.x.yOffset} `);
-    poly += (` ${cs.x.axisHeight}, ${cs.x.yOffset} `);
-    poly += p.map(d => [cs.x.scale(d.dim) + cs.y.axisWidth + 5, cs.y.scale(d.metric)].join(',')).join(' ');
-    return poly;
-  };
- 
-  const poly = svgContainer.selectAll('polygon').data([this.ds]);
- 
-  /**
-   * Runs when a new element is added to the dataset
-   * @member enter
-   * @function
-   * @param {Object} s (svg element)
-   */
-  const enter = (s) => {
-    s.enter()
-      .append('polygon')
-      .attr('stroke', cs.palette.stroke)
-      .attr('fill', cs.palette.fill)
-      .attr('points', getPoints);
-  };
-  /**
-   * Runs when a value of an element in dataset is changed
-   * @member transition
-   * @function
-   * @param {Object} s (svg element)
-   */
-  const transition = (s) => {
-    s.transition()
-      .attr('points', getPoints);
-  };
-  /**
-   * Runs when an element is removed from the dataset
-   * @member exit
-   * @function
-   * @param {Object} s (svg element)
-   */
-  const exit = (s) => {
-    s.exit().remove();
-    return s;
-  };
-  /**
-   * Builds the scales for the x and y axes
-   * @member buildScales
-   * @function
-   */
-  const buildScales = () => {
-    cs.y.scale = d3.scaleLinear()
-      .domain([0, this.max])
-      .range([this.displayHeight - cs.x.axisHeight, this.titleHeight]);
-    cs.y.axis = d3.axisLeft().ticks(10, '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 - cs.x.axisWidth) * i)) / this.ds.length));
-    cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);
-    cs.x.axis = d3.axisBottom().scale(cs.x.scale);
-  };
-  /**
-   * Draws the x and y axes on the svg
-   * @member drawAxis
-   * @function
-   */
-  const drawAxis = () => {
-    cs.polyFunction = d3.line()
-      .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
-      .y(d => cs.y.scale(d.metric));
-    cs.x.xOffset = cs.y.axisWidth + 5;
-    cs.x.yOffset = this.displayHeight - cs.x.axisHeight;
-    cs.y.xOffset = cs.y.axisWidth;
-    cs.y.yOffset = 0;
-    svgContainer.append('g').append('g')
-      .attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)
-      .call(cs.x.axis);
-    Iif (this.ds[0].dim)
-      svgContainer.append('g').append('g').attr('class', 'axis')
-        .attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)
-        .call(cs.y.axis);
-  };
-  
-  cs = this.setOverrides(cs, this.chartData.overrides);
-  buildScales(cs);
-  drawAxis(cs);
-  enter(poly);
-  transition(poly);
-  exit(poly);
- 
-  return cs;
-};
- 
-export default areaChart;
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/import/barChart.js.html b/test/unit/coverage/lcov-report/src/import/barChart.js.html deleted file mode 100644 index d6327d8..0000000 --- a/test/unit/coverage/lcov-report/src/import/barChart.js.html +++ /dev/null @@ -1,653 +0,0 @@ - - - - Code coverage report for src/import/barChart.js - - - - - - - -
-
-

- all files / src/import/ barChart.js -

-
-
- 84.62% - Statements - 44/52 -
-
- 25% - Branches - 2/8 -
-
- 57.14% - Functions - 8/14 -
-
- 89.36% - Lines - 42/47 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - - -  -  -  -  - -  -  -  -  -  -  -  - - - -  -  -  -  -  -  - - -  -  - - -  - -  -  -  -  -  -  - - - - - - - - -  - -  -  -  -  -  -  -  -  - -  -  -  - -  - - -  -  - - - - - -  - -  -  -  - 
/** 
- *  @fileOverview Bar chart component definition
- *
- *  @author       Brian Greig
- *
- *  @requires     NPM:d3:Vue
- *  @requires     src/v-chart-plugin.js
- */
- 
- /* eslint-env browser */
-const d3 = Object.assign({},
-  require('d3-selection'),
-  require('d3-scale'),
-  require('d3-axis'),
-  require('d3-ease'));
-/**
- * Builds a Bar Chart.
- * @module barChart
- */
- 
-const barChart = function chart() {
-  /**
-   * The SVG that stores the chart
-   * @member svgContainer
-   */
-  const svgContainer = d3.select(`#${this.chartData.selector}`);
-  /**
-   * The configuration of the coordinate system
-   * @member cs
-   */
-  let cs = {
-    palette: {
-      fill: '#005792',
-      stroke: '#d1f4fa',
-    },
-    bar: {
-      hPadding: 8,
-      vPadding: 5,
-    },
-    x: {
-      axisHeight: 10,
-      ticks: 5,
-    },
-    y: {
-      domain: [],
-      range: [],
-      axisWidth: null,
-    },
-  };
- 
-  /**
-   * Returns width of the bar
-   * @member getWidth
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const getWidth = d => cs.x.scale(d.metric);
- 
-  /**
-   * Returns height of the bar
-   * @member getHeight
-   * @function
-   */
-  const getHeight = () => (
-    this.displayHeight - cs.x.axisHeight - this.header - cs.bar.vPadding) / this.ds.length - 1;
- 
-  /**
-   * Returns y axis co-ordinate of the bar
-   * @member getYCoord
-   * @function
-   * @param {Object} d (svg element)
-   * @param {Object} i (svg element)
-   */
-  const getYCoord = (d, i) => i * (
-    this.displayHeight - cs.x.axisHeight - this.header) / this.ds.length + 1 + this.header;
- 
-  /**
-   * Adds a tooltip on mouse over
-   * @member mouseOver
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const mouseOver = (d) => {
-    this.addTooltip(d, window.event);
-  };
- 
-  /**
-   * Removes tooltip on mouse out
-   * @member mouseOut
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const mouseOut = (d) => {
-    this.removeTooltip(d);
-  };
-  /**
-   * Runs when a new element is added to the dataset
-   * @member enter
-   * @function
-   * @param {Object} rects (svg element)
-   */
-  const enter = (rects) => {
-    rects.enter()
-      .append('rect')
-      .attr('fill', cs.palette.fill)
-      .attr('stroke', cs.palette.stroke)
-      .attr('class', this.selector)
-      .attr('width', getWidth)
-      .attr('height', getHeight)
-      .attr('y', getYCoord)
-      .attr('x', cs.y.axisWidth + cs.bar.hPadding)
-      .on('mouseover', mouseOver)
-      .on('mouseout', mouseOut);
-    return rects;
-  };
-  /**
-   * Runs when a value of an element in dataset is changed
-   * @member transition
-   * @function
-   * @param {Object} rects (svg element)
-   */
-  const transition = (rects) => {
-    rects.transition()
-      .attr('width', getWidth)
-      .attr('height', getHeight)
-      .attr('y', getYCoord)
-      .attr('x', cs.y.axisWidth + cs.bar.hPadding);
-    return rects;
-  };
-  /**
-   * Runs when an element is removed from the dataset
-   * @member exit
-   * @function
-   * @param {Object} rect (svg element)
-   */
-  const exit = (rects) => {
-    rects.exit().remove();
-    return rects;
-  };
-  /**
-   * Builds the scales for the x and y axes
-   * @member buildScales
-   * @function
-   */
-  const buildScales = () => {
-    cs.x.scale = d3.scaleLinear()
-      .domain([0, this.max])
-      .range([0, this.width - cs.bar.hPadding - cs.y.axisWidth]);
-    this.ds.forEach(t => cs.y.domain.push(t.dim));
-    this.ds.forEach((t, i) => cs.y.range.push(((
-      this.displayHeight - cs.x.axisHeight - this.header + cs.bar.vPadding) * i) / this.ds.length));
-    cs.y.scale = d3.scaleOrdinal().domain(cs.y.domain).range(cs.y.range);
-  };
-  /**
-   * Draws the x and y axes on the svg
-   * @member drawAxis
-   * @function
-   */
-  const drawAxis = () => {
-    cs.x.axis = d3.axisBottom().ticks(cs.x.ticks, 's').scale(cs.x.scale);
-    cs.y.axis = d3.axisLeft().scale(cs.y.scale);
-    cs.x.yOffset = this.displayHeight - cs.x.axisHeight;
-    cs.x.xOffset = cs.bar.hPadding + cs.y.axisWidth;
-    cs.y.yOffset = cs.bar.vPadding + this.header - 1;
-    cs.y.xOffset = cs.y.axisWidth;
-    Iif (this.ds[0].dim)
-      svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`).call(cs.y.axis);
-    svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`).call(cs.x.axis);
-  };
-  /**
-   * Get the maximum dimension length
-   * @member getMaxDimLength
-   * @function
-   * @param {number} accumulator
-   * @param {number} currentValue
-   */
-  const getMaxDimLength = (accumulator, currentValue) => {
-    return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator;
-  }
- 
-  const rects = svgContainer.selectAll('rect').data(this.ds);
- 
-  cs = this.setOverrides(cs, this.chartData.overrides);
-  Iif (this.ds[0].dim)
-    cs.y.axisWidth = cs.y.axisWidth || (this.ds.reduce(getMaxDimLength, 0)) * 10;
- 
-  buildScales(cs);
-  drawAxis(cs);
-  enter(rects);
-  transition(rects);
-  exit(rects);
- 
-  return cs;
-};
- 
-export default barChart;
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/import/index.html b/test/unit/coverage/lcov-report/src/import/index.html deleted file mode 100644 index ed68f2e..0000000 --- a/test/unit/coverage/lcov-report/src/import/index.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - Code coverage report for src/import/ - - - - - - - -
-
-

- all files src/import/ -

-
-
- 73.68% - Statements - 196/266 -
-
- 35.71% - Branches - 5/14 -
-
- 48.1% - Functions - 38/79 -
-
- 76.11% - Lines - 188/247 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
areaChart.js
82.22%37/4550%1/266.67%8/1283.33%35/42
barChart.js
84.62%44/5225%2/857.14%8/1489.36%42/47
lineGraph.js
23.4%11/47100%0/06.67%1/1524.44%11/45
pieChart.js
90%27/3050%1/262.5%5/893.1%27/29
scatterPlot.js
82.22%37/45100%0/050%8/1681.4%35/43
vBarChart.js
85.11%40/4750%1/257.14%8/1492.68%38/41
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/import/lineGraph.js.html b/test/unit/coverage/lcov-report/src/import/lineGraph.js.html deleted file mode 100644 index f8034c7..0000000 --- a/test/unit/coverage/lcov-report/src/import/lineGraph.js.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - Code coverage report for src/import/lineGraph.js - - - - - - - -
-
-

- all files / src/import/ lineGraph.js -

-
-
- 23.4% - Statements - 11/47 -
-
- 100% - Branches - 0/0 -
-
- 6.67% - Functions - 1/15 -
-
- 24.44% - Lines - 11/45 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
/** 
- *  @fileOverview Line Graph component definition
- *
- *  @author       Brian Greig
- *
- *  @requires     NPM:d3:Vue
- *  @requires     src/v-chart-plugin.js
- */
-const d3 = Object.assign({},
-  require('d3-selection'),
-  require('d3-scale'),
-  require('d3-axis'),
-  require('d3-shape'));
-/**
- * Builds a Line Graph.
- * @module lineGraph
- */
- 
-const lineGraph = function chart(mode) {
-  /**
-   * The SVG that stores the chart
-   * @member svgContainer
-   */
-  const svgContainer = d3.select(`#${this.chartData.selector}`);
-  /**
-   * The configuration of the coordinate system
-   * @member cs
-   */
-  let cs = {
-    palette: {
-      lineFill: ['#ffcdcd', '#005792'],
-      pointFill: '#005792',
-      pointStroke: '#d1f4fa',
-    },
-    x: {
-      domain: [],
-      range: [],
-      axisHeight: 20,
-    },
-    y: {
-      axisWidth: 30,
-      ticks: 5,
-    },
-  };
- 
-  /**
-   * Runs when a new element is added to the dataset
-   * @member enter
-   * @function
-   * @param {Object} points (svg element) 
-   */
-  const enter = (points, path) => {
-    this.metric.forEach( (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)
-    })    
-        
-    // 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
-   * @member transition
-   * @function
-   * @param {Object} points (svg element) 
-   */
-  const transition = (points, path) => {
-    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;
-  };
- 
-  /**
-   * Runs when an element is removed from the dataset
-   * @member exit
-   * @function
-   * @param {Object} points (svg element)
-   */
-  const exit = (points, path) => {
-    points.exit().remove();
-    this.metric.forEach( (e, i) => {
-      path[i].exit().remove();
-    })
-    return points;
-  };
- 
-  /**
-   * Builds the scales for the x and y axes
-   * @member buildScales
-   * @function
-   */
-  const buildScales = cs => {
-    cs.y.scale = d3.scaleLinear()
-      .domain([this.min, this.max])
-      .range([this.displayHeight - cs.x.axisHeight, this.header]);
-    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);
-  };
-  /**
-   * Draws the x and y axes on the svg
-   * @member drawAxis
-   * @function
-   */
-  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 = [];
-  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 = []
-  this.metric.forEach( (e, i) => {
-    path.push(svgContainer.selectAll('path#p' + i).data(this.ds))
-  })
- 
-  cs = this.setOverrides(cs, this.chartData.overrides);
- 
-  buildScales(cs);
-  drawAxis(cs);
-  enter(points, path);
-  transition(points, path);
-  exit(points, path);
- 
-  return cs;
-};
- 
-export default lineGraph;
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/import/pieChart.js.html b/test/unit/coverage/lcov-report/src/import/pieChart.js.html deleted file mode 100644 index a676b11..0000000 --- a/test/unit/coverage/lcov-report/src/import/pieChart.js.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - Code coverage report for src/import/pieChart.js - - - - - - - -
-
-

- all files / src/import/ pieChart.js -

-
-
- 90% - Statements - 27/30 -
-
- 50% - Branches - 1/2 -
-
- 62.5% - Functions - 5/8 -
-
- 93.1% - Lines - 27/29 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  - -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - - -  -  - -  -  -  -  -  -  -  - - - -  -  - -  - -  - -  -  - - - - -  - -  -  -  - 
/** 
- *  @fileOverview Pie Chart component definition
- *
- *  @author       Brian Greig
- *
- *  @requires     NPM:d3:Vue
- *  @requires     src/v-chart-plugin.js
- */
- 
- /* eslint-env browser */
-const d3 = Object.assign({},
-  require('d3-selection'),
-  require('d3-scale'),
-  require('d3-axis'),
-  require('d3-shape'));
-/**
- * Builds an Pie Chart.
- * @module pieChart
- */
- 
-const pieChart = function chart() {
-  /**
-   * The SVG that stores the chart
-   * @member svgContainer
-   */
-  const svgContainer = d3.select(`#${this.chartData.selector}`);
-  /**
-   * The configuration of the coordinate system
-   * @member cs
-   */
-  let cs = {
-    radius: null,
-    ordinalColors: ['#d1f4fa', '#005792', '#ffe6eb', '#ffcdcd'],
-  };
-  cs.radius = this.height > this.width ? (
-    this.width - this.width * 0.1) / 2 : (this.height - this.height * 0.1) / 2;
- 
-  const color = d3.scaleOrdinal()
-    .range(cs.ordinalColors);
- 
-  /**
-   * Returns colors for pie chart
-   * @member getColor
-   * @function
-   */
-  const getColor = (d, i) => color(i);
- 
-  /**
-   * Adds a tooltip on mouse over
-   * @member mouseOver
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const mouseOver = (d) => {
-    this.addTooltip(d.data, window.event);
-  };
- 
-  /**
-   * Removes tooltip on mouse out
-   * @member mouseOut
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const mouseOut = (d) => {
-    this.removeTooltip(d);
-  };
- 
-  const path = d3.arc()
-    .outerRadius(cs.radius - 10)
-    .innerRadius(25);
- 
-  /**
-   * Runs when a new element is added to the dataset
-   * @member enter
-   * @function
-   * @param {Object} arc (svg element)
-   */
-  const enter = (arc) => {
-    arc.enter()
-      .append('g')
-      .attr('transform', `translate(${this.width / 2},${this.height / 2})`)
-      .append('path')
-      .merge(arc)
-      .attr('class', 'arc')
-      .attr('d', path)
-      .attr('fill', getColor)
-      .on('mouseover', mouseOver)
-      .on('mouseout', mouseOut)
-      .attr('transform', `translate(0,${this.header})`);
-    return arc;
-  };
-  /**
-   * Runs when a value of an element in dataset is changed
-   * @member transition
-   * @function
-   * @param {Object} arc (svg element)
-   */
-  const transition = (arc) => {
-    arc.transition()
-      .attr('d', path)
-      .attr('fill', getColor);
-    return arc;
-  };
-  /**
-   * Runs when an element is removed from the dataset
-   * @member exit
-   * @function
-   * @param {Object} arc (svg element)
-   */
-  const exit = (arc) => {
-    arc.exit().remove();
-    return arc;
-  };
- 
-  const pie = d3.pie()
-    .sort(null)
-    .value(d => d.metric);
- 
-  const arc = svgContainer.selectAll('.arc')
-    .data(pie(this.ds));
- 
-  cs = this.setOverrides(cs, this.chartData.overrides);
-  enter(arc);
-  transition(arc);
-  exit(arc);
- 
-  return cs;
-};
- 
-export default pieChart;
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html b/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html deleted file mode 100644 index f4e3477..0000000 --- a/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Code coverage report for src/import/scatterPlot.js - - - - - - - -
-
-

- all files / src/import/ scatterPlot.js -

-
-
- 82.22% - Statements - 37/45 -
-
- 100% - Branches - 0/0 -
-
- 50% - Functions - 8/16 -
-
- 81.4% - Lines - 35/43 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - - -  -  -  -  - -  -  -  -  -  -  -  - - - -  -  -  -  -  -  - - -  -  - - - - -  -  -  -  -  -  - - - - - - - - -  -  - - - - - - -  - -  -  -  - 
/** 
- *  @fileOverview Scatter Plot component definition
- *
- *  @author       Brian Greig
- *
- *  @requires     NPM:d3:Vue
- *  @requires     src/v-chart-plugin.js
- */
- 
- /* eslint-env browser */
-const d3 = Object.assign({},
-  require('d3-selection'),
-  require('d3-scale'),
-  require('d3-axis'));
-/**
- * Builds a Scatter Plot.
- * @module scatterPlot
- */
- 
-const scatterPlot = function chart() {
-  /**
-   * The SVG that stores the chart
-   * @member svgContainer
-   */
-  const svgContainer = d3.select(`#${this.chartData.selector}`);
-  /**
-   * The configuration of the coordinate system
-   * @member cs
-   */
-  let cs = {
-    x: {
-      domain: [],
-      range: [],
-      axisHeight: 20,
-    },
-    y: {
-      axisWidth: 30,
-      ticks: 5,
-    },
-  };
-  const points = svgContainer.selectAll('circle').data(this.ds);
-  /**
-   * Runs when a new element is added to the dataset
-   * @member enter
-   * @function
-   * @param {Object} p (svg element)
-   */
-  const enter = (p) => {
-    p.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;
-  };
-  /**
-   * Runs when a value of an element in dataset is changed
-   * @member transition
-   * @function
-   * @param {Object} p (svg element)
-   */
-  const transition = (p) => {
-    p.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;
-  };
-  /**
-   * Runs when an element is removed from the dataset
-   * @member exit
-   * @function
-   * @param {Object} rect (svg element)
-   */
-  const exit = () => {
-    points.exit().remove();
-    return points;
-  };
-  /**
-   * Builds the scales for the x and y axes
-   * @member buildScales
-   * @function
-   */
-  const buildScales = () => {
-    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);
-  };
-  /**
-   * Draws the x and y axes on the svg
-   * @member drawAxis
-   * @function
-   */
-  const drawAxis = () => {
-    cs.x.axis = d3.axisBottom().scale(cs.x.scale);
-    cs.x.xOffset = cs.y.axisWidth + 5;
-    cs.x.yOffset = this.height - cs.x.axisHeight;
-    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 = this.setOverrides(cs, this.chartData.overrides);
-  buildScales(cs);
-  drawAxis(cs);
-  enter(points);
-  transition(points);
-  exit(points);
- 
-  return cs;
-};
- 
-export default scatterPlot;
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/import/vBarChart.js.html b/test/unit/coverage/lcov-report/src/import/vBarChart.js.html deleted file mode 100644 index ffc343e..0000000 --- a/test/unit/coverage/lcov-report/src/import/vBarChart.js.html +++ /dev/null @@ -1,635 +0,0 @@ - - - - Code coverage report for src/import/vBarChart.js - - - - - - - -
-
-

- all files / src/import/ vBarChart.js -

-
-
- 85.11% - Statements - 40/47 -
-
- 50% - Branches - 1/2 -
-
- 57.14% - Functions - 8/14 -
-
- 92.68% - Lines - 38/41 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - - -  -  - - -  - -  -  -  -  -  -  - - - - - - - - -  -  - -  -  -  -  -  - -  - - - - - - -  - -  -  -  - 
/** 
- *  @fileOverview Verticle Bar Chart component definition
- *
- *  @author       Brian Greig
- *
- *  @requires     NPM:d3:Vue
- *  @requires     src/v-chart-plugin.js
- */
- 
- const d3 = Object.assign({},
-  require('d3-selection'),
-  require('d3-scale'),
-  require('d3-axis'),
-  require('d3-transition'));
-/**
- * Builds a Verticle Bar Chart.
- * @module vBarChart
- */
- 
-const vBarChart = function chart() {
-  /**
-   * The SVG that stores the chart
-   * @member svgContainer
-   */
-  const svgContainer = d3.select(`#${this.chartData.selector}`);
-  /**
-   * The configuration of the coordinate system
-   * @member cs
-   */
-  let cs = {
-    palette: {
-      fill: '#005792',
-      stroke: '#d1f4fa',
-    },
-    bar: {
-      hPadding: 0,
-      vPadding: 0,
-    },
-    x: {
-      axisHeight: 20,
-      domain: [],
-      range: [],
-    },
-    y: {
-      axisWidth: 30,
-      ticks: 5,
-    },
-  };
-  /**
-   * Returns width of the bar
-   * @member getWidth
-   * @function
-   */
- 
-  const getWidth = () => ((this.width - cs.y.axisWidth) / this.chartData.data.length - 1);
- 
-  /**
-   * Returns height of the bar
-   * @member getHeight
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const getHeight = d => this.displayHeight - cs.y.scale(d.metric);
- 
-  /**
-   * Returns x axis co-ordinate of the bar
-   * @member getXCoord
-   * @function
-   * @param {Object} d (svg element)
-   * @param {Object} i (svg element)
-   */
-  const getXCoord = (d, i) => (
-    i * (this.width - cs.y.axisWidth) / this.chartData.data.length) + cs.y.axisWidth;
-  /**
-   * Returns y axis co-ordinate of the bar
-   * @member getYCoord
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const getYCoord = d => cs.y.scale(d.metric);
- 
-  /**
-   * Adds a tooltip on mouse over
-   * @member mouseOver
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const mouseOver = (d) => {
-    this.addTooltip(d, window.event);
-  };
- 
-  /**
-   * Removes tooltip on mouse out
-   * @member mouseOut
-   * @function
-   * @param {Object} d (svg element)
-   */
-  const mouseOut = (d) => {
-    this.removeTooltip(d);
-  };
- 
-  /**
-   * Runs when a new element is added to the dataset
-   * @member enter
-   * @function
-   * @param {Object} rects (svg element)
-   */
-  const enter = (rects) => {
-    rects.enter()
-      .append('rect')
-      .attr('fill', cs.palette.fill)
-      .attr('stroke', cs.palette.stroke)
-      .attr('class', this.selector)
-      .attr('width', getWidth)
-      .attr('height', getHeight)
-      .attr('x', getXCoord)
-      .attr('y', getYCoord)
-      .on('mouseover', mouseOver)
-      .on('mouseout', mouseOut);
-  };
-  /**
-   * Runs when a value of an element in dataset is changed
-   * @member transition
-   * @function
-   * @param {Object} rects (svg element)
-   */
-  const transition = (rects) => {
-    rects.transition()
-      .attr('width', getWidth)
-      .attr('height', getHeight)
-      .attr('x', getXCoord)
-      .attr('y', getYCoord);
-  };
-  /**
-   * Runs when an element is removed from the dataset
-   * @member exit
-   * @function
-   * @param {Object} rects (svg element)
-   */
-  const exit = (rects) => {
-    rects.exit().remove();
-  };
-  /**
-   * Builds the scales for the x and y axes
-   * @member buildScales
-   * @function
-   */
-  const buildScales = () => {
-    cs.y.scale = d3.scaleLinear()
-      .domain([0, this.max])
-      .range([this.displayHeight, this.header]);
-    this.ds.forEach(t => cs.x.domain.push(t.dim));
-    this.ds.forEach((t, i) => cs.x.range.push(((
-      this.chartData.width - cs.y.axisWidth + cs.bar.vPadding) * i) / this.ds.length));
-    cs.x.scale = d3.scaleOrdinal().domain(cs.x.domain).range(cs.x.range);
-  };
-  /**
-   * Draws the x and y axes on the svg
-   * @member drawAxis
-   * @function
-   */
-  const drawAxis = () => {
-    cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale);
-    cs.x.axis = d3.axisBottom().scale(cs.x.scale);
-    cs.x.yOffset = this.displayHeight;
-    cs.x.xOffset = cs.y.axisWidth;
-    cs.y.yOffset = 0;
-    cs.y.xOffset = cs.y.axisWidth;
-    svgContainer.append('g').attr('class', 'axis')
-      .attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`)
-      .call(cs.y.axis);
-    Iif (this.ds[0].dim)
-      svgContainer.append('g').attr('class', 'axis')
-        .attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`)
-        .call(cs.x.axis);
-  };
- 
-  const rects = svgContainer.selectAll('rect').data(this.ds);
- 
-  cs = this.setOverrides(cs, this.chartData.overrides);
-  buildScales(cs);
-  drawAxis(cs);
-  enter(rects);
-  transition(rects);
-  exit(rects);
- 
-  return cs;
-};
- 
-export default vBarChart;
- 
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/index.html b/test/unit/coverage/lcov-report/src/index.html deleted file mode 100644 index 2024c8f..0000000 --- a/test/unit/coverage/lcov-report/src/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for src/ - - - - - - - -
-
-

- all files src/ -

-
-
- 75% - Statements - 51/68 -
-
- 66.67% - Branches - 32/48 -
-
- 85.71% - Functions - 6/7 -
-
- 75.38% - Lines - 49/65 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
App.vue
100%0/0100%0/0100%0/0100%0/0
v-chart-plugin.js
75%51/6866.67%32/4885.71%6/775.38%49/65
-
-
- - - - - - - diff --git a/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html b/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html deleted file mode 100644 index 12db272..0000000 --- a/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html +++ /dev/null @@ -1,986 +0,0 @@ - - - - Code coverage report for src/v-chart-plugin.js - - - - - - - -
-
-

- all files / src/ v-chart-plugin.js -

-
-
- 75% - Statements - 51/68 -
-
- 66.67% - Branches - 32/48 -
-
- 85.71% - Functions - 6/7 -
-
- 75.38% - Lines - 49/65 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  - -  -  - -  -  -  -  -  -  -  -  -  - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -15× - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  - - -  - -10× -  -  -10× -10× -  -10× -10× -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - - - - -  - - -  - -  -  -  -  -  -  -  - - - - -  - -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - 
/** 
- *  @fileOverview Chart component containing all of the generic components required for charts
- *
- *  @author       Brian Greig
- *
- *  @requires     NPM:d3:Vue
- */
- 
-/* eslint-env browser */
-import barChart from './import/barChart';
-import vBarChart from './import/vBarChart';
-import lineGraph from './import/lineGraph';
-import scatterPlot from './import/scatterPlot';
-import pieChart from './import/pieChart';
-import areaChart from './import/areaChart';
- 
-const d3 = Object.assign({},
-  require('d3-selection'));
- 
-/**
- *  Chart is the generic component used for any chart type
- *  @namespace
- */
-  
-const Chart = {
-  install(Vue) {
-    Vue.component('v-chart', {
-      props: ['chartData'],
-      data() {
-        return {
-          selector: `${this.chartData.selector}-${this.chartData.chartType}`,
-        };
-      },
-      methods: {
-        /**
-         * Generate a new Chart of type chartType
-         * @memberOf Chart
-         */
-        initalizeChart() {
-          const cs = this[this.chartData.chartType]('init');
-          this.drawTitle();
-          this.generateLegend(cs);
-        },
-        /**
-         * Redraw the Chart when the data is recycled
-         * @memberOf Chart
-         */
-        refreshChart() {
-          this.clearAxis();
-          this[this.chartData.chartType]('refresh');
-        },
-        /**
-         * Remove x and y axes
-         * @memberOf Chart
-         */
-        clearAxis() {
-          d3.select(`#${this.chartData.selector}`).selectAll('.axis').remove();
-        },
-        /**
-         * Remove all content from the SVG
-         * @memberOf Chart
-         */
-        clearCanvas() {
-          d3.select(`#${this.chartData.selector}`).selectAll('*').remove();
-        },
-        /**
-         * Appends title and subtitle to the chart
-         * @memberOf Chart
-         */
-        drawTitle() {
-          d3.select(`#${this.chartData.selector}`)
-            .append('text')
-            .attr('x', this.width / 2)
-            .attr('y', this.titleHeight - this.titleHeight * 0.1)
-            .style('text-anchor', 'middle')
-            .text(this.chartData.title);
- 
-          d3.select(`#${this.chartData.selector}`)
-            .append('text')
-            .attr('x', this.width / 2)
-            .attr('y', this.titleHeight - this.titleHeight * 0.1 + this.subtitleHeight)
-            .style('text-anchor', 'middle')
-            .text(this.chartData.subtitle);
-        },
-        /**
-         * Adds a tooltip to the SVG
-         * @memberOf Chart
-         * @param {Object} d dataset
-         * @param {Object} e event x and y coordinates
-         */
-        addTooltip(d, e) {
-          d3.select(`#${this.chartData.selector}`)
-            .append('rect')
-            .attr('x', e.layerX - 5 - 50)
-            .attr('y', e.layerY - 13 - 25)
-            .attr('height', '16px')
-            .attr('width', '80px')
-            .attr('class', 'tt')
-            .attr('fill', 'white');
- 
-          d3.select(`#${this.chartData.selector}`)
-            .append('text')
-            .attr('x', e.layerX - 50)
-            .attr('y', e.layerY - 25)
-            .attr('class', 'tt')
-            .attr('font-size', '10px')
-            .text(`${d.dim}:${d.metric}`);
-        },
-        /**
-         * Removes all tooltips from the SVG
-         * @memberOf Chart
-         * @param {Object} d dataset
-         */
-        removeTooltip() {
-          d3.select(`#${this.chartData.selector}`)
-            .selectAll('.tt').remove();
-        },
-        /**
-         * Override default values 
-         * @param {Object} cs configuration of the coordinate systems
-         * @param {Object} overrides the additional values that can be used for an object
-         * @returns {Object} updated configuration of coordinate system 
-         */
-        setOverrides(cs, overrides) {
-          overrides = overrides || {};
-          const keys = Object.keys(cs);
-          for (const key of keys)
-            Object.assign(cs[key], overrides[key]);
-          return cs;
-        },
-        /**
-         * Generate legend if option -legends- defined as true
-         * @memberOf Chart
-         * @param {Object} cs configuration of the coordinate system
-         */
-        generateLegend(cs) {
-          Iif (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[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 () {
-                const fill = cs.palette.lineFill || cs.palette.fill;
-                return fill;
-              });
-          }
-        },
- 
-        ...((typeof barChart !== 'undefined') && { barChart }),
-        ...((typeof vBarChart !== 'undefined') && { vBarChart }),
-        ...((typeof scatterPlot !== 'undefined') && { scatterPlot }),
-        ...((typeof pieChart !== 'undefined') && { pieChart }),
-        ...((typeof areaChart !== 'undefined') && { areaChart }),
-        ...((typeof lineGraph !== 'undefined') && { lineGraph }),
-      },
-      computed: {
-        /**
-         * Dataset getter function
-         * @memberOf Chart
-         * @returns {Object} normalized dataset
-         */
-        ds() {
-          //TODO add in support for arrays with undefined metric
-          const ds = { metric: [] };
-          Eif (!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 this.chartData.metric;
-        },
-        /**
-         * Height getter function
-         * @memberOf Chart
-         * @returns {number} Chart Height
-         */
-        height() {
-          return this.chartData.height || 200;
-        },
-        /**
-         * Width getter function
-         * @memberOf Chart
-         * @returns {number} Chart width
-         */
-        width() {
-          return this.chartData.width || 200;
-        },
-        /**
-         * Get the maxium value for metric
-         * @memberOf Chart
-         * @returns {number} Max value for metric
-         */
-        max() {
-          let max = 0;
-          var results = []; 
-          this.ds.forEach(e => {
-            results = results.concat([...e.metric]);
-          });
-          results.forEach((e) => {
-            max = max > e ? max : e;
-          });
-          return max;
-        },
-        /**
-         * Get the minimum value for dataset
-         * @memberOf Chart
-         * @returns {number} Min value for metric
-         */
-        min() {
-          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
-         * @memberOf Chart
-         * @returns {number} Height of the chart display
-         */
-        displayHeight() {
-          Iif (this.chartData.legends && this.chartData.legends.enabled === true) {
-            return this.height * .80;
-          } else {
-            return this.height;
-          }
-        },
-        /**
-         * Gets the height of the title 
-         * @memberOf Chart
-         * @returns {number} Height of the chart title
-         */
-        titleHeight() {
-          Eif (this.chartData.title) return this.chartData.textHeight || 25;
-          return 0;
-        },
-        /**
-         * Gets the subtitle height
-         * @memberOf Chart
-         * @returns {number} Height of chart subtitle
-         */
-        subtitleHeight() {
-          Iif (this.chartData.subtitle) return this.chartData.textHeight * 0.66 || 25 * 0.66;
-          return 0;
-        },
-        /**
-         * Gets the combined height of the title and subtitle
-         * @memberOf Chart
-         * @returns {number} Total header height
-         */
-        header() {
-          return (this.titleHeight + this.subtitleHeight);
-        },
-      },
-      mounted() {
-        this.initalizeChart();
-      },
-      watch: {
-        chartData: {
-          handler() {
-            this.refreshChart();
-          },
-          deep: true,
-        },
-      },
-      template:
-        '<svg :id=\'this.chartData.selector\' x=\'5\' y=\'5\' :height=\'this.height + 20\' :width=\'this.width + 20\'> </svg>',
-    });
-  },
-};
- 
-export default Chart;
- 
-Iif (typeof window !== 'undefined' && window.Vue) {
-  window.Vue.use(Chart);
-}
-
-
- - - - - - - From b6f51bfc480cc4dd72ef14505d326f9d14f1e192 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Mon, 12 Nov 2018 20:08:41 -0500 Subject: [PATCH 10/10] labels for multiple variables --- src/v-chart-plugin.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index 902e4a0..f869a06 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -135,25 +135,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[0]); + .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; }); + }) } }, @@ -198,7 +202,7 @@ const Chart = { * @returns {array} Metrics */ metric() { - return this.chartData.metric; + return (Array.isArray(this.chartData.metric)) ? this.chartData.metric : new Array(this.chartData.metric); }, /** * Height getter function