From 6d126a7c404239fc738378c66b415f4656351e9c Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Sun, 2 Dec 2018 00:21:28 -0500 Subject: [PATCH 1/7] fixed goal width --- src/components/chartExample.vue | 24 ++++++++++++------------ src/import/bubbleChart.js | 2 ++ src/import/scatterPlot.js | 9 +++++++++ src/v-chart-plugin.js | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/components/chartExample.vue b/src/components/chartExample.vue index 1f03b7f..4cdf510 100644 --- a/src/components/chartExample.vue +++ b/src/components/chartExample.vue @@ -17,13 +17,13 @@
- +
- +
@@ -75,14 +75,14 @@ export default { width: 50 } }, - boxPlotData: { - chartType: "boxPlot", - selector: "chart", - title: "Box Plot", + bubbleChartData: { + chartType: "bubbleChart", + selector: "bubbleChart", + title: "Bubble Chart", subtitle: "Sales by month", - width: 600, - height: 500, - metric: ['total'], + width: 300, + height: 200, + metric: ['total', 'forecast', 'yoy'], data: sales, goal: 500, }, @@ -90,10 +90,10 @@ export default { chartType: "lineGraph", selector: "lineGraph", title: "Line Graph", - width: 200, subtitle: "Sales by month", - height: 200, - goal: 500, + width: 600, + height: 500, + goal: 600, metric: ["total", "forecast"], dim: "month", data: sales, diff --git a/src/import/bubbleChart.js b/src/import/bubbleChart.js index c5660a7..e44645f 100644 --- a/src/import/bubbleChart.js +++ b/src/import/bubbleChart.js @@ -55,6 +55,8 @@ const bubbleChart = function chart(mode) { points.enter() .append('circle') .attr('class', this.selector) + .attr('fill', cs.palette.fill) + .attr('stroke', cs.palette.stroke) .attr('r', d => cs.r.scale(d.metric[2])) .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric[1])); diff --git a/src/import/scatterPlot.js b/src/import/scatterPlot.js index cca32b2..e511e8e 100644 --- a/src/import/scatterPlot.js +++ b/src/import/scatterPlot.js @@ -56,7 +56,16 @@ const scatterPlot = function chart() { points.enter() .append('circle') .attr('class', this.selector) + .attr('fill', cs.palette.fill) + .attr('stroke', cs.palette.stroke) .attr('r', cs.r.width) + .on('mouseover', (d) => { + this.addTooltip(d, window.event); + }) + .on('mouseout', (d) => { + this.removeTooltip(d); + }) + .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric[1])); return points; diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index 7062950..a6d0d3e 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -197,7 +197,7 @@ const Chart = { generateGoal(cs, svgContainer, shiftAxis, padding) { svgContainer.selectAll('line#goal').remove(); const x1 = shiftAxis ? cs.y.axisWidth: cs.x.scale(this.goal) + padding; - const x2 = shiftAxis ? 500 : cs.x.scale(this.goal) + padding; + const x2 = shiftAxis ? this.width : cs.x.scale(this.goal) + padding; const y1 = shiftAxis ? cs.y.scale(this.goal) + padding : this.header; const y2 = shiftAxis ? cs.y.scale(this.goal) + padding : this.displayHeight - cs.x.axisHeight; From 85225c764a3c7b03ca9247f30635119a989923f0 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Sun, 2 Dec 2018 09:34:50 -0500 Subject: [PATCH 2/7] axis labels --- src/components/chartExample.vue | 1 + src/import/barChart.js | 4 ++-- src/import/boxPlot.js | 1 - src/import/bubbleChart.js | 10 +++++++-- src/import/lineGraph.js | 9 +++++--- src/import/scatterPlot.js | 1 - src/v-chart-plugin.js | 40 +++++++++++++++++++++++++++++---- 7 files changed, 53 insertions(+), 13 deletions(-) diff --git a/src/components/chartExample.vue b/src/components/chartExample.vue index 4cdf510..41640e2 100644 --- a/src/components/chartExample.vue +++ b/src/components/chartExample.vue @@ -82,6 +82,7 @@ export default { subtitle: "Sales by month", width: 300, height: 200, + dim: "month", metric: ['total', 'forecast', 'yoy'], data: sales, goal: 500, diff --git a/src/import/barChart.js b/src/import/barChart.js index db60665..2705140 100644 --- a/src/import/barChart.js +++ b/src/import/barChart.js @@ -117,7 +117,7 @@ const barChart = function chart() { .on('mouseover', mouseOver) .on('mouseout', mouseOut); }); - if (this.goal) this.generateGoal(cs, svgContainer, false, cs.y.axisWidth + cs.bar.hPadding); + if (this.goal) this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding); return rects; }; /** @@ -135,7 +135,7 @@ const barChart = function chart() { .attr('y', getYCoord) .attr('x', cs.y.axisWidth + cs.bar.hPadding); }); - if (this.goal) this.generateGoal(cs, svgContainer, false, cs.y.axisWidth + cs.bar.hPadding); + if (this.goal) this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding); return rects; }; /** diff --git a/src/import/boxPlot.js b/src/import/boxPlot.js index b633dbc..c19491b 100644 --- a/src/import/boxPlot.js +++ b/src/import/boxPlot.js @@ -165,7 +165,6 @@ const boxPlot = function chart() { const lines = svgContainer.selectAll('line').data(a); cs = this.setOverrides(cs, this.chartData.overrides); - console.log(a) buildScales(cs); drawAxis(cs); enter(boxes, lines); diff --git a/src/import/bubbleChart.js b/src/import/bubbleChart.js index e44645f..82e1a7f 100644 --- a/src/import/bubbleChart.js +++ b/src/import/bubbleChart.js @@ -28,8 +28,8 @@ const bubbleChart = function chart(mode) { */ let cs = { palette: { - pointFill: '#005792', - pointStroke: '#d1f4fa', + fill: '#005792', + stroke: '#d1f4fa', }, x: { domain: [], @@ -57,6 +57,12 @@ const bubbleChart = function chart(mode) { .attr('class', this.selector) .attr('fill', cs.palette.fill) .attr('stroke', cs.palette.stroke) + .on('mouseover', (d) => { + this.addTooltip(d, window.event); + }) + .on('mouseout', (d) => { + this.removeTooltip(d); + }) .attr('r', d => cs.r.scale(d.metric[2])) .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric[1])); diff --git a/src/import/lineGraph.js b/src/import/lineGraph.js index 65ed444..d50db3f 100644 --- a/src/import/lineGraph.js +++ b/src/import/lineGraph.js @@ -33,12 +33,14 @@ const lineGraph = function chart(mode) { pointStroke: '#d1f4fa', }, x: { + label: this.dim, domain: [], range: [], axisHeight: 20, }, y: { - axisWidth: 30, + label: this.metric, + axisWidth: 40, ticks: 5, }, }; @@ -74,7 +76,8 @@ const lineGraph = function chart(mode) { .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric)); }); - if (this.goal) this.generateGoal(cs, svgContainer, true, 0); + if (this.goal) this.generateGoal(cs, true, 0); + this.generateAxisLabels(cs); return points; }; /** @@ -97,7 +100,7 @@ const lineGraph = function chart(mode) { .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric)); }); - if (this.goal) this.generateGoal(cs, svgContainer, true, 0); + if (this.goal) this.generateGoal(cs, true, 0); return points; }; diff --git a/src/import/scatterPlot.js b/src/import/scatterPlot.js index e511e8e..6a20193 100644 --- a/src/import/scatterPlot.js +++ b/src/import/scatterPlot.js @@ -65,7 +65,6 @@ const scatterPlot = function chart() { .on('mouseout', (d) => { this.removeTooltip(d); }) - .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric[1])); return points; diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index a6d0d3e..885af8e 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -194,14 +194,14 @@ const Chart = { * @param {Object} cs configuration of the coordinate system */ - generateGoal(cs, svgContainer, shiftAxis, padding) { - svgContainer.selectAll('line#goal').remove(); + generateGoal(cs, shiftAxis, padding) { + d3.select(`#${this.chartData.selector}`).selectAll('line#goal').remove(); const x1 = shiftAxis ? cs.y.axisWidth: cs.x.scale(this.goal) + padding; const x2 = shiftAxis ? this.width : cs.x.scale(this.goal) + padding; const y1 = shiftAxis ? cs.y.scale(this.goal) + padding : this.header; const y2 = shiftAxis ? cs.y.scale(this.goal) + padding : this.displayHeight - cs.x.axisHeight; - svgContainer.append("line") + d3.select(`#${this.chartData.selector}`).append('line') .attr('x1', x1) .attr('x2', x2) .attr('y1', y1) @@ -210,7 +210,31 @@ const Chart = { .style('stroke', '#708090') .style('stroke-width', 1) }, - /** + /** + * Generate Axis Lables + * @memberOf Chart + * @param {Obeject} cs configuration of the coordinate system + */ + generateAxisLabels(cs) { + d3.select(`#${this.chartData.selector}`).selectAll('text.axisLabel').remove(); + d3.select(`#${this.chartData.selector}`).append('text') + .attr('x', this.width / 2) + .attr('y', this.height * .85) + .attr('id', 'xAxisLabel') + .attr('class', 'axisLabel') + .style('text-anchor', 'middle') + .text(cs.x.label) + + d3.select(`#${this.chartData.selector}`).append('text') + .attr('x', 10) + .attr('y', this.height / 2) + .attr('id', 'xAxisLabel') + .attr('class', 'axisLabel') + .style('text-anchor', 'middle') + .text(cs.y.label) + .attr('transform', `rotate(-90,10, ${this.height / 2})`) + }, + /** * get the values of a metric as an array * @memberOf Chart * @returns {Array} metric values @@ -253,6 +277,14 @@ const Chart = { return td; }); }, + /** + * Dimension getter function + * @memberOf Chart + * @returns {string} dim + */ + dim() { + return this.chartData.dim || "undefined"; + }, /** * Goal getter function * @memberOf Chart From 3ebfd3778b9e66eeb6deeafd172308f28369a07c Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Thu, 6 Dec 2018 20:45:43 -0500 Subject: [PATCH 3/7] updated labels, created new layout for samples --- src/components/chartExample.vue | 58 +- src/import/barChart.js | 4 +- src/import/lineGraph.js | 1 - src/v-chart-plugin.js | 6 +- 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 | 545 ++++ .../lcov-report/src/components/index.html | 93 + .../lcov-report/src/import/areaChart.js.html | 491 ++++ .../lcov-report/src/import/barChart.js.html | 722 +++++ .../src/import/bubbleChart.js.html | 473 ++++ .../lcov-report/src/import/index.html | 171 ++ .../lcov-report/src/import/lineGraph.js.html | 626 +++++ .../lcov-report/src/import/pieChart.js.html | 455 +++ .../src/import/scatterPlot.js.html | 464 +++ .../lcov-report/src/import/vBarChart.js.html | 689 +++++ test/unit/coverage/lcov-report/src/index.html | 106 + .../lcov-report/src/v-chart-plugin.js.html | 1313 +++++++++ 26 files changed, 9815 insertions(+), 19 deletions(-) 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/bubbleChart.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/src/components/chartExample.vue b/src/components/chartExample.vue index 41640e2..d8e9a7a 100644 --- a/src/components/chartExample.vue +++ b/src/components/chartExample.vue @@ -19,18 +19,24 @@
-
+
-
+
-
+
-
+
+ +
+
+
+ +
@@ -64,8 +70,8 @@ export default { chartType: "areaChart", selector: "areaChart", title: "Area Chart", - width: 300, - height: 200, + width: 600, + height: 500, metric: ["total"], dim: "month", data: sales, @@ -80,8 +86,8 @@ export default { selector: "bubbleChart", title: "Bubble Chart", subtitle: "Sales by month", - width: 300, - height: 200, + width: 600, + height: 500, dim: "month", metric: ['total', 'forecast', 'yoy'], data: sales, @@ -98,6 +104,7 @@ export default { metric: ["total", "forecast"], dim: "month", data: sales, + label: true, legends: { enabled: true, height: 25, @@ -111,12 +118,12 @@ export default { } }, vBarChartData: { - chartType: "barChart", + chartType: "vBarChart", selector: "vChart", title: "Bar Chart", subtitle: "Sales by month", - width: 300, - height: 300, + width: 600, + height: 500, metric: ["total", "forecast"], dim: "month", data: sales, @@ -125,20 +132,41 @@ export default { height: 25, width: 50 }, - overrides: { - } + }, + barChartData: { + chartType: "barChart", + selector: "barChart", + title: "Bar Chart", + subtitle: "Sales by month", + width: 600, + height: 500, + metric: ["total", "forecast"], + dim: "month", + data: sales, + label: true }, pieChartData: { chartType: "pieChart", selector: "pieChart", title: "Pie Chart", subtitle: "Sales by month", - width: 300, - height: 200, + width: 600, + height: 500, metric: "total", dim: "month", data: sales }, + scatterPlotData: { + chartType: "scatterPlot", + selector: "scatterPlot", + title: "Scatter Plot", + subtitle: "Sales by month", + width: 600, + height: 500, + dim: "month", + metric: ['total', 'forecast'], + data: sales, + }, }; } }; diff --git a/src/import/barChart.js b/src/import/barChart.js index 2705140..2c7ea5a 100644 --- a/src/import/barChart.js +++ b/src/import/barChart.js @@ -40,13 +40,15 @@ const barChart = function chart() { vPadding: 5, }, x: { + label: this.dim, axisHeight: 10, ticks: 5, }, y: { + label: this.metric, domain: [], range: [], - axisWidth: null, + axisWidth: 20, }, }; diff --git a/src/import/lineGraph.js b/src/import/lineGraph.js index d50db3f..7db2386 100644 --- a/src/import/lineGraph.js +++ b/src/import/lineGraph.js @@ -77,7 +77,6 @@ const lineGraph = function chart(mode) { .attr('cy', d => cs.y.scale(d.metric)); }); if (this.goal) this.generateGoal(cs, true, 0); - this.generateAxisLabels(cs); return points; }; /** diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index 885af8e..93e687a 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -14,7 +14,6 @@ import scatterPlot from './import/scatterPlot'; import pieChart from './import/pieChart'; import areaChart from './import/areaChart'; import bubbleChart from './import/bubbleChart'; -import boxPlot from './import/boxPlot'; const d3 = Object.assign({}, require('d3-selection')); @@ -41,6 +40,7 @@ const Chart = { initalizeChart() { const cs = this[this.chartData.chartType]('init'); this.drawTitle(); + this.generateAxisLabels(cs); this.generateLegend(cs); }, /** @@ -216,7 +216,9 @@ const Chart = { * @param {Obeject} cs configuration of the coordinate system */ generateAxisLabels(cs) { + if (!this.chartData.label) return 0; d3.select(`#${this.chartData.selector}`).selectAll('text.axisLabel').remove(); + if (cs.x && cs.x.label) d3.select(`#${this.chartData.selector}`).append('text') .attr('x', this.width / 2) .attr('y', this.height * .85) @@ -225,6 +227,7 @@ const Chart = { .style('text-anchor', 'middle') .text(cs.x.label) + if (cs.y && cs.y.label) d3.select(`#${this.chartData.selector}`).append('text') .attr('x', 10) .attr('y', this.height / 2) @@ -251,7 +254,6 @@ const Chart = { ...((typeof areaChart !== 'undefined') && { areaChart }), ...((typeof lineGraph !== 'undefined') && { lineGraph }), ...((typeof bubbleChart !== 'undefined') && { bubbleChart }), - ...((typeof boxPlot !== 'undefined') && { boxPlot }), }, computed: { /** 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..3f1c310 --- /dev/null +++ b/test/unit/coverage/lcov-report/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 73.09% + Statements + 334/457 +
+
+ 47.22% + Branches + 51/108 +
+
+ 60% + Functions + 75/125 +
+
+ 75% + Lines + 324/432 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
src/
65.05%67/10348.78%40/8266.67%10/1565%65/100
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/
76.29%267/35042.31%11/2660.19%65/10878.96%259/328
+
+
+ +
+ + + + + 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..e2a883c --- /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..1c2d3bf --- /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..ed72fba --- /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..8411e11 --- /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..d96f389 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/components/chartExample.vue.html @@ -0,0 +1,545 @@ + + + + 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  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
<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="bubbleChartData"></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="lineGraphData"></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
+        }
+      },
+      bubbleChartData: {
+        chartType: "bubbleChart",
+        selector: "chart",
+        title: "Bubble Plot",
+        subtitle: "Sales by month",
+        width: 600,
+        height: 500,
+        metric: ["total", "forecast", "yoy"],
+        data: sales,
+        goal: 500,
+        legends: {
+          enabled: true,
+          height: 25,
+          width: 50
+        },
+        grid: {
+          enabled: true,
+          gridTicks: 25
+        }
+      },
+      lineGraphData: {
+        chartType: "lineGraph",
+        selector: "lineGraph",
+        title: "Line Graph",
+        width: 200,
+        subtitle: "Sales by month",
+        height: 200,
+        goal: 500,
+        metric: ["total", "forecast"],
+        dim: "month",
+        data: sales,
+        legends: {
+          enabled: true,
+          height: 25,
+          width: 50
+        },
+        overrides: {
+          palette: {
+            fill: ["#34495E", "#4fc08d"],
+            stroke: "#41B883"
+          }
+        }
+      },
+      vBarChartData: {
+        chartType: "barChart",
+        selector: "vChart",
+        title: "Bar Chart",
+        subtitle: "Sales by month",
+        width: 300,
+        height: 300,
+        metric: ["total", "forecast"],
+        dim: "month",
+        data: sales,
+        legends: {
+          enabled: true,
+          height: 25,
+          width: 50
+        },
+        overrides: {
+        }
+      },
+      pieChartData: {
+        chartType: "pieChart",
+        selector: "pieChart",
+        title: "Pie Chart",
+        subtitle: "Sales by month",
+        width: 300,
+        height: 200,
+        metric: "total",
+        dim: "month",
+        data: sales
+      },
+    };
+  }
+};
+</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..21e7458 --- /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..17806e5 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/areaChart.js.html @@ -0,0 +1,491 @@ + + + + Code coverage report for src/import/areaChart.js + + + + + + + +
+
+

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

+
+
+ 82.61% + Statements + 38/46 +
+
+ 50% + Branches + 1/2 +
+
+ 66.67% + Functions + 8/12 +
+
+ 83.72% + Lines + 36/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 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  + + +  +  + + + +  + + +  +  +  +  +  +  + + + +  +  + + + + + +  +  + +  +  +  +  +  + + + + + + +  + +  +  +  + 
/** 
+ *  @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 = () => {
+    this.drawGrid(cs);
+    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..d6a1a46 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/barChart.js.html @@ -0,0 +1,722 @@ + + + + Code coverage report for src/import/barChart.js + + + + + + + +
+
+

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

+
+
+ 82.09% + Statements + 55/67 +
+
+ 37.5% + Branches + 6/16 +
+
+ 68.42% + Functions + 13/19 +
+
+ 89.83% + Lines + 53/59 +
+
+
+
+

+
+
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  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  + + + + +  +  +  +  +  + + +  +  +  +  +  +  +  + + + +  + +  +  +  +  +  +  + + +  +  + + +  + +  +  +  +  +  +  + + + + + + + + + +  + +  +  +  +  +  +  +  +  + +  +  +  +  + + + + +  +  +  +  +  +  + + +  +  + + + + + +  + +  +  +  + 
import { globalAgent } from 'http';
+ 
+/** 
+ *  @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', '#ffcdcd'],
+      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) / this.metric.length ;
+ 
+  /**
+   * 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 + cs.bar.offset * getHeight();
+ 
+  /**
+   * 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) => {
+    this.metric.forEach( (e, i) => {
+      cs.bar.offset = i;
+      rects[i].enter()
+        .append('rect')
+        .attr('fill', cs.palette.fill[i])
+        .attr('stroke', cs.palette.stroke)
+        .attr('class', this.selector)
+        .attr('class', 'r' + i)
+        .attr('width', getWidth)
+        .attr('height', getHeight)
+        .attr('y', getYCoord)
+        .attr('x', cs.y.axisWidth + cs.bar.hPadding)
+        .on('mouseover', mouseOver)
+        .on('mouseout', mouseOut);
+    });
+    Iif (this.goal) this.generateGoal(cs, svgContainer, false, cs.y.axisWidth + cs.bar.hPadding);
+    return rects;
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} rects (svg element)
+   */
+  const transition = (rects) => {
+    this.metric.forEach( (e, i) => {
+      cs.bar.offset = i;
+      rects[i].transition()
+        .attr('width', getWidth)
+        .attr('height', getHeight)
+        .attr('y', getYCoord)
+        .attr('x', cs.y.axisWidth + cs.bar.hPadding);
+    });
+    Iif (this.goal) this.generateGoal(cs, svgContainer, false, 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) => {
+    this.metric.forEach( (e, i) => {
+      rects[i].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 = () => {
+    this.drawGrid(cs);
+    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) => {
+    if(!currentValue.dim) return accumulator;
+    return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator;
+  }
+ 
+  const rects = []
+  this.metric.forEach( (e, i) => {
+    rects.push(svgContainer.selectAll('rect.r' + i).data(this.ds.map(d => {
+      return  {
+        metric: d.metric[i],
+        dim: d.dim
+      }      
+    })))
+  })
+ 
+  cs = this.setOverrides(cs, this.chartData.overrides);
+  Iif (this.ds[0] && 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/bubbleChart.js.html b/test/unit/coverage/lcov-report/src/import/bubbleChart.js.html new file mode 100644 index 0000000..e3dc424 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/bubbleChart.js.html @@ -0,0 +1,473 @@ + + + + Code coverage report for src/import/bubbleChart.js + + + + + + + +
+
+

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

+
+
+ 4.88% + Statements + 2/41 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/12 +
+
+ 4.88% + Lines + 2/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  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
/** 
+ *  @fileOverview Bubble 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-shape'));
+/**
+ * Builds a Bubble Chart.
+ * @module bubbleChart
+ */
+ 
+const bubbleChart = 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: {
+      pointFill: '#005792',
+      pointStroke: '#d1f4fa',
+    },
+    x: {
+      domain: [],
+      range: [],
+      axisHeight: 20,
+    },
+    y: {
+      axisWidth: 30,
+      ticks: 5,
+    },
+    r: {
+      max: 20,
+    }
+  };
+ 
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} points (svg element) 
+   */
+  const enter = (points) => {
+    points.enter()
+      .append('circle')
+      .attr('class', this.selector)
+      .attr('r', d =>  cs.r.scale(d.metric[2]))
+      .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) 
+      .attr('cy', d => cs.y.scale(d.metric[1]));
+    return points;
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} points (svg element) 
+   */
+  const transition = (points) => {
+    points.transition()
+      .attr('r', d => cs.r.scale(d.metric[2]))
+      .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5)
+      .attr('cy', d => cs.y.scale(d.metric[1]));
+    return points;
+  };
+ 
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} points (svg element)
+   */
+  const exit = (points) => {
+    points.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.minTriplet.v2 - cs.r.max, this.maxTriplet.v2 + cs.r.max])
+      .range([this.displayHeight - cs.x.axisHeight, this.header]);
+    cs.x.scale = d3.scaleLinear()
+      .domain([this.minTriplet.v1 - cs.r.max, this.maxTriplet.v1 + cs.r.max])
+      .range([0, this.width]);
+    cs.r.scale = d3.scaleLinear()
+      .domain([this.minTriplet.v3, this.maxTriplet.v3])
+      .range([0, cs.r.max]);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  const drawAxis = cs => {
+    this.drawGrid(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);
+  };
+  
+  const points = svgContainer.selectAll('circle').data(this.ds);
+ 
+  cs = this.setOverrides(cs, this.chartData.overrides);
+ 
+  buildScales(cs);
+  drawAxis(cs);
+  enter(points);
+  transition(points);
+  exit(points);
+  
+  return cs;
+};
+ 
+export default bubbleChart;
+ 
+
+
+ + + + + + + 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..0061036 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for src/import/ + + + + + + + +
+
+

+ all files src/import/ +

+
+
+ 76.29% + Statements + 267/350 +
+
+ 42.31% + Branches + 11/26 +
+
+ 60.19% + Functions + 65/108 +
+
+ 78.96% + Lines + 259/328 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
areaChart.js
82.61%38/4650%1/266.67%8/1283.72%36/43
barChart.js
82.09%55/6737.5%6/1668.42%13/1989.83%53/59
bubbleChart.js
4.88%2/41100%0/00%0/124.88%2/41
lineGraph.js
86.11%62/7250%2/471.43%20/2888.24%60/68
pieChart.js
90%27/3050%1/262.5%5/893.1%27/29
scatterPlot.js
89.47%34/38100%0/060%6/1089.47%34/38
vBarChart.js
87.5%49/5650%1/268.42%13/1994%47/50
+
+
+ + + + + + + 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..8fd24da --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/lineGraph.js.html @@ -0,0 +1,626 @@ + + + + Code coverage report for src/import/lineGraph.js + + + + + + + +
+
+

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

+
+
+ 86.11% + Statements + 62/72 +
+
+ 50% + Branches + 2/4 +
+
+ 71.43% + Functions + 20/28 +
+
+ 88.24% + Lines + 60/68 +
+
+
+
+

+
+
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  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  + + + +  +  +  + + + +  +  +  +  +  + + +  +  +  +  +  +  +  +  + + + +  + + +  + +  +  +  +  +  +  +  + + +  +  + + + +  +  +  +  +  +  + + + + + + + + + +  + +  +  +  + + + +  + + +  +  +  + + + + +  +  +  +  +  +  + + + +  +  + +  + + + + + +  + +  +  +  + 
/** 
+ *  @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)
+    })    
+    this.metric.forEach( (e, i) => {
+      cs.offset = i;      
+      points[i].enter()
+        .append('circle')
+        .attr('class', this.selector)
+        .attr('class', "r" + i)
+        .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));
+    });
+    Iif (this.goal) this.generateGoal(cs, svgContainer, true, 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));
+    })
+  
+    this.metric.forEach( (e, i) => {
+      cs.offset = i;      
+      points[i].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));
+    });
+    Iif (this.goal) this.generateGoal(cs, svgContainer, true, 0);
+    return points;
+  };
+ 
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} points (svg element)
+   */
+  const exit = (points, path) => {
+    this.metric.forEach( (e, i) => {
+      points[i].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 => {
+    this.drawGrid(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 = [];
+  this.metric.forEach( (e, i) => {
+    points.push(svgContainer.selectAll('circle.r' + i).data(this.ds.map(d => {
+      return  {
+        metric: d.metric[i],
+        dim: d.dim
+      }      
+    })))
+  })
+ 
+  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..c971910 --- /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..340d1f5 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html @@ -0,0 +1,464 @@ + + + + Code coverage report for src/import/scatterPlot.js + + + + + + + +
+
+

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

+
+
+ 89.47% + Statements + 34/38 +
+
+ 100% + Branches + 0/0 +
+
+ 60% + Functions + 6/10 +
+
+ 89.47% + Lines + 34/38 +
+
+
+
+

+
+
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  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  + +  +  +  +  +  +  +  + + +  +  +  + +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  + + +  +  + +  +  +  +  +  +  +  +  + + + + + + + + + +  + +  +  +  + +  + + + + + + +  + +  +  +  + 
/** 
+ *  @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 = {
+    palette: {
+      pointFill: '#005792',
+      pointStroke: '#d1f4fa',
+    },
+    x: {
+      domain: [],
+      range: [],
+      axisHeight: 20,
+    },
+    y: {
+      axisWidth: 30,
+      ticks: 5,
+    },
+    r: {
+      width: 5
+    }
+  };
+ 
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} points (svg element) 
+   */
+  const enter = (points) => {
+    points.enter()
+      .append('circle')
+      .attr('class', this.selector)
+      .attr('r', cs.r.width)
+      .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) 
+      .attr('cy', d => cs.y.scale(d.metric[1]));
+    return points;
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} points (svg element) 
+   */
+  const transition = (points) => {
+    points.transition()
+      .attr('r', cs.r.width)
+      .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5)
+      .attr('cy', d => cs.y.scale(d.metric[1]));
+    return points;
+  };
+ 
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} points (svg element)
+   */
+  const exit = (points) => {
+    points.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.minTriplet.v2, this.maxTriplet.v2])
+      .range([this.displayHeight - cs.x.axisHeight, this.header]);
+    cs.x.scale = d3.scaleLinear()
+      .domain([this.minTriplet.v1, this.maxTriplet.v1])
+      .range([0, this.width]);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  const drawAxis = cs => {
+    this.drawGrid(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);
+  };
+  
+  const points = svgContainer.selectAll('circle').data(this.ds);
+ 
+  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..490ae69 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/import/vBarChart.js.html @@ -0,0 +1,689 @@ + + + + Code coverage report for src/import/vBarChart.js + + + + + + + +
+
+

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

+
+
+ 87.5% + Statements + 49/56 +
+
+ 50% + Branches + 1/2 +
+
+ 68.42% + Functions + 13/19 +
+
+ 94% + Lines + 47/50 +
+
+
+
+

+
+
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  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  + + +  +  + + +  + +  +  +  +  +  +  + + + + + + + + + +  +  + +  +  +  +  +  + + + + +  +  +  +  +  +  + + + + + + +  + +  +  +  + 
/** 
+ *  @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', '#ffcdcd'],
+      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) / this.metric.length ;
+ 
+  /**
+   * 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 + cs.bar.offset * getWidth();
+  /**
+   * 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) => {
+    this.metric.forEach( (e, i) => {
+      cs.bar.offset = i;
+      rects[i].enter()
+        .append('rect')
+        .attr('fill', cs.palette.fill[i])
+        .attr('stroke', cs.palette.stroke)
+        .attr('class', this.selector)
+        .attr('class', 'r' + i)
+        .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) => {
+    this.metric.forEach( (e, i) => {
+      cs.bar.offset = i;
+      rects[i].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) => {
+    this.metric.forEach( (e, i) => {
+      rects[i].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 = () => {
+    this.drawGrid(cs);
+    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 = []
+  this.metric.forEach( (e, i) => {
+    rects.push(svgContainer.selectAll('rect.r' + i).data(this.ds.map(d => {
+      return  {
+        metric: d.metric[i],
+        dim: d.dim
+      }      
+    })))
+  })
+ 
+  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..4c1fea6 --- /dev/null +++ b/test/unit/coverage/lcov-report/src/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for src/ + + + + + + + +
+
+

+ all files src/ +

+
+
+ 65.05% + Statements + 67/103 +
+
+ 48.78% + Branches + 40/82 +
+
+ 66.67% + Functions + 10/15 +
+
+ 65% + Lines + 65/100 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
App.vue
100%0/0100%0/0100%0/0100%0/0
v-chart-plugin.js
65.05%67/10348.78%40/8266.67%10/1565%65/100
+
+
+ + + + + + + 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..70a5c9f --- /dev/null +++ b/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html @@ -0,0 +1,1313 @@ + + + + Code coverage report for src/v-chart-plugin.js + + + + + + + +
+
+

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

+
+
+ 65.05% + Statements + 67/103 +
+
+ 48.78% + Branches + 40/82 +
+
+ 66.67% + Functions + 10/15 +
+
+ 65% + Lines + 65/100 +
+
+
+
+

+
+
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  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  + +  +  + +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +21× + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +12× +12× +12× +  +  +  +  +  +12× +12× +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + + +  + +  +  +  +  +  +  +  + +  +  +  +  + + + + +  + +  +  +  +  +  +  +  + + + +  + +  +  +  +  +  +  +  + +  +  +  +  + + + + +  + + + + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + 
/** 
+ *  @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';
+import bubbleChart from './import/bubbleChart';
+ 
+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');
+        },
+        /**
+         * Redraw the Chart when the data is recycled
+         * @memberOf Chart
+         */
+        drawGrid(cs) {
+          Iif (this.chartData.grid && this.chartData.grid.enabled === true) {
+            const grid = {
+              x: [],
+              y: []
+            }
+            for (let i = this.header; i < (this.height - this.header) * .80; i += this.gridTicks) {
+              grid.y.push(i);
+            }
+            d3.select(`#${this.chartData.selector}`)
+            .selectAll('line.gridLine')
+            .data(grid.y).enter()
+            .append('line')
+            .attr('class', 'gridLine')
+            .attr('x1', cs.y.axisWidth)
+            .attr('x2', this.width)
+            .attr('y1', d => d)
+            .attr('y2', d => d)
+            .style('stroke', '#D3D3D3')
+            .style('stroke-width', 1)
+          }
+        },
+        /**
+         * 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.offsetX - 5 - 50)
+            .attr('y', e.offsetY - 13 - 25)
+            .attr('height', '16px')
+            .attr('width', '80px')
+            .attr('class', 'tt')
+            .attr('fill', 'white');
+ 
+          d3.select(`#${this.chartData.selector}`)
+            .append('text')
+            .attr('x', e.offsetX - 50)
+            .attr('y', e.offsetY - 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) {
+            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 - (i * 15))
+              .style('text-anchor', 'middle')
+              .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 - (i * 15) - 10)
+              .attr("width", 30)
+              .attr("height", 10)
+              .style("fill", function () {
+              const fill = cs.palette.lineFill[i] || cs.palette.fill[i];
+                return fill;
+              });
+            })
+          }
+        },
+        /**
+         * Generate Goal 
+         * @memberOf Chart
+         * @param {Object} cs configuration of the coordinate system
+         */
+ 
+        generateGoal(cs, svgContainer, shiftAxis, padding) {
+          svgContainer.selectAll('line#goal').remove();
+          const x1 = shiftAxis ? cs.y.axisWidth: cs.x.scale(this.goal) + padding;
+          const x2 = shiftAxis ? 500 : cs.x.scale(this.goal) + padding;
+          const y1 = shiftAxis ? cs.y.scale(this.goal) + padding : this.header;
+          const y2 = shiftAxis ? cs.y.scale(this.goal) + padding : this.displayHeight - cs.x.axisHeight;
+          
+          svgContainer.append("line")
+            .attr('x1', x1)
+            .attr('x2', x2)
+            .attr('y1', y1)
+            .attr('y2', y2)
+            .attr('id', 'goal')
+            .style('stroke', '#708090')
+            .style('stroke-width', 1)
+        },
+ 
+        ...((typeof barChart !== 'undefined') && { barChart }),
+        ...((typeof vBarChart !== 'undefined') && { vBarChart }),
+        ...((typeof scatterPlot !== 'undefined') && { scatterPlot }),
+        ...((typeof pieChart !== 'undefined') && { pieChart }),
+        ...((typeof areaChart !== 'undefined') && { areaChart }),
+        ...((typeof lineGraph !== 'undefined') && { lineGraph }),
+        ...((typeof bubbleChart !== 'undefined') && { bubbleChart }),
+      },
+      computed: {
+        /**
+         * Dataset getter function
+         * @memberOf Chart
+         * @returns {Object} normalized dataset
+         */
+        ds() {
+          const ds = { metric: [] };
+          ds.metric = (Array.isArray(this.chartData.metric)) ? ds.metric = this.chartData.metric : new Array(this.chartData.metric);
+          ds.dim = this.chartData.dim;
+          ds.data = this.chartData.data;
+          return ds.data.map((d) => {
+            const td = { metric: [] };
+            Eif (!ds.metric[0])
+              td.metric[0] = d || 0;
+            else {
+              ds.metric.forEach(function(e, i){
+                td.metric[i] = d[e] || 0;
+              })
+            }
+            td.dim = this.chartData.dim ? d[this.chartData.dim] : null;
+            return td;
+          });
+        },
+        /**
+         * Goal getter function
+         * @memberOf Chart
+         * @returns {number} Goal 
+         */
+        goal() {
+          return this.chartData.goal;
+        },
+        /**
+         * Metric getter function
+         * @memberOf Chart
+         * @returns {array} Metrics 
+         */
+        metric() {
+          const metric = (Array.isArray(this.chartData.metric)) ? this.chartData.metric : new Array(this.chartData.metric);
+          return 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;
+        },
+        /**
+         * Grid Tick getter function
+         * @memberOf Chart
+         * @returns {number} gridTicks 
+         */
+        gridTicks() {
+          if (this.chartData.grid && this.chartData.grid.gridTicks != null) {
+            return this.chartData.grid.gridTicks;
+          }
+          return 100;
+        },
+        /**
+         * 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 maxium value for triplet
+         * @memberOf Chart
+         * @returns {Array} Max values for triplet
+         */
+        maxTriplet() {
+          const max = {
+            v1: 0,
+            v2: 0,
+            v3: 0
+          };
+          this.ds.forEach(e => {
+            max.v1 = max.v1 > e.metric[0] ? max.v1 : e.metric[0];
+            max.v2 = max.v2 > e.metric[1] ? max.v2 : e.metric[1];
+            max.v3 = max.v3 > e.metric[2] ? max.v3 : e.metric[2];
+          });
+          return max;
+        },
+        /**
+         * Get the minimum value for dataset
+         * @memberOf Chart
+         * @returns {number} Min value for metric
+         */
+        min() {
+          var results = []; 
+          this.ds.forEach(e => {
+            results = results.concat([...e.metric]);
+          });
+          return Math.min(...results.map(o => o));
+        },
+        /**
+         * Get the minimum value for triplet
+         * @memberOf Chart
+         * @returns {Array} Min values for triplet
+         */
+        minTriplet() {
+          var results = {
+            v1: [],
+            v2: [],
+            v3: []
+          };
+          this.ds.forEach(e => {
+            results.v1.push(e.metric[0])
+            results.v2.push(e.metric[1])
+            results.v3.push(e.metric[2])
+          })
+          return {
+            v1: (Math.min(...results.v1.map(o => o))),
+            v2: (Math.min(...results.v2.map(o => o))),
+            v3: (Math.min(...results.v3.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 fe4efaf62747b631632226f6f9b98256d52be767 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Thu, 6 Dec 2018 20:55:03 -0500 Subject: [PATCH 4/7] fixed padding --- src/components/chartExample.vue | 3 +++ src/import/barChart.js | 2 +- src/v-chart-plugin.js | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/chartExample.vue b/src/components/chartExample.vue index d8e9a7a..ce3cdd9 100644 --- a/src/components/chartExample.vue +++ b/src/components/chartExample.vue @@ -89,6 +89,9 @@ export default { width: 600, height: 500, dim: "month", + grid: { + enabled: true, + }, metric: ['total', 'forecast', 'yoy'], data: sales, goal: 500, diff --git a/src/import/barChart.js b/src/import/barChart.js index 2c7ea5a..2810c4d 100644 --- a/src/import/barChart.js +++ b/src/import/barChart.js @@ -48,7 +48,7 @@ const barChart = function chart() { label: this.metric, domain: [], range: [], - axisWidth: 20, + axisWidth: 50, }, }; diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index 93e687a..288cb77 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -216,12 +216,13 @@ const Chart = { * @param {Obeject} cs configuration of the coordinate system */ generateAxisLabels(cs) { + let footer = (this.label) ? .85 : .95; if (!this.chartData.label) return 0; d3.select(`#${this.chartData.selector}`).selectAll('text.axisLabel').remove(); if (cs.x && cs.x.label) d3.select(`#${this.chartData.selector}`).append('text') .attr('x', this.width / 2) - .attr('y', this.height * .85) + .attr('y', this.height * footer) .attr('id', 'xAxisLabel') .attr('class', 'axisLabel') .style('text-anchor', 'middle') @@ -408,7 +409,7 @@ const Chart = { if (this.chartData.legends && this.chartData.legends.enabled === true) { return this.height * .80; } else { - return this.height; + return this.height * .90; } }, /** From 0c3b410bbf109a069f48ec01ba246d4b0f361450 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Thu, 6 Dec 2018 21:24:01 -0500 Subject: [PATCH 5/7] cleanup axis --- src/components/chartExample.vue | 3 +++ src/import/areaChart.js | 3 ++- src/import/scatterPlot.js | 6 +++-- src/v-chart-plugin.js | 48 ++++++++++++++++++--------------- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/components/chartExample.vue b/src/components/chartExample.vue index ce3cdd9..6f310dc 100644 --- a/src/components/chartExample.vue +++ b/src/components/chartExample.vue @@ -167,6 +167,9 @@ export default { width: 600, height: 500, dim: "month", + label: { + enabled: true, + }, metric: ['total', 'forecast'], data: sales, }, diff --git a/src/import/areaChart.js b/src/import/areaChart.js index 0df85a3..463194d 100644 --- a/src/import/areaChart.js +++ b/src/import/areaChart.js @@ -40,6 +40,7 @@ const areaChart = function chart() { }, y: { axisWidth: 45, + ticks: 10, }, }; /** @@ -99,7 +100,7 @@ const areaChart = function chart() { 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); + 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 - cs.x.axisWidth) * i)) / this.ds.length)); diff --git a/src/import/scatterPlot.js b/src/import/scatterPlot.js index 6a20193..4f3c086 100644 --- a/src/import/scatterPlot.js +++ b/src/import/scatterPlot.js @@ -36,10 +36,12 @@ const scatterPlot = function chart() { domain: [], range: [], axisHeight: 20, + label: this.metric[0], }, y: { axisWidth: 30, ticks: 5, + label: this.metric[1], }, r: { width: 5 @@ -101,10 +103,10 @@ const scatterPlot = function chart() { */ const buildScales = cs => { cs.y.scale = d3.scaleLinear() - .domain([this.minTriplet.v2, this.maxTriplet.v2]) + .domain([this.minTriplet.v2 - this.maxTriplet.v2 * .05, this.maxTriplet.v2 + this.maxTriplet.v2 * .05]) .range([this.displayHeight - cs.x.axisHeight, this.header]); cs.x.scale = d3.scaleLinear() - .domain([this.minTriplet.v1, this.maxTriplet.v1]) + .domain([this.minTriplet.v1 - this.maxTriplet.v2 * .05, this.maxTriplet.v1 + this.maxTriplet.v1 * .05]) .range([0, this.width]); }; /** diff --git a/src/v-chart-plugin.js b/src/v-chart-plugin.js index 288cb77..090c202 100644 --- a/src/v-chart-plugin.js +++ b/src/v-chart-plugin.js @@ -98,6 +98,7 @@ const Chart = { drawTitle() { d3.select(`#${this.chartData.selector}`) .append('text') + .attr('font-size', '20') .attr('x', this.width / 2) .attr('y', this.titleHeight - this.titleHeight * 0.1) .style('text-anchor', 'middle') @@ -105,6 +106,7 @@ const Chart = { d3.select(`#${this.chartData.selector}`) .append('text') + .attr('font-size', '12') .attr('x', this.width / 2) .attr('y', this.titleHeight - this.titleHeight * 0.1 + this.subtitleHeight) .style('text-anchor', 'middle') @@ -168,6 +170,7 @@ const Chart = { this.metric.forEach( (e, i) => { d3.select(`#${this.chartData.selector}`) .append('text') + .attr('font-size', '10') .attr('x', this.width - 60) .attr('y', this.height * 0.95 - (i * 15)) .style('text-anchor', 'middle') @@ -213,30 +216,33 @@ const Chart = { /** * Generate Axis Lables * @memberOf Chart - * @param {Obeject} cs configuration of the coordinate system + * @param {Object} cs configuration of the coordinate system */ generateAxisLabels(cs) { - let footer = (this.label) ? .85 : .95; - if (!this.chartData.label) return 0; + let footer = (this.chartData.legends) ? .85 : .95; + if (!this.chartData.label) return; d3.select(`#${this.chartData.selector}`).selectAll('text.axisLabel').remove(); - if (cs.x && cs.x.label) - d3.select(`#${this.chartData.selector}`).append('text') - .attr('x', this.width / 2) - .attr('y', this.height * footer) - .attr('id', 'xAxisLabel') - .attr('class', 'axisLabel') - .style('text-anchor', 'middle') - .text(cs.x.label) + if (cs.x && cs.x.label) + d3.select(`#${this.chartData.selector}`).append('text') + .attr('font-size', '10') + .attr('x', this.width / 2) + .attr('y', this.height * footer) + .attr('id', 'xAxisLabel') + .attr('class', 'axisLabel') + .style('text-anchor', 'middle') + .text(cs.x.label) + if (cs.y && cs.y.label) - d3.select(`#${this.chartData.selector}`).append('text') - .attr('x', 10) - .attr('y', this.height / 2) - .attr('id', 'xAxisLabel') - .attr('class', 'axisLabel') - .style('text-anchor', 'middle') - .text(cs.y.label) - .attr('transform', `rotate(-90,10, ${this.height / 2})`) + d3.select(`#${this.chartData.selector}`).append('text') + .attr('font-size', '10') + .attr('x', 10) + .attr('y', this.height / 2) + .attr('id', 'xAxisLabel') + .attr('class', 'axisLabel') + .style('text-anchor', 'middle') + .text(cs.y.label) + .attr('transform', `rotate(-90,10, ${this.height / 2})`) }, /** * get the values of a metric as an array @@ -311,7 +317,7 @@ const Chart = { * @returns {number} Chart Height */ height() { - return this.chartData.height || 200; + return this.chartData.height - 10 || 190; }, /** * Width getter function @@ -319,7 +325,7 @@ const Chart = { * @returns {number} Chart width */ width() { - return this.chartData.width || 200; + return this.chartData.width - 10 || 190; }, /** * Grid Tick getter function From 1597a593ef2983482469a777217c17cbf11226a4 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Fri, 7 Dec 2018 21:35:30 -0500 Subject: [PATCH 6/7] readme updates --- README.md | 28 + dist/index.html | 2 +- dist/module/import/areaChart.js | 5 +- dist/module/import/barChart.js | 8 +- dist/module/import/boxPlot.js | 151 ++ dist/module/import/bubbleChart.js | 10 +- dist/module/import/lineGraph.js | 8 +- dist/module/import/scatterPlot.js | 16 +- dist/module/v-chart-plugin.js | 57 +- dist/static/js/app.2a5b3d2ecf41d1ed0f6f.js | 2 - .../static/js/app.2a5b3d2ecf41d1ed0f6f.js.map | 1 - dist/static/js/app.a391d398da741e3a07d3.js | 2 + .../static/js/app.a391d398da741e3a07d3.js.map | 1 + .../js/manifest.c423efaf7696a83d1404.js.map | 2 +- docs/Chart.html | 1288 +++++++++++++++-- docs/import_areaChart.js.html | 8 +- docs/import_barChart.js.html | 77 +- docs/import_boxPlot.js.html | 228 +++ docs/import_bubbleChart.js.html | 195 +++ docs/import_lineGraph.js.html | 128 +- docs/import_pieChart.js.html | 4 +- docs/import_scatterPlot.js.html | 73 +- docs/import_vBarChart.js.html | 64 +- docs/index.html | 322 ++++- docs/module-areaChart.html | 16 +- docs/module-barChart.html | 32 +- docs/module-boxPlot.html | 872 +++++++++++ docs/module-bubbleChart.html | 872 +++++++++++ docs/module-lineGraph.html | 14 +- docs/module-pieChart.html | 4 +- docs/module-scatterPlot.html | 26 +- docs/module-vBarChart.html | 12 +- docs/v-chart-plugin.js.html | 242 +++- package.json | 2 +- test/unit/coverage/lcov-report/index.html | 50 +- .../coverage/lcov-report/src/App.vue.html | 2 +- .../lcov-report/src/assets/data/index.html | 2 +- .../lcov-report/src/assets/data/pop.js.html | 2 +- .../lcov-report/src/assets/data/sales.js.html | 2 +- .../src/components/chartExample.vue.html | 142 +- .../lcov-report/src/components/index.html | 2 +- .../lcov-report/src/import/areaChart.js.html | 9 +- .../lcov-report/src/import/barChart.js.html | 16 +- .../src/import/bubbleChart.js.html | 42 +- .../lcov-report/src/import/index.html | 53 +- .../lcov-report/src/import/lineGraph.js.html | 16 +- .../lcov-report/src/import/pieChart.js.html | 2 +- .../src/import/scatterPlot.js.html | 50 +- .../lcov-report/src/import/vBarChart.js.html | 2 +- test/unit/coverage/lcov-report/src/index.html | 36 +- .../lcov-report/src/v-chart-plugin.js.html | 194 ++- test/unit/coverage/lcov.info | 1007 +++++++------ 52 files changed, 5470 insertions(+), 931 deletions(-) create mode 100644 dist/module/import/boxPlot.js delete mode 100644 dist/static/js/app.2a5b3d2ecf41d1ed0f6f.js delete mode 100644 dist/static/js/app.2a5b3d2ecf41d1ed0f6f.js.map create mode 100644 dist/static/js/app.a391d398da741e3a07d3.js create mode 100644 dist/static/js/app.a391d398da741e3a07d3.js.map create mode 100644 docs/import_boxPlot.js.html create mode 100644 docs/import_bubbleChart.js.html create mode 100644 docs/module-boxPlot.html create mode 100644 docs/module-bubbleChart.html diff --git a/README.md b/README.md index df25a86..89de879 100644 --- a/README.md +++ b/README.md @@ -108,8 +108,12 @@ export default { metric: ['count', 'pyCount', 'revenue'] data: [ {'count': 120, + 'pyCount': 115, + 'revenue': 170, 'fruit': 'apples'}, {'count': 250, + 'pyCount': 255, + 'revenue': 325, 'fruit': 'oranges'} ] } @@ -117,6 +121,7 @@ export default { } } ``` + ### Overrides If you need to override any of the default values of the charts (pallette colors, ticks, margins, etc) you can pass an overrides object to you chartData. @@ -134,6 +139,7 @@ If you need to override any of the default values of the charts (pallette colors } }, ``` + ### Legends Legends are turned off by default. You can add a legend to a chart by including a legends objects in your chartData as such: @@ -163,6 +169,28 @@ chartData: { } ``` +### Goals +Goals are used to place a line on your graph showing where your target is for the period: + +```JavaScript +chartData: { + chartType: "lineGraph", + ... + goal: 500, +} +``` + +### Labels +Labels are assigned to the x and y axis: + +```JavaScript +chartData: { + chartType: "lineGraph", + ... + label: true, +} +``` + ### Chart types currently supported: * barChart: a chart in which the numerical values of variables are represented by the width of rectangles of equal height. * vBarChart: a chart in which the numerical values of variables are represented by the height of rectangles of equal width. diff --git a/dist/index.html b/dist/index.html index a814e90..933ae02 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/import/areaChart.js b/dist/module/import/areaChart.js index ceeca93..8e862fa 100644 --- a/dist/module/import/areaChart.js +++ b/dist/module/import/areaChart.js @@ -38,7 +38,8 @@ var areaChart = function chart() { axisWidth: 45 }, y: { - axisWidth: 45 + axisWidth: 45, + ticks: 10 } }; /** @@ -93,7 +94,7 @@ var areaChart = function chart() { */ var buildScales = function 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); + 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); }); diff --git a/dist/module/import/barChart.js b/dist/module/import/barChart.js index 4eb3a98..d073250 100644 --- a/dist/module/import/barChart.js +++ b/dist/module/import/barChart.js @@ -39,13 +39,15 @@ var barChart = function chart() { vPadding: 5 }, x: { + label: this.dim, axisHeight: 10, ticks: 5 }, y: { + label: this.metric, domain: [], range: [], - axisWidth: null + axisWidth: 50 } }; @@ -109,7 +111,7 @@ var barChart = function chart() { cs.bar.offset = i; rects[i].enter().append('rect').attr('fill', cs.palette.fill[i]).attr('stroke', cs.palette.stroke).attr('class', _this.selector).attr('class', 'r' + i).attr('width', getWidth).attr('height', getHeight).attr('y', getYCoord).attr('x', cs.y.axisWidth + cs.bar.hPadding).on('mouseover', mouseOver).on('mouseout', mouseOut); }); - if (_this.goal) _this.generateGoal(cs, svgContainer, false, cs.y.axisWidth + cs.bar.hPadding); + if (_this.goal) _this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding); return rects; }; /** @@ -123,7 +125,7 @@ var barChart = function chart() { cs.bar.offset = i; rects[i].transition().attr('width', getWidth).attr('height', getHeight).attr('y', getYCoord).attr('x', cs.y.axisWidth + cs.bar.hPadding); }); - if (_this.goal) _this.generateGoal(cs, svgContainer, false, cs.y.axisWidth + cs.bar.hPadding); + if (_this.goal) _this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding); return rects; }; /** diff --git a/dist/module/import/boxPlot.js b/dist/module/import/boxPlot.js new file mode 100644 index 0000000..abdd9c1 --- /dev/null +++ b/dist/module/import/boxPlot.js @@ -0,0 +1,151 @@ +import _Object$assign from 'babel-runtime/core-js/object/assign'; +import { globalAgent } from 'http'; + +/** + * @fileOverview Bar chart component definition + * + * @author Brian Greig + * + * @requires NPM:d3:Vue + * @requires src/v-chart-plugin.js + */ + +/* eslint-env browser */ +var d3 = _Object$assign({}, require('d3-selection'), require('d3-scale'), require('d3-axis'), require('d3-ease'), require('d3-array')); +/** + * Builds a Box Plot. + * @module boxPlot + */ + +var boxPlot = function chart() { + var _this = this; + + /** + * The SVG that stores the chart + * @member svgContainer + */ + var svgContainer = d3.select('#' + this.chartData.selector); + /** + * The configuration of the coordinate system + * @member cs + */ + var cs = { + palette: { + fill: ['#005792', '#ffcdcd'], + stroke: '#d1f4fa' + }, + x: { + axisHeight: 10, + ticks: 5 + }, + y: { + axisWidth: 10, + ticks: 5 + } + }; + + /** + * Runs when a new element is added to the dataset + * @member enter + * @function + * @param {Object} boxes (svg element) + */ + var enter = function enter(boxes, lines) { + boxes.enter().append('rect').attr('fill', 'none').attr('stroke', 'black').attr('stroke-width', 3).attr('class', _this.selector).attr('width', 50).attr('height', function (d) { + return cs.y.scale(d.thirdQrt) - cs.y.scale(d.firstQrt); + }).attr('x', 50).attr('y', function (d) { + return cs.y.scale(d.firstQrt); + }); + + var l = lines.enter(); + + l.append('line').attr('fill', 'none').attr('stroke', 'black').attr('stroke-width', 3).attr('x1', 75).attr('y1', function (d) { + return cs.y.scale(d.min); + }).attr('x2', 75).attr('y2', function (d) { + return cs.y.scale(d.firstQrt); + }); + + l.append('line').attr('fill', 'none').attr('stroke', 'black').attr('stroke-width', 3).attr('x1', 75).attr('y1', function (d) { + return cs.y.scale(d.thirdQrt); + }).attr('x2', 75).attr('y2', function (d) { + return cs.y.scale(d.max); + }); + + l.append('line').attr('fill', 'none').attr('stroke', 'black').attr('stroke-width', 3).attr('x1', 50).attr('y1', function (d) { + return cs.y.scale(d.median); + }).attr('x2', 100).attr('y2', function (d) { + return cs.y.scale(d.median); + }); + + l.append('line').attr('fill', 'none').attr('stroke', 'black').attr('stroke-width', 3).attr('x1', 50).attr('y1', function (d) { + return cs.y.scale(d.min); + }).attr('x2', 100).attr('y2', function (d) { + return cs.y.scale(d.min); + }); + + l.append('line').attr('fill', 'none').attr('stroke', 'black').attr('stroke-width', 3).attr('x1', 50).attr('y1', function (d) { + return cs.y.scale(d.max); + }).attr('x2', 100).attr('y2', function (d) { + return cs.y.scale(d.max); + }); + + return boxes; + }; + /** + * Runs when a value of an element in dataset is changed + * @member transition + * @function + * @param {Object} boxes (svg element) + */ + var transition = function transition(boxes) { + boxes.transition(); + return boxes; + }; + /** + * Runs when an element is removed from the dataset + * @member exit + * @function + * @param {Object} boxes (svg element) + */ + var exit = function exit(rects) { + boxes.exit().remove(); + return rects; + }; + /** + * Builds the scales for the x and y axes + * @member buildScales + * @function + */ + var buildScales = function buildScales() { + cs.y.scale = d3.scaleLinear().domain([_this.min * 0.95, _this.max * 1.05]).range([_this.header, _this.displayHeight]); + }; + /** + * Draws the x and y axes on the svg + * @member drawAxis + * @function + */ + var drawAxis = function drawAxis() {}; + + var ds = this.metricAsArray('total').sort(); + var a = [{ + min: this.min, + median: d3.quantile(ds, 0.5), + max: this.max, + firstQrt: d3.quantile(ds, 0.25), + thirdQrt: d3.quantile(ds, 0.75) + }]; + + var boxes = svgContainer.selectAll('rect').data(a); + var lines = svgContainer.selectAll('line').data(a); + + cs = this.setOverrides(cs, this.chartData.overrides); + buildScales(cs); + drawAxis(cs); + enter(boxes, lines); + transition(boxes, lines); + exit(boxes, lines); + + return cs; +}; + +export default boxPlot; \ No newline at end of file diff --git a/dist/module/import/bubbleChart.js b/dist/module/import/bubbleChart.js index ae7e6d7..a6966a0 100644 --- a/dist/module/import/bubbleChart.js +++ b/dist/module/import/bubbleChart.js @@ -27,8 +27,8 @@ var bubbleChart = function chart(mode) { */ var cs = { palette: { - pointFill: '#005792', - pointStroke: '#d1f4fa' + fill: '#005792', + stroke: '#d1f4fa' }, x: { domain: [], @@ -51,7 +51,11 @@ var bubbleChart = function chart(mode) { * @param {Object} points (svg element) */ var enter = function enter(points) { - points.enter().append('circle').attr('class', _this.selector).attr('r', function (d) { + points.enter().append('circle').attr('class', _this.selector).attr('fill', cs.palette.fill).attr('stroke', cs.palette.stroke).on('mouseover', function (d) { + _this.addTooltip(d, window.event); + }).on('mouseout', function (d) { + _this.removeTooltip(d); + }).attr('r', function (d) { return cs.r.scale(d.metric[2]); }).attr('cx', function (d) { return cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5; diff --git a/dist/module/import/lineGraph.js b/dist/module/import/lineGraph.js index 40feb94..ad4aeaf 100644 --- a/dist/module/import/lineGraph.js +++ b/dist/module/import/lineGraph.js @@ -32,12 +32,14 @@ var lineGraph = function chart(mode) { pointStroke: '#d1f4fa' }, x: { + label: this.dim, domain: [], range: [], axisHeight: 20 }, y: { - axisWidth: 30, + label: this.metric, + axisWidth: 40, ticks: 5 } }; @@ -64,7 +66,7 @@ var lineGraph = function chart(mode) { return cs.y.scale(d.metric); }); }); - if (_this.goal) _this.generateGoal(cs, svgContainer, true, 0); + if (_this.goal) _this.generateGoal(cs, true, 0); return points; }; /** @@ -90,7 +92,7 @@ var lineGraph = function chart(mode) { return cs.y.scale(d.metric); }); }); - if (_this.goal) _this.generateGoal(cs, svgContainer, true, 0); + if (_this.goal) _this.generateGoal(cs, true, 0); return points; }; diff --git a/dist/module/import/scatterPlot.js b/dist/module/import/scatterPlot.js index 32ab1a2..efc158e 100644 --- a/dist/module/import/scatterPlot.js +++ b/dist/module/import/scatterPlot.js @@ -35,11 +35,13 @@ var scatterPlot = function chart() { x: { domain: [], range: [], - axisHeight: 20 + axisHeight: 20, + label: this.metric[0] }, y: { axisWidth: 30, - ticks: 5 + ticks: 5, + label: this.metric[1] }, r: { width: 5 @@ -53,7 +55,11 @@ var scatterPlot = function chart() { * @param {Object} points (svg element) */ var enter = function enter(points) { - points.enter().append('circle').attr('class', _this.selector).attr('r', cs.r.width).attr('cx', function (d) { + points.enter().append('circle').attr('class', _this.selector).attr('fill', cs.palette.fill).attr('stroke', cs.palette.stroke).attr('r', cs.r.width).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.metric[0]) + cs.y.axisWidth + 5; }).attr('cy', function (d) { return cs.y.scale(d.metric[1]); @@ -92,8 +98,8 @@ var scatterPlot = function chart() { * @function */ var buildScales = function buildScales(cs) { - cs.y.scale = d3.scaleLinear().domain([_this.minTriplet.v2, _this.maxTriplet.v2]).range([_this.displayHeight - cs.x.axisHeight, _this.header]); - cs.x.scale = d3.scaleLinear().domain([_this.minTriplet.v1, _this.maxTriplet.v1]).range([0, _this.width]); + cs.y.scale = d3.scaleLinear().domain([_this.minTriplet.v2 - _this.maxTriplet.v2 * .05, _this.maxTriplet.v2 + _this.maxTriplet.v2 * .05]).range([_this.displayHeight - cs.x.axisHeight, _this.header]); + cs.x.scale = d3.scaleLinear().domain([_this.minTriplet.v1 - _this.maxTriplet.v2 * .05, _this.maxTriplet.v1 + _this.maxTriplet.v1 * .05]).range([0, _this.width]); }; /** * Draws the x and y axes on the svg diff --git a/dist/module/v-chart-plugin.js b/dist/module/v-chart-plugin.js index df14932..3526ee3 100644 --- a/dist/module/v-chart-plugin.js +++ b/dist/module/v-chart-plugin.js @@ -45,6 +45,7 @@ var Chart = { initalizeChart: function initalizeChart() { var cs = this[this.chartData.chartType]('init'); this.drawTitle(); + this.generateAxisLabels(cs); this.generateLegend(cs); }, @@ -99,9 +100,9 @@ var Chart = { * @memberOf Chart */ drawTitle: function 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('font-size', '20').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); + d3.select('#' + this.chartData.selector).append('text').attr('font-size', '12').attr('x', this.width / 2).attr('y', this.titleHeight - this.titleHeight * 0.1 + this.subtitleHeight).style('text-anchor', 'middle').text(this.chartData.subtitle); }, /** @@ -174,7 +175,7 @@ var Chart = { 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(function (e, i) { - d3.select('#' + _this.chartData.selector).append('text').attr('x', _this.width - 60).attr('y', _this.height * 0.95 - i * 15).style('text-anchor', 'middle').text(_this.metric[i]); + d3.select('#' + _this.chartData.selector).append('text').attr('font-size', '10').attr('x', _this.width - 60).attr('y', _this.height * 0.95 - i * 15).style('text-anchor', 'middle').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 - i * 15 - 10).attr("width", 30).attr("height", 10).style("fill", function () { var fill = cs.palette.lineFill[i] || cs.palette.fill[i]; @@ -190,14 +191,41 @@ var Chart = { * @param {Object} cs configuration of the coordinate system */ - generateGoal: function generateGoal(cs, svgContainer, shiftAxis, padding) { - svgContainer.selectAll('line#goal').remove(); + generateGoal: function generateGoal(cs, shiftAxis, padding) { + d3.select('#' + this.chartData.selector).selectAll('line#goal').remove(); var x1 = shiftAxis ? cs.y.axisWidth : cs.x.scale(this.goal) + padding; - var x2 = shiftAxis ? 500 : cs.x.scale(this.goal) + padding; + var x2 = shiftAxis ? this.width : cs.x.scale(this.goal) + padding; var y1 = shiftAxis ? cs.y.scale(this.goal) + padding : this.header; var y2 = shiftAxis ? cs.y.scale(this.goal) + padding : this.displayHeight - cs.x.axisHeight; - svgContainer.append("line").attr('x1', x1).attr('x2', x2).attr('y1', y1).attr('y2', y2).attr('id', 'goal').style('stroke', '#708090').style('stroke-width', 1); + d3.select('#' + this.chartData.selector).append('line').attr('x1', x1).attr('x2', x2).attr('y1', y1).attr('y2', y2).attr('id', 'goal').style('stroke', '#708090').style('stroke-width', 1); + }, + + /** + * Generate Axis Lables + * @memberOf Chart + * @param {Object} cs configuration of the coordinate system + */ + generateAxisLabels: function generateAxisLabels(cs) { + var footer = this.chartData.legends ? .85 : .95; + if (!this.chartData.label) return; + d3.select('#' + this.chartData.selector).selectAll('text.axisLabel').remove(); + + if (cs.x && cs.x.label) d3.select('#' + this.chartData.selector).append('text').attr('font-size', '10').attr('x', this.width / 2).attr('y', this.height * footer).attr('id', 'xAxisLabel').attr('class', 'axisLabel').style('text-anchor', 'middle').text(cs.x.label); + + if (cs.y && cs.y.label) d3.select('#' + this.chartData.selector).append('text').attr('font-size', '10').attr('x', 10).attr('y', this.height / 2).attr('id', 'xAxisLabel').attr('class', 'axisLabel').style('text-anchor', 'middle').text(cs.y.label).attr('transform', 'rotate(-90,10, ' + this.height / 2 + ')'); + }, + + /** + * get the values of a metric as an array + * @memberOf Chart + * @returns {Array} metric values + */ + metricAsArray: function metricAsArray(metric) { + metric = this.chartData.data.map(function (d) { + return d[metric]; + }); + return metric; } }, typeof barChart !== 'undefined' && { barChart: barChart }, typeof vBarChart !== 'undefined' && { vBarChart: vBarChart }, typeof scatterPlot !== 'undefined' && { scatterPlot: scatterPlot }, typeof pieChart !== 'undefined' && { pieChart: pieChart }, typeof areaChart !== 'undefined' && { areaChart: areaChart }, typeof lineGraph !== 'undefined' && { lineGraph: lineGraph }, typeof bubbleChart !== 'undefined' && { bubbleChart: bubbleChart }), computed: { @@ -225,6 +253,15 @@ var Chart = { }); }, + /** + * Dimension getter function + * @memberOf Chart + * @returns {string} dim + */ + dim: function dim() { + return this.chartData.dim || "undefined"; + }, + /** * Goal getter function * @memberOf Chart @@ -250,7 +287,7 @@ var Chart = { * @returns {number} Chart Height */ height: function height() { - return this.chartData.height || 200; + return this.chartData.height - 10 || 190; }, /** @@ -259,7 +296,7 @@ var Chart = { * @returns {number} Chart width */ width: function width() { - return this.chartData.width || 200; + return this.chartData.width - 10 || 190; }, /** @@ -363,7 +400,7 @@ var Chart = { if (this.chartData.legends && this.chartData.legends.enabled === true) { return this.height * .80; } else { - return this.height; + return this.height * .90; } }, diff --git a/dist/static/js/app.2a5b3d2ecf41d1ed0f6f.js b/dist/static/js/app.2a5b3d2ecf41d1ed0f6f.js deleted file mode 100644 index 016bdb9..0000000 --- a/dist/static/js/app.2a5b3d2ecf41d1ed0f6f.js +++ /dev/null @@ -1,2 +0,0 @@ -webpackJsonp([1],{0:function(t,a){},1: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"),c=e.n(n),l=e("fZjL"),o=e.n(l),h=e("Dd8w"),d=e.n(h),f=e("woOf"),u=e.n(f),x=(e("nFqq"),u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("bmQh"))),m=function(){var t=this,a=x.select("#"+this.chartData.selector),e={palette:{fill:["#005792","#ffcdcd"],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)/t.metric.length},s=function(a,i){return i*(t.displayHeight-e.x.axisHeight-t.header)/t.ds.length+1+t.header+e.bar.offset*r()},n=function(a){t.addTooltip(a,window.event)},c=function(a){t.removeTooltip(a)},l=[];return this.metric.forEach(function(e,i){l.push(a.selectAll("rect.r"+i).data(t.ds.map(function(t){return{metric:t.metric[i],dim:t.dim}})))}),e=this.setOverrides(e,this.chartData.overrides),this.ds[0]&&this.ds[0].dim&&(e.y.axisWidth=e.y.axisWidth||10*this.ds.reduce(function(t,a){return a.dim&&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),t.drawGrid(e),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(l){t.metric.forEach(function(a,o){e.bar.offset=o,l[o].enter().append("rect").attr("fill",e.palette.fill[o]).attr("stroke",e.palette.stroke).attr("class",t.selector).attr("class","r"+o).attr("width",i).attr("height",r).attr("y",s).attr("x",e.y.axisWidth+e.bar.hPadding).on("mouseover",n).on("mouseout",c)}),t.goal&&t.generateGoal(e,a,!1,e.y.axisWidth+e.bar.hPadding)}(l),function(n){t.metric.forEach(function(t,a){e.bar.offset=a,n[a].transition().attr("width",i).attr("height",r).attr("y",s).attr("x",e.y.axisWidth+e.bar.hPadding)}),t.goal&&t.generateGoal(e,a,!1,e.y.axisWidth+e.bar.hPadding)}(l),function(a){t.metric.forEach(function(t,e){a[e].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","#ffcdcd"],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)/t.metric.length},r=function(a){return t.displayHeight-e.y.scale(a.metric)},s=function(a,r){return r*(t.width-e.y.axisWidth)/t.chartData.data.length+e.y.axisWidth+e.bar.offset*i()},n=function(t){return e.y.scale(t.metric)},c=function(a){t.addTooltip(a,window.event)},l=function(a){t.removeTooltip(a)},o=[];return this.metric.forEach(function(e,i){o.push(a.selectAll("rect.r"+i).data(t.ds.map(function(t){return{metric:t.metric[i],dim:t.dim}})))}),(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),t.drawGrid(e),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){t.metric.forEach(function(o,h){e.bar.offset=h,a[h].enter().append("rect").attr("fill",e.palette.fill[h]).attr("stroke",e.palette.stroke).attr("class",t.selector).attr("class","r"+h).attr("width",i).attr("height",r).attr("x",s).attr("y",n).on("mouseover",c).on("mouseout",l)})}(o),function(a){t.metric.forEach(function(t,c){e.bar.offset=c,a[c].transition().attr("width",i).attr("height",r).attr("x",s).attr("y",n)})}(o),function(a){t.metric.forEach(function(t,e){a[e].exit().remove()})}(o),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=[];this.metric.forEach(function(t,i){r.push(e.selectAll("circle.r"+i).data(a.ds.map(function(t){return{metric:t.metric[i],dim:t.dim}})))});var 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){a.drawGrid(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,r){a.metric.forEach(function(t,e){r[e].enter().append("path").attr("d",i.lineFunction[e](a.ds)).attr("fill","none").attr("id","p"+e).attr("stroke",i.palette.lineFill[e]).attr("stroke-width",3)}),a.metric.forEach(function(e,r){i.offset=r,t[r].enter().append("circle").attr("class",a.selector).attr("class","r"+r).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)})}),a.goal&&a.generateGoal(i,e,!0,0)}(r,s),function(t,r){a.metric.forEach(function(t,e){r[e].transition().attr("d",i.lineFunction[e](a.ds))}),a.metric.forEach(function(a,e){i.offset=e,t[e].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)})}),a.goal&&a.generateGoal(i,e,!0,0)}(r,s),function(t,e){a.metric.forEach(function(a,e){t[e].exit().remove()}),a.metric.forEach(function(t,a){e[a].exit().remove()})}(r,s),i},w=u()({},e("sHXk"),e("dJjO"),e("Mx2h")),D=function(){var t=this,a=w.select("#"+this.chartData.selector),e={palette:{pointFill:"#005792",pointStroke:"#d1f4fa"},x:{domain:[],range:[],axisHeight:20},y:{axisWidth:30,ticks:5},r:{width:5}},i=a.selectAll("circle").data(this.ds);return function(a){a.y.scale=w.scaleLinear().domain([t.minTriplet.v2,t.maxTriplet.v2]).range([t.displayHeight-a.x.axisHeight,t.header]),a.x.scale=w.scaleLinear().domain([t.minTriplet.v1,t.maxTriplet.v1]).range([0,t.width])}(e=this.setOverrides(e,this.chartData.overrides)),function(e){t.drawGrid(e),e.x.axis=w.axisBottom().scale(e.x.scale),e.x.xOffset=e.y.axisWidth+5,e.x.yOffset=t.displayHeight-e.x.axisHeight,e.y.axis=w.axisLeft().ticks(e.y.ticks,"s").scale(e.y.scale),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)}(e),function(a){a.enter().append("circle").attr("class",t.selector).attr("r",e.r.width).attr("cx",function(t){return e.x.scale(t.metric[0])+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric[1])})}(i),function(t){t.transition().attr("r",e.r.width).attr("cx",function(t){return e.x.scale(t.metric[0])+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric[1])})}(i),function(t){t.exit().remove()}(i),e},b=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),O=function(){var t=this,a=b.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=b.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=b.arc().outerRadius(e.radius-10).innerRadius(25),l=b.pie().sort(null).value(function(t){return t.metric}),o=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+")")}(o),function(t){t.transition().attr("d",c).attr("fill",r)}(o),function(t){t.exit().remove()}(o),e},H=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),k=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),t.drawGrid(e),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},C=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),W=function(t){var a=this,e=C.select("#"+this.chartData.selector),i={palette:{pointFill:"#005792",pointStroke:"#d1f4fa"},x:{domain:[],range:[],axisHeight:20},y:{axisWidth:30,ticks:5},r:{max:20}},r=e.selectAll("circle").data(this.ds);return function(t){t.y.scale=C.scaleLinear().domain([a.minTriplet.v2-t.r.max,a.maxTriplet.v2+t.r.max]).range([a.displayHeight-t.x.axisHeight,a.header]),t.x.scale=C.scaleLinear().domain([a.minTriplet.v1-t.r.max,a.maxTriplet.v1+t.r.max]).range([0,a.width]),t.r.scale=C.scaleLinear().domain([a.minTriplet.v3,a.maxTriplet.v3]).range([0,t.r.max])}(i=this.setOverrides(i,this.chartData.overrides)),function(t){a.drawGrid(t),t.x.axis=C.axisBottom().scale(t.x.scale),t.x.xOffset=t.y.axisWidth+5,t.x.yOffset=a.displayHeight-t.x.axisHeight,t.y.axis=C.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){t.enter().append("circle").attr("class",a.selector).attr("r",function(t){return i.r.scale(t.metric[2])}).attr("cx",function(t){return i.x.scale(t.metric[0])+i.y.axisWidth+5}).attr("cy",function(t){return i.y.scale(t.metric[1])})}(r),function(t){t.transition().attr("r",function(t){return i.r.scale(t.metric[2])}).attr("cx",function(t){return i.x.scale(t.metric[0])+i.y.axisWidth+5}).attr("cy",function(t){return i.y.scale(t.metric[1])})}(r),function(t){t.exit().remove()}(r),i},E=u()({},e("sHXk")),T={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")},drawGrid:function(t){if(this.chartData.grid&&!0===this.chartData.grid.enabled){for(var a={x:[],y:[]},e=this.header;e<.8*(this.height-this.header);e+=this.gridTicks)a.y.push(e);E.select("#"+this.chartData.selector).selectAll("line.gridLine").data(a.y).enter().append("line").attr("class","gridLine").attr("x1",t.y.axisWidth).attr("x2",this.width).attr("y1",function(t){return t}).attr("y2",function(t){return t}).style("stroke","#D3D3D3").style("stroke-width",1)}},clearAxis:function(){E.select("#"+this.chartData.selector).selectAll(".axis").remove()},clearCanvas:function(){E.select("#"+this.chartData.selector).selectAll("*").remove()},drawTitle:function(){E.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),E.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){E.select("#"+this.chartData.selector).append("rect").attr("x",a.offsetX-5-50).attr("y",a.offsetY-13-25).attr("height","16px").attr("width","80px").attr("class","tt").attr("fill","white"),E.select("#"+this.chartData.selector).append("text").attr("x",a.offsetX-50).attr("y",a.offsetY-25).attr("class","tt").attr("font-size","10px").text(t.dim+":"+t.metric)},removeTooltip:function(){E.select("#"+this.chartData.selector).selectAll(".tt").remove()},setOverrides:function(t,a){a=a||{};var e=o()(t),i=!0,r=!1,s=void 0;try{for(var n,l=c()(e);!(i=(n=l.next()).done);i=!0){var h=n.value;u()(t[h],a[h])}}catch(t){r=!0,s=t}finally{try{!i&&l.return&&l.return()}finally{if(r)throw s}}return t},generateLegend:function(t){var a=this;this.chartData.legends&&!0===this.chartData.legends.enabled&&(t.palette.lineFill=Array.isArray(t.palette.lineFill)?t.palette.lineFill:new Array(t.palette.lineFill),t.palette.fill=Array.isArray(t.palette.fill)?t.palette.fill:new Array(t.palette.fill),this.metric.forEach(function(e,i){E.select("#"+a.chartData.selector).append("text").attr("x",a.width-60).attr("y",.95*a.height-15*i).style("text-anchor","middle").text(a.metric[i]),E.select("#"+a.chartData.selector).append("g").attr("class","legends").append("rect").attr("x",a.width-30).attr("y",.95*a.height-15*i-10).attr("width",30).attr("height",10).style("fill",function(){return t.palette.lineFill[i]||t.palette.fill[i]})}))},generateGoal:function(t,a,e,i){a.selectAll("line#goal").remove();var r=e?t.y.axisWidth:t.x.scale(this.goal)+i,s=e?500:t.x.scale(this.goal)+i,n=e?t.y.scale(this.goal)+i:this.header,c=e?t.y.scale(this.goal)+i:this.displayHeight-t.x.axisHeight;a.append("line").attr("x1",r).attr("x2",s).attr("y1",n).attr("y2",c).attr("id","goal").style("stroke","#708090").style("stroke-width",1)}},{barChart:m},{vBarChart:p},{scatterPlot:D},{pieChart:O},{areaChart:k},{lineGraph:v},{bubbleChart:W}),computed:{ds:function(){var t=this,a={metric:[]};return a.metric=Array.isArray(this.chartData.metric)?a.metric=this.chartData.metric:new Array(this.chartData.metric),a.dim=this.chartData.dim,a.data=this.chartData.data,a.data.map(function(e){var i={metric:[]};return a.metric[0]?a.metric.forEach(function(t,a){i.metric[a]=e[t]||0}):i.metric[0]=e||0,i.dim=t.chartData.dim?e[t.chartData.dim]:null,i})},goal:function(){return this.chartData.goal},metric:function(){var t=Array.isArray(this.chartData.metric)?this.chartData.metric:new Array(this.chartData.metric);return t},height:function(){return this.chartData.height||200},width:function(){return this.chartData.width||200},gridTicks:function(){return this.chartData.grid&&null!=this.chartData.grid.gridTicks?this.chartData.grid.gridTicks:100},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},maxTriplet:function(){var t={v1:0,v2:0,v3:0};return this.ds.forEach(function(a){t.v1=t.v1>a.metric[0]?t.v1:a.metric[0],t.v2=t.v2>a.metric[1]?t.v2:a.metric[1],t.v3=t.v3>a.metric[2]?t.v3:a.metric[2]}),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})))},minTriplet:function(){var t={v1:[],v2:[],v3:[]};return this.ds.forEach(function(a){t.v1.push(a.metric[0]),t.v2.push(a.metric[1]),t.v3.push(a.metric[2])}),{v1:Math.min.apply(Math,s()(t.v1.map(function(t){return t}))),v2:Math.min.apply(Math,s()(t.v2.map(function(t){return t}))),v3:Math.min.apply(Math,s()(t.v3.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:" "})}},A=T;"undefined"!=typeof window&&window.Vue&&window.Vue.use(T);var _=[{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}],F={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:_,areaChartData:{chartType:"areaChart",selector:"areaChart",title:"Area Chart",width:300,height:200,metric:["total"],dim:"month",data:_,legends:{enabled:!0,height:25,width:50}},bubbleChartData:{chartType:"bubbleChart",selector:"chart",title:"Bubble Plot",subtitle:"Sales by month",width:600,height:500,metric:["total","forecast","yoy"],data:_,goal:500,legends:{enabled:!0,height:25,width:50},grid:{enabled:!0,gridTicks:25}},lineGraphData:{chartType:"lineGraph",selector:"lineGraph",title:"Line Graph",width:200,subtitle:"Sales by month",height:200,goal:500,metric:["total","forecast"],dim:"month",data:_,legends:{enabled:!0,height:25,width:50},overrides:{palette:{fill:["#34495E","#4fc08d"],stroke:"#41B883"}}},vBarChartData:{chartType:"barChart",selector:"vChart",title:"Bar Chart",subtitle:"Sales by month",width:300,height:300,metric:["total","forecast"],dim:"month",data:_,legends:{enabled:!0,height:25,width:50},overrides:{}},pieChartData:{chartType:"pieChart",selector:"pieChart",title:"Pie Chart",subtitle:"Sales by month",width:300,height:200,metric:"total",dim:"month",data:_}}}},L={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.bubbleChartData}})],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.lineGraphData}})],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 G={name:"App",components:{chartExample:e("VU/8")(F,L,!1,function(t){e("zXE5")},null,null).exports}},P={render:function(){var t=this.$createElement,a=this._self._c||t;return a("div",{attrs:{id:"app"}},[a("chartExample")],1)},staticRenderFns:[]};var M=e("VU/8")(G,P,!1,function(t){e("Gf/I")},null,null).exports;i.a.config.productionTip=!1,i.a.use(A),new i.a({el:"#app",components:{App:M},template:""})},"dLd/":function(t,a,e){t.exports=e.p+"static/img/logo.7eeeac5.png"},zXE5:function(t,a){}},["NHnr"]); -//# sourceMappingURL=app.2a5b3d2ecf41d1ed0f6f.js.map \ No newline at end of file diff --git a/dist/static/js/app.2a5b3d2ecf41d1ed0f6f.js.map b/dist/static/js/app.2a5b3d2ecf41d1ed0f6f.js.map deleted file mode 100644 index d2df110..0000000 --- a/dist/static/js/app.2a5b3d2ecf41d1ed0f6f.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/import/bubbleChart.js","webpack:///./src/v-chart-plugin.js","webpack:///./src/assets/data/sales.js","webpack:///src/components/chartExample.vue","webpack:///./src/components/chartExample.vue?8024","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","offset","mouseOver","addTooltip","window","event","mouseOut","removeTooltip","rects","forEach","e","push","selectAll","data","map","dim","setOverrides","overrides","reduce","accumulator","currentValue","scaleLinear","max","width","t","scaleOrdinal","drawGrid","axis","axisBottom","axisLeft","yOffset","xOffset","append","attr","call","enter","on","goal","generateGoal","transition","exit","remove","vBarChart","getXCoord","lineGraph","mode","lineFill","pointFill","pointStroke","lineFunction","line","points","path","min","buildScales","drawAxis","scatterPlot","r","minTriplet","v2","maxTriplet","v1","pieChart","radius","ordinalColors","height","color","getColor","arc","outerRadius","innerRadius","pie","sort","value","merge","areaChart","getPoints","p","poly","join","titleHeight","polyFunction","s","bubbleChart","v3","Chart","install","Vue","component","props","chartType","methods","initalizeChart","drawTitle","generateLegend","refreshChart","clearAxis","grid","enabled","gridTicks","style","clearCanvas","text","title","subtitleHeight","subtitle","offsetX","offsetY","keys","keys_default","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","get_iterator_default","next","done","key","err","return","legends","Array","isArray","shiftAxis","padding","x1","x2","y1","y2","computed","_this2","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","bubbleChartData","lineGraphData","vBarChartData","pieChartData","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":"yRAYMA,aAAKC,OACTC,EAAQ,QACRA,EAAQ,QACRA,EAAQ,QACRA,EAAQ,UA0MKC,EApME,WAAiB,IAAAC,EAAAC,KAK1BC,EAAeN,EAAGO,OAAH,IAAcF,KAAKG,UAAUC,UAK9CC,GACFC,SACEC,MAAO,UAAW,WAClBC,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,mBACfxB,EAAKyB,cAAgBnB,EAAGO,EAAEC,WAAad,EAAK0B,OAASpB,EAAGI,IAAIE,UAAYZ,EAAK2B,GAAGC,OAAS,GAAK5B,EAAKuB,OAAOK,QASvGC,EAAY,SAACR,EAAGS,GAAJ,OAAUA,GAC1B9B,EAAKyB,cAAgBnB,EAAGO,EAAEC,WAAad,EAAK0B,QAAU1B,EAAK2B,GAAGC,OAAS,EAAI5B,EAAK0B,OAASpB,EAAGI,IAAIqB,OAASP,KAQrGQ,EAAY,SAACX,GACjBrB,EAAKiC,WAAWZ,EAAGa,OAAOC,QAStBC,EAAW,SAACf,GAChBrB,EAAKqC,cAAchB,IAoGfiB,KAoBN,OAnBArC,KAAKsB,OAAOgB,QAAS,SAACC,EAAGV,GACvBQ,EAAMG,KAAKvC,EAAawC,UAAU,SAAWZ,GAAGa,KAAK3C,EAAK2B,GAAGiB,IAAI,SAAAvB,GAC/D,OACE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/js/app.2a5b3d2ecf41d1ed0f6f.js","sourcesContent":["import { globalAgent } from 'http';\n\n/** \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', '#ffcdcd'],\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) / this.metric.length ;\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 + cs.bar.offset * getHeight();\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 this.metric.forEach( (e, i) => {\n cs.bar.offset = i;\n rects[i].enter()\n .append('rect')\n .attr('fill', cs.palette.fill[i])\n .attr('stroke', cs.palette.stroke)\n .attr('class', this.selector)\n .attr('class', 'r' + i)\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 });\n if (this.goal) this.generateGoal(cs, svgContainer, false, cs.y.axisWidth + cs.bar.hPadding);\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 this.metric.forEach( (e, i) => {\n cs.bar.offset = i;\n rects[i].transition()\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('y', getYCoord)\n .attr('x', cs.y.axisWidth + cs.bar.hPadding);\n });\n if (this.goal) this.generateGoal(cs, svgContainer, false, 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 this.metric.forEach( (e, i) => {\n rects[i].exit().remove();\n });\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 this.drawGrid(cs);\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 if(!currentValue.dim) return accumulator;\n return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator;\n }\n\n const rects = []\n this.metric.forEach( (e, i) => {\n rects.push(svgContainer.selectAll('rect.r' + i).data(this.ds.map(d => {\n return {\n metric: d.metric[i],\n dim: d.dim\n } \n })))\n })\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n if (this.ds[0] && 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', '#ffcdcd'],\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) / this.metric.length ;\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 + cs.bar.offset * getWidth();\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 this.metric.forEach( (e, i) => {\n cs.bar.offset = i;\n rects[i].enter()\n .append('rect')\n .attr('fill', cs.palette.fill[i])\n .attr('stroke', cs.palette.stroke)\n .attr('class', this.selector)\n .attr('class', 'r' + i)\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 /**\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 this.metric.forEach( (e, i) => {\n cs.bar.offset = i;\n rects[i].transition()\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('x', getXCoord)\n .attr('y', getYCoord);\n });\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 this.metric.forEach( (e, i) => {\n rects[i].exit().remove();\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([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 this.drawGrid(cs);\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 = []\n this.metric.forEach( (e, i) => {\n rects.push(svgContainer.selectAll('rect.r' + i).data(this.ds.map(d => {\n return {\n metric: d.metric[i],\n dim: d.dim\n } \n })))\n })\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 this.metric.forEach( (e, i) => {\n cs.offset = i; \n points[i].enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('class', \"r\" + i)\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 });\n if (this.goal) this.generateGoal(cs, svgContainer, true, 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 this.metric.forEach( (e, i) => {\n cs.offset = i; \n points[i].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 });\n if (this.goal) this.generateGoal(cs, svgContainer, true, 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 this.metric.forEach( (e, i) => {\n points[i].exit().remove();\n });\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 this.drawGrid(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 = [];\n this.metric.forEach( (e, i) => {\n points.push(svgContainer.selectAll('circle.r' + i).data(this.ds.map(d => {\n return {\n metric: d.metric[i],\n dim: d.dim\n } \n })))\n })\n\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 palette: {\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 r: {\n width: 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) => {\n points.enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('r', cs.r.width)\n .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) \n .attr('cy', d => cs.y.scale(d.metric[1]));\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) => {\n points.transition()\n .attr('r', cs.r.width)\n .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric[1]));\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) => {\n points.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 = cs => {\n cs.y.scale = d3.scaleLinear()\n .domain([this.minTriplet.v2, this.maxTriplet.v2])\n .range([this.displayHeight - cs.x.axisHeight, this.header]);\n cs.x.scale = d3.scaleLinear()\n .domain([this.minTriplet.v1, this.maxTriplet.v1])\n .range([0, this.width]);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = cs => {\n this.drawGrid(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 const points = svgContainer.selectAll('circle').data(this.ds);\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 this.drawGrid(cs);\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 Bubble Chart 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 Bubble Chart.\n * @module bubbleChart\n */\n\nconst bubbleChart = 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 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 r: {\n max: 20,\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) => {\n points.enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('r', d => cs.r.scale(d.metric[2]))\n .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) \n .attr('cy', d => cs.y.scale(d.metric[1]));\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) => {\n points.transition()\n .attr('r', d => cs.r.scale(d.metric[2]))\n .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric[1]));\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) => {\n points.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 = cs => {\n cs.y.scale = d3.scaleLinear()\n .domain([this.minTriplet.v2 - cs.r.max, this.maxTriplet.v2 + cs.r.max])\n .range([this.displayHeight - cs.x.axisHeight, this.header]);\n cs.x.scale = d3.scaleLinear()\n .domain([this.minTriplet.v1 - cs.r.max, this.maxTriplet.v1 + cs.r.max])\n .range([0, this.width]);\n cs.r.scale = d3.scaleLinear()\n .domain([this.minTriplet.v3, this.maxTriplet.v3])\n .range([0, cs.r.max]);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = cs => {\n this.drawGrid(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 const points = svgContainer.selectAll('circle').data(this.ds);\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n\n buildScales(cs);\n drawAxis(cs);\n enter(points);\n transition(points);\n exit(points);\n \n return cs;\n};\n\nexport default bubbleChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/bubbleChart.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';\nimport bubbleChart from './import/bubbleChart';\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 * Redraw the Chart when the data is recycled\n * @memberOf Chart\n */\n drawGrid(cs) {\n if (this.chartData.grid && this.chartData.grid.enabled === true) {\n const grid = {\n x: [],\n y: []\n }\n for (let i = this.header; i < (this.height - this.header) * .80; i += this.gridTicks) {\n grid.y.push(i);\n }\n d3.select(`#${this.chartData.selector}`)\n .selectAll('line.gridLine')\n .data(grid.y).enter()\n .append('line')\n .attr('class', 'gridLine')\n .attr('x1', cs.y.axisWidth)\n .attr('x2', this.width)\n .attr('y1', d => d)\n .attr('y2', d => d)\n .style('stroke', '#D3D3D3')\n .style('stroke-width', 1)\n }\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.offsetX - 5 - 50)\n .attr('y', e.offsetY - 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.offsetX - 50)\n .attr('y', e.offsetY - 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 cs.palette.lineFill = (Array.isArray(cs.palette.lineFill)) ? cs.palette.lineFill : new Array(cs.palette.lineFill); \n cs.palette.fill = (Array.isArray(cs.palette.fill)) ? cs.palette.fill : new Array(cs.palette.fill); \n this.metric.forEach( (e, i) => {\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('x', this.width - 60)\n .attr('y', this.height * 0.95 - (i * 15))\n .style('text-anchor', 'middle')\n .text(this.metric[i]);\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 - (i * 15) - 10)\n .attr(\"width\", 30)\n .attr(\"height\", 10)\n .style(\"fill\", function () {\n const fill = cs.palette.lineFill[i] || cs.palette.fill[i];\n return fill;\n });\n })\n }\n },\n /**\n * Generate Goal \n * @memberOf Chart\n * @param {Object} cs configuration of the coordinate system\n */\n\n generateGoal(cs, svgContainer, shiftAxis, padding) {\n svgContainer.selectAll('line#goal').remove();\n const x1 = shiftAxis ? cs.y.axisWidth: cs.x.scale(this.goal) + padding;\n const x2 = shiftAxis ? 500 : cs.x.scale(this.goal) + padding;\n const y1 = shiftAxis ? cs.y.scale(this.goal) + padding : this.header;\n const y2 = shiftAxis ? cs.y.scale(this.goal) + padding : this.displayHeight - cs.x.axisHeight;\n \n svgContainer.append(\"line\")\n .attr('x1', x1)\n .attr('x2', x2)\n .attr('y1', y1)\n .attr('y2', y2)\n .attr('id', 'goal')\n .style('stroke', '#708090')\n .style('stroke-width', 1)\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 ...((typeof bubbleChart !== 'undefined') && { bubbleChart }),\n },\n computed: {\n /**\n * Dataset getter function\n * @memberOf Chart\n * @returns {Object} normalized dataset\n */\n ds() {\n const ds = { metric: [] };\n ds.metric = (Array.isArray(this.chartData.metric)) ? ds.metric = this.chartData.metric : new Array(this.chartData.metric);\n ds.dim = this.chartData.dim;\n ds.data = this.chartData.data;\n return ds.data.map((d) => {\n const td = { metric: [] };\n if (!ds.metric[0])\n td.metric[0] = d || 0;\n else {\n ds.metric.forEach(function(e, i){\n td.metric[i] = d[e] || 0;\n })\n }\n td.dim = this.chartData.dim ? d[this.chartData.dim] : null;\n return td;\n });\n },\n /**\n * Goal getter function\n * @memberOf Chart\n * @returns {number} Goal \n */\n goal() {\n return this.chartData.goal;\n },\n /**\n * Metric getter function\n * @memberOf Chart\n * @returns {array} Metrics \n */\n metric() {\n const metric = (Array.isArray(this.chartData.metric)) ? this.chartData.metric : new Array(this.chartData.metric);\n return 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 * Grid Tick getter function\n * @memberOf Chart\n * @returns {number} gridTicks \n */\n gridTicks() {\n if (this.chartData.grid && this.chartData.grid.gridTicks != null) {\n return this.chartData.grid.gridTicks;\n }\n return 100;\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 maxium value for triplet\n * @memberOf Chart\n * @returns {Array} Max values for triplet\n */\n maxTriplet() {\n const max = {\n v1: 0,\n v2: 0,\n v3: 0\n };\n this.ds.forEach(e => {\n max.v1 = max.v1 > e.metric[0] ? max.v1 : e.metric[0];\n max.v2 = max.v2 > e.metric[1] ? max.v2 : e.metric[1];\n max.v3 = max.v3 > e.metric[2] ? max.v3 : e.metric[2];\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 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 * Get the minimum value for triplet\n * @memberOf Chart\n * @returns {Array} Min values for triplet\n */\n minTriplet() {\n var results = {\n v1: [],\n v2: [],\n v3: []\n };\n this.ds.forEach(e => {\n results.v1.push(e.metric[0])\n results.v2.push(e.metric[1])\n results.v3.push(e.metric[2])\n })\n return {\n v1: (Math.min(...results.v1.map(o => o))),\n v2: (Math.min(...results.v2.map(o => o))),\n v3: (Math.min(...results.v3.map(o => o)))\n };\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.bubbleChartData}})],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.lineGraphData}})],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-4162c945\",\"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-4162c945\\\",\\\"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-4162c945\\\",\\\"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.a391d398da741e3a07d3.js b/dist/static/js/app.a391d398da741e3a07d3.js new file mode 100644 index 0000000..f52ec57 --- /dev/null +++ b/dist/static/js/app.a391d398da741e3a07d3.js @@ -0,0 +1,2 @@ +webpackJsonp([1],{0:function(t,a){},1: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"),c=e.n(n),l=e("fZjL"),o=e.n(l),h=e("Dd8w"),d=e.n(h),f=e("woOf"),u=e.n(f),x=(e("nFqq"),u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("bmQh"))),m=function(){var t=this,a=x.select("#"+this.chartData.selector),e={palette:{fill:["#005792","#ffcdcd"],stroke:"#d1f4fa"},bar:{hPadding:8,vPadding:5},x:{label:this.dim,axisHeight:10,ticks:5},y:{label:this.metric,domain:[],range:[],axisWidth:50}},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)/t.metric.length},s=function(a,i){return i*(t.displayHeight-e.x.axisHeight-t.header)/t.ds.length+1+t.header+e.bar.offset*r()},n=function(a){t.addTooltip(a,window.event)},c=function(a){t.removeTooltip(a)},l=[];return this.metric.forEach(function(e,i){l.push(a.selectAll("rect.r"+i).data(t.ds.map(function(t){return{metric:t.metric[i],dim:t.dim}})))}),e=this.setOverrides(e,this.chartData.overrides),this.ds[0]&&this.ds[0].dim&&(e.y.axisWidth=e.y.axisWidth||10*this.ds.reduce(function(t,a){return a.dim&&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),t.drawGrid(e),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){t.metric.forEach(function(l,o){e.bar.offset=o,a[o].enter().append("rect").attr("fill",e.palette.fill[o]).attr("stroke",e.palette.stroke).attr("class",t.selector).attr("class","r"+o).attr("width",i).attr("height",r).attr("y",s).attr("x",e.y.axisWidth+e.bar.hPadding).on("mouseover",n).on("mouseout",c)}),t.goal&&t.generateGoal(e,!1,e.y.axisWidth+e.bar.hPadding)}(l),function(a){t.metric.forEach(function(t,n){e.bar.offset=n,a[n].transition().attr("width",i).attr("height",r).attr("y",s).attr("x",e.y.axisWidth+e.bar.hPadding)}),t.goal&&t.generateGoal(e,!1,e.y.axisWidth+e.bar.hPadding)}(l),function(a){t.metric.forEach(function(t,e){a[e].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","#ffcdcd"],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)/t.metric.length},r=function(a){return t.displayHeight-e.y.scale(a.metric)},s=function(a,r){return r*(t.width-e.y.axisWidth)/t.chartData.data.length+e.y.axisWidth+e.bar.offset*i()},n=function(t){return e.y.scale(t.metric)},c=function(a){t.addTooltip(a,window.event)},l=function(a){t.removeTooltip(a)},o=[];return this.metric.forEach(function(e,i){o.push(a.selectAll("rect.r"+i).data(t.ds.map(function(t){return{metric:t.metric[i],dim:t.dim}})))}),(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),t.drawGrid(e),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){t.metric.forEach(function(o,h){e.bar.offset=h,a[h].enter().append("rect").attr("fill",e.palette.fill[h]).attr("stroke",e.palette.stroke).attr("class",t.selector).attr("class","r"+h).attr("width",i).attr("height",r).attr("x",s).attr("y",n).on("mouseover",c).on("mouseout",l)})}(o),function(a){t.metric.forEach(function(t,c){e.bar.offset=c,a[c].transition().attr("width",i).attr("height",r).attr("x",s).attr("y",n)})}(o),function(a){t.metric.forEach(function(t,e){a[e].exit().remove()})}(o),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:{label:this.dim,domain:[],range:[],axisHeight:20},y:{label:this.metric,axisWidth:40,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=[];this.metric.forEach(function(t,i){r.push(e.selectAll("circle.r"+i).data(a.ds.map(function(t){return{metric:t.metric[i],dim:t.dim}})))});var 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){a.drawGrid(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)}),a.metric.forEach(function(e,r){i.offset=r,t[r].enter().append("circle").attr("class",a.selector).attr("class","r"+r).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)})}),a.goal&&a.generateGoal(i,!0,0)}(r,s),function(t,e){a.metric.forEach(function(t,r){e[r].transition().attr("d",i.lineFunction[r](a.ds))}),a.metric.forEach(function(a,e){i.offset=e,t[e].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)})}),a.goal&&a.generateGoal(i,!0,0)}(r,s),function(t,e){a.metric.forEach(function(a,e){t[e].exit().remove()}),a.metric.forEach(function(t,a){e[a].exit().remove()})}(r,s),i},b=u()({},e("sHXk"),e("dJjO"),e("Mx2h")),D=function(){var t=this,a=b.select("#"+this.chartData.selector),e={palette:{pointFill:"#005792",pointStroke:"#d1f4fa"},x:{domain:[],range:[],axisHeight:20,label:this.metric[0]},y:{axisWidth:30,ticks:5,label:this.metric[1]},r:{width:5}},i=a.selectAll("circle").data(this.ds);return function(a){a.y.scale=b.scaleLinear().domain([t.minTriplet.v2-.05*t.maxTriplet.v2,t.maxTriplet.v2+.05*t.maxTriplet.v2]).range([t.displayHeight-a.x.axisHeight,t.header]),a.x.scale=b.scaleLinear().domain([t.minTriplet.v1-.05*t.maxTriplet.v2,t.maxTriplet.v1+.05*t.maxTriplet.v1]).range([0,t.width])}(e=this.setOverrides(e,this.chartData.overrides)),function(e){t.drawGrid(e),e.x.axis=b.axisBottom().scale(e.x.scale),e.x.xOffset=e.y.axisWidth+5,e.x.yOffset=t.displayHeight-e.x.axisHeight,e.y.axis=b.axisLeft().ticks(e.y.ticks,"s").scale(e.y.scale),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)}(e),function(a){a.enter().append("circle").attr("class",t.selector).attr("fill",e.palette.fill).attr("stroke",e.palette.stroke).attr("r",e.r.width).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.metric[0])+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric[1])})}(i),function(t){t.transition().attr("r",e.r.width).attr("cx",function(t){return e.x.scale(t.metric[0])+e.y.axisWidth+5}).attr("cy",function(t){return e.y.scale(t.metric[1])})}(i),function(t){t.exit().remove()}(i),e},w=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),O=function(){var t=this,a=w.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=w.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=w.arc().outerRadius(e.radius-10).innerRadius(25),l=w.pie().sort(null).value(function(t){return t.metric}),o=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+")")}(o),function(t){t.transition().attr("d",c).attr("fill",r)}(o),function(t){t.exit().remove()}(o),e},k=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),H=function(){var t=this,a=k.select("#"+this.chartData.selector),e={palette:{stroke:"#d1f4fa",fill:"#005792"},x:{domain:[],range:[],axisHeight:45,axisWidth:45},y:{axisWidth:45,ticks:10}},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=k.scaleLinear().domain([0,t.max]).range([t.displayHeight-e.x.axisHeight,t.titleHeight]),e.y.axis=k.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-e.x.axisWidth)*i/t.ds.length)}),e.x.scale=k.scaleOrdinal().domain(e.x.domain).range(e.x.range),e.x.axis=k.axisBottom().scale(e.x.scale),t.drawGrid(e),e.polyFunction=k.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},C=u()({},e("sHXk"),e("dJjO"),e("Mx2h"),e("1gFY")),T=function(t){var a=this,e=C.select("#"+this.chartData.selector),i={palette:{fill:"#005792",stroke:"#d1f4fa"},x:{domain:[],range:[],axisHeight:20},y:{axisWidth:30,ticks:5},r:{max:20}},r=e.selectAll("circle").data(this.ds);return function(t){t.y.scale=C.scaleLinear().domain([a.minTriplet.v2-t.r.max,a.maxTriplet.v2+t.r.max]).range([a.displayHeight-t.x.axisHeight,a.header]),t.x.scale=C.scaleLinear().domain([a.minTriplet.v1-t.r.max,a.maxTriplet.v1+t.r.max]).range([0,a.width]),t.r.scale=C.scaleLinear().domain([a.minTriplet.v3,a.maxTriplet.v3]).range([0,t.r.max])}(i=this.setOverrides(i,this.chartData.overrides)),function(t){a.drawGrid(t),t.x.axis=C.axisBottom().scale(t.x.scale),t.x.xOffset=t.y.axisWidth+5,t.x.yOffset=a.displayHeight-t.x.axisHeight,t.y.axis=C.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){t.enter().append("circle").attr("class",a.selector).attr("fill",i.palette.fill).attr("stroke",i.palette.stroke).on("mouseover",function(t){a.addTooltip(t,window.event)}).on("mouseout",function(t){a.removeTooltip(t)}).attr("r",function(t){return i.r.scale(t.metric[2])}).attr("cx",function(t){return i.x.scale(t.metric[0])+i.y.axisWidth+5}).attr("cy",function(t){return i.y.scale(t.metric[1])})}(r),function(t){t.transition().attr("r",function(t){return i.r.scale(t.metric[2])}).attr("cx",function(t){return i.x.scale(t.metric[0])+i.y.axisWidth+5}).attr("cy",function(t){return i.y.scale(t.metric[1])})}(r),function(t){t.exit().remove()}(r),i},W=u()({},e("sHXk")),A={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.generateAxisLabels(t),this.generateLegend(t)},refreshChart:function(){this.clearAxis(),this[this.chartData.chartType]("refresh")},drawGrid:function(t){if(this.chartData.grid&&!0===this.chartData.grid.enabled){for(var a={x:[],y:[]},e=this.header;e<.8*(this.height-this.header);e+=this.gridTicks)a.y.push(e);W.select("#"+this.chartData.selector).selectAll("line.gridLine").data(a.y).enter().append("line").attr("class","gridLine").attr("x1",t.y.axisWidth).attr("x2",this.width).attr("y1",function(t){return t}).attr("y2",function(t){return t}).style("stroke","#D3D3D3").style("stroke-width",1)}},clearAxis:function(){W.select("#"+this.chartData.selector).selectAll(".axis").remove()},clearCanvas:function(){W.select("#"+this.chartData.selector).selectAll("*").remove()},drawTitle:function(){W.select("#"+this.chartData.selector).append("text").attr("font-size","20").attr("x",this.width/2).attr("y",this.titleHeight-.1*this.titleHeight).style("text-anchor","middle").text(this.chartData.title),W.select("#"+this.chartData.selector).append("text").attr("font-size","12").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){W.select("#"+this.chartData.selector).append("rect").attr("x",a.offsetX-5-50).attr("y",a.offsetY-13-25).attr("height","16px").attr("width","80px").attr("class","tt").attr("fill","white"),W.select("#"+this.chartData.selector).append("text").attr("x",a.offsetX-50).attr("y",a.offsetY-25).attr("class","tt").attr("font-size","10px").text(t.dim+":"+t.metric)},removeTooltip:function(){W.select("#"+this.chartData.selector).selectAll(".tt").remove()},setOverrides:function(t,a){a=a||{};var e=o()(t),i=!0,r=!1,s=void 0;try{for(var n,l=c()(e);!(i=(n=l.next()).done);i=!0){var h=n.value;u()(t[h],a[h])}}catch(t){r=!0,s=t}finally{try{!i&&l.return&&l.return()}finally{if(r)throw s}}return t},generateLegend:function(t){var a=this;this.chartData.legends&&!0===this.chartData.legends.enabled&&(t.palette.lineFill=Array.isArray(t.palette.lineFill)?t.palette.lineFill:new Array(t.palette.lineFill),t.palette.fill=Array.isArray(t.palette.fill)?t.palette.fill:new Array(t.palette.fill),this.metric.forEach(function(e,i){W.select("#"+a.chartData.selector).append("text").attr("font-size","10").attr("x",a.width-60).attr("y",.95*a.height-15*i).style("text-anchor","middle").text(a.metric[i]),W.select("#"+a.chartData.selector).append("g").attr("class","legends").append("rect").attr("x",a.width-30).attr("y",.95*a.height-15*i-10).attr("width",30).attr("height",10).style("fill",function(){return t.palette.lineFill[i]||t.palette.fill[i]})}))},generateGoal:function(t,a,e){W.select("#"+this.chartData.selector).selectAll("line#goal").remove();var i=a?t.y.axisWidth:t.x.scale(this.goal)+e,r=a?this.width:t.x.scale(this.goal)+e,s=a?t.y.scale(this.goal)+e:this.header,n=a?t.y.scale(this.goal)+e:this.displayHeight-t.x.axisHeight;W.select("#"+this.chartData.selector).append("line").attr("x1",i).attr("x2",r).attr("y1",s).attr("y2",n).attr("id","goal").style("stroke","#708090").style("stroke-width",1)},generateAxisLabels:function(t){var a=this.chartData.legends?.85:.95;this.chartData.label&&(W.select("#"+this.chartData.selector).selectAll("text.axisLabel").remove(),t.x&&t.x.label&&W.select("#"+this.chartData.selector).append("text").attr("font-size","10").attr("x",this.width/2).attr("y",this.height*a).attr("id","xAxisLabel").attr("class","axisLabel").style("text-anchor","middle").text(t.x.label),t.y&&t.y.label&&W.select("#"+this.chartData.selector).append("text").attr("font-size","10").attr("x",10).attr("y",this.height/2).attr("id","xAxisLabel").attr("class","axisLabel").style("text-anchor","middle").text(t.y.label).attr("transform","rotate(-90,10, "+this.height/2+")"))},metricAsArray:function(t){return t=this.chartData.data.map(function(a){return a[t]})}},{barChart:m},{vBarChart:p},{scatterPlot:D},{pieChart:O},{areaChart:H},{lineGraph:v},{bubbleChart:T}),computed:{ds:function(){var t=this,a={metric:[]};return a.metric=Array.isArray(this.chartData.metric)?a.metric=this.chartData.metric:new Array(this.chartData.metric),a.dim=this.chartData.dim,a.data=this.chartData.data,a.data.map(function(e){var i={metric:[]};return a.metric[0]?a.metric.forEach(function(t,a){i.metric[a]=e[t]||0}):i.metric[0]=e||0,i.dim=t.chartData.dim?e[t.chartData.dim]:null,i})},dim:function(){return this.chartData.dim||"undefined"},goal:function(){return this.chartData.goal},metric:function(){var t=Array.isArray(this.chartData.metric)?this.chartData.metric:new Array(this.chartData.metric);return t},height:function(){return this.chartData.height-10||190},width:function(){return this.chartData.width-10||190},gridTicks:function(){return this.chartData.grid&&null!=this.chartData.grid.gridTicks?this.chartData.grid.gridTicks:100},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},maxTriplet:function(){var t={v1:0,v2:0,v3:0};return this.ds.forEach(function(a){t.v1=t.v1>a.metric[0]?t.v1:a.metric[0],t.v2=t.v2>a.metric[1]?t.v2:a.metric[1],t.v3=t.v3>a.metric[2]?t.v3:a.metric[2]}),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})))},minTriplet:function(){var t={v1:[],v2:[],v3:[]};return this.ds.forEach(function(a){t.v1.push(a.metric[0]),t.v2.push(a.metric[1]),t.v3.push(a.metric[2])}),{v1:Math.min.apply(Math,s()(t.v1.map(function(t){return t}))),v2:Math.min.apply(Math,s()(t.v2.map(function(t){return t}))),v3:Math.min.apply(Math,s()(t.v3.map(function(t){return t})))}},displayHeight:function(){return this.chartData.legends&&!0===this.chartData.legends.enabled?.8*this.height:.9*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:" "})}},E=A;"undefined"!=typeof window&&window.Vue&&window.Vue.use(A);var L=[{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}],_={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:L,areaChartData:{chartType:"areaChart",selector:"areaChart",title:"Area Chart",width:600,height:500,metric:["total"],dim:"month",data:L,legends:{enabled:!0,height:25,width:50}},bubbleChartData:{chartType:"bubbleChart",selector:"bubbleChart",title:"Bubble Chart",subtitle:"Sales by month",width:600,height:500,dim:"month",grid:{enabled:!0},metric:["total","forecast","yoy"],data:L,goal:500},lineGraphData:{chartType:"lineGraph",selector:"lineGraph",title:"Line Graph",subtitle:"Sales by month",width:600,height:500,goal:600,metric:["total","forecast"],dim:"month",data:L,label:!0,legends:{enabled:!0,height:25,width:50},overrides:{palette:{fill:["#34495E","#4fc08d"],stroke:"#41B883"}}},vBarChartData:{chartType:"vBarChart",selector:"vChart",title:"Bar Chart",subtitle:"Sales by month",width:600,height:500,metric:["total","forecast"],dim:"month",data:L,legends:{enabled:!0,height:25,width:50}},barChartData:{chartType:"barChart",selector:"barChart",title:"Bar Chart",subtitle:"Sales by month",width:600,height:500,metric:["total","forecast"],dim:"month",data:L,label:!0},pieChartData:{chartType:"pieChart",selector:"pieChart",title:"Pie Chart",subtitle:"Sales by month",width:600,height:500,metric:"total",dim:"month",data:L},scatterPlotData:{chartType:"scatterPlot",selector:"scatterPlot",title:"Scatter Plot",subtitle:"Sales by month",width:600,height:500,dim:"month",label:{enabled:!0},metric:["total","forecast"],data:L}}}},F={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"},[e("v-chart",{attrs:{chartData:t.areaChartData}})],1),t._v(" "),e("div",{staticClass:"col-12"},[e("v-chart",{attrs:{chartData:t.bubbleChartData}})],1),t._v(" "),e("div",{staticClass:"col-12"},[e("v-chart",{attrs:{chartData:t.vBarChartData}})],1),t._v(" "),e("div",{staticClass:"col-12"},[e("v-chart",{attrs:{chartData:t.barChartData}})],1),t._v(" "),e("div",{staticClass:"col-12"},[e("v-chart",{attrs:{chartData:t.pieChartData}})],1),t._v(" "),e("div",{staticClass:"col-12"},[e("v-chart",{attrs:{chartData:t.scatterPlotData}})],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")(_,F,!1,function(t){e("k7/V")},null,null).exports}},G={render:function(){var t=this.$createElement,a=this._self._c||t;return a("div",{attrs:{id:"app"}},[a("chartExample")],1)},staticRenderFns:[]};var M=e("VU/8")(P,G,!1,function(t){e("Gf/I")},null,null).exports;i.a.config.productionTip=!1,i.a.use(E),new i.a({el:"#app",components:{App:M},template:""})},"dLd/":function(t,a,e){t.exports=e.p+"static/img/logo.7eeeac5.png"},"k7/V":function(t,a){}},["NHnr"]); +//# sourceMappingURL=app.a391d398da741e3a07d3.js.map \ No newline at end of file diff --git a/dist/static/js/app.a391d398da741e3a07d3.js.map b/dist/static/js/app.a391d398da741e3a07d3.js.map new file mode 100644 index 0000000..74d6b4c --- /dev/null +++ b/dist/static/js/app.a391d398da741e3a07d3.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/import/bubbleChart.js","webpack:///./src/v-chart-plugin.js","webpack:///./src/assets/data/sales.js","webpack:///src/components/chartExample.vue","webpack:///./src/components/chartExample.vue?19f1","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","label","dim","axisHeight","ticks","y","metric","domain","range","axisWidth","getWidth","d","scale","getHeight","displayHeight","header","ds","length","getYCoord","i","offset","mouseOver","addTooltip","window","event","mouseOut","removeTooltip","rects","forEach","e","push","selectAll","data","map","setOverrides","overrides","reduce","accumulator","currentValue","scaleLinear","max","width","t","scaleOrdinal","drawGrid","axis","axisBottom","axisLeft","yOffset","xOffset","append","attr","call","enter","on","goal","generateGoal","transition","exit","remove","vBarChart","getXCoord","lineGraph","mode","lineFill","pointFill","pointStroke","lineFunction","line","points","path","min","buildScales","drawAxis","scatterPlot","r","minTriplet","v2","maxTriplet","v1","pieChart","radius","ordinalColors","height","color","getColor","arc","outerRadius","innerRadius","pie","sort","value","merge","areaChart","getPoints","p","poly","join","titleHeight","polyFunction","s","bubbleChart","v3","Chart","install","Vue","component","props","chartType","methods","initalizeChart","drawTitle","generateAxisLabels","generateLegend","refreshChart","clearAxis","grid","enabled","gridTicks","style","clearCanvas","text","title","subtitleHeight","subtitle","offsetX","offsetY","keys","keys_default","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","get_iterator_default","next","done","key","err","return","legends","Array","isArray","shiftAxis","padding","x1","x2","y1","y2","footer","metricAsArray","computed","_this2","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","bubbleChartData","lineGraphData","vBarChartData","barChartData","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":"yRAYMA,aAAKC,OACTC,EAAQ,QACRA,EAAQ,QACRA,EAAQ,QACRA,EAAQ,UA4MKC,EAtME,WAAiB,IAAAC,EAAAC,KAK1BC,EAAeN,EAAGO,OAAH,IAAcF,KAAKG,UAAUC,UAK9CC,GACFC,SACEC,MAAO,UAAW,WAClBC,OAAQ,WAEVC,KACEC,SAAU,EACVC,SAAU,GAEZC,GACEC,MAAOb,KAAKc,IACZC,WAAY,GACZC,MAAO,GAETC,GACEJ,MAAOb,KAAKkB,OACZC,UACAC,SACAC,UAAW,KAUTC,EAAW,SAAAC,GAAA,OAAKlB,EAAGO,EAAEY,MAAMD,EAAEL,SAO7BO,EAAY,mBACf1B,EAAK2B,cAAgBrB,EAAGO,EAAEG,WAAahB,EAAK4B,OAAStB,EAAGI,IAAIE,UAAYZ,EAAK6B,GAAGC,OAAS,GAAK9B,EAAKmB,OAAOW,QASvGC,EAAY,SAACP,EAAGQ,GAAJ,OAAUA,GAC1BhC,EAAK2B,cAA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GAGR,IAAIE,KACFuI,GAAI,OACJT,YAAcD,OACdhE,SAAU,mCCdZ2E,EAAAC,QAAiBpB,EAAA/H,EAAuB","file":"static/js/app.a391d398da741e3a07d3.js","sourcesContent":["import { globalAgent } from 'http';\n\n/** \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', '#ffcdcd'],\n stroke: '#d1f4fa',\n },\n bar: {\n hPadding: 8,\n vPadding: 5,\n },\n x: {\n label: this.dim,\n axisHeight: 10,\n ticks: 5,\n },\n y: {\n label: this.metric,\n domain: [],\n range: [],\n axisWidth: 50,\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) / this.metric.length ;\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 + cs.bar.offset * getHeight();\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 this.metric.forEach( (e, i) => {\n cs.bar.offset = i;\n rects[i].enter()\n .append('rect')\n .attr('fill', cs.palette.fill[i])\n .attr('stroke', cs.palette.stroke)\n .attr('class', this.selector)\n .attr('class', 'r' + i)\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 });\n if (this.goal) this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding);\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 this.metric.forEach( (e, i) => {\n cs.bar.offset = i;\n rects[i].transition()\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('y', getYCoord)\n .attr('x', cs.y.axisWidth + cs.bar.hPadding);\n });\n if (this.goal) this.generateGoal(cs, false, 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 this.metric.forEach( (e, i) => {\n rects[i].exit().remove();\n });\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 this.drawGrid(cs);\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 if(!currentValue.dim) return accumulator;\n return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator;\n }\n\n const rects = []\n this.metric.forEach( (e, i) => {\n rects.push(svgContainer.selectAll('rect.r' + i).data(this.ds.map(d => {\n return {\n metric: d.metric[i],\n dim: d.dim\n } \n })))\n })\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n if (this.ds[0] && 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', '#ffcdcd'],\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) / this.metric.length ;\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 + cs.bar.offset * getWidth();\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 this.metric.forEach( (e, i) => {\n cs.bar.offset = i;\n rects[i].enter()\n .append('rect')\n .attr('fill', cs.palette.fill[i])\n .attr('stroke', cs.palette.stroke)\n .attr('class', this.selector)\n .attr('class', 'r' + i)\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 /**\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 this.metric.forEach( (e, i) => {\n cs.bar.offset = i;\n rects[i].transition()\n .attr('width', getWidth)\n .attr('height', getHeight)\n .attr('x', getXCoord)\n .attr('y', getYCoord);\n });\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 this.metric.forEach( (e, i) => {\n rects[i].exit().remove();\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([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 this.drawGrid(cs);\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 = []\n this.metric.forEach( (e, i) => {\n rects.push(svgContainer.selectAll('rect.r' + i).data(this.ds.map(d => {\n return {\n metric: d.metric[i],\n dim: d.dim\n } \n })))\n })\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 label: this.dim,\n domain: [],\n range: [],\n axisHeight: 20,\n },\n y: {\n label: this.metric,\n axisWidth: 40,\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 this.metric.forEach( (e, i) => {\n cs.offset = i; \n points[i].enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('class', \"r\" + i)\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 });\n if (this.goal) this.generateGoal(cs, true, 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 this.metric.forEach( (e, i) => {\n cs.offset = i; \n points[i].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 });\n if (this.goal) this.generateGoal(cs, true, 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 this.metric.forEach( (e, i) => {\n points[i].exit().remove();\n });\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 this.drawGrid(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 = [];\n this.metric.forEach( (e, i) => {\n points.push(svgContainer.selectAll('circle.r' + i).data(this.ds.map(d => {\n return {\n metric: d.metric[i],\n dim: d.dim\n } \n })))\n })\n\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 palette: {\n pointFill: '#005792',\n pointStroke: '#d1f4fa',\n },\n x: {\n domain: [],\n range: [],\n axisHeight: 20,\n label: this.metric[0],\n },\n y: {\n axisWidth: 30,\n ticks: 5,\n label: this.metric[1],\n },\n r: {\n width: 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) => {\n points.enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('fill', cs.palette.fill)\n .attr('stroke', cs.palette.stroke)\n .attr('r', cs.r.width)\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.metric[0]) + cs.y.axisWidth + 5) \n .attr('cy', d => cs.y.scale(d.metric[1]));\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) => {\n points.transition()\n .attr('r', cs.r.width)\n .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric[1]));\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) => {\n points.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 = cs => {\n cs.y.scale = d3.scaleLinear()\n .domain([this.minTriplet.v2 - this.maxTriplet.v2 * .05, this.maxTriplet.v2 + this.maxTriplet.v2 * .05])\n .range([this.displayHeight - cs.x.axisHeight, this.header]);\n cs.x.scale = d3.scaleLinear()\n .domain([this.minTriplet.v1 - this.maxTriplet.v2 * .05, this.maxTriplet.v1 + this.maxTriplet.v1 * .05])\n .range([0, this.width]);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = cs => {\n this.drawGrid(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 const points = svgContainer.selectAll('circle').data(this.ds);\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 ticks: 10,\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(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((((\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 this.drawGrid(cs);\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 Bubble Chart 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 Bubble Chart.\n * @module bubbleChart\n */\n\nconst bubbleChart = 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 fill: '#005792',\n stroke: '#d1f4fa',\n },\n x: {\n domain: [],\n range: [],\n axisHeight: 20,\n },\n y: {\n axisWidth: 30,\n ticks: 5,\n },\n r: {\n max: 20,\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) => {\n points.enter()\n .append('circle')\n .attr('class', this.selector)\n .attr('fill', cs.palette.fill)\n .attr('stroke', cs.palette.stroke)\n .on('mouseover', (d) => {\n this.addTooltip(d, window.event);\n })\n .on('mouseout', (d) => {\n this.removeTooltip(d);\n })\n .attr('r', d => cs.r.scale(d.metric[2]))\n .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) \n .attr('cy', d => cs.y.scale(d.metric[1]));\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) => {\n points.transition()\n .attr('r', d => cs.r.scale(d.metric[2]))\n .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5)\n .attr('cy', d => cs.y.scale(d.metric[1]));\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) => {\n points.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 = cs => {\n cs.y.scale = d3.scaleLinear()\n .domain([this.minTriplet.v2 - cs.r.max, this.maxTriplet.v2 + cs.r.max])\n .range([this.displayHeight - cs.x.axisHeight, this.header]);\n cs.x.scale = d3.scaleLinear()\n .domain([this.minTriplet.v1 - cs.r.max, this.maxTriplet.v1 + cs.r.max])\n .range([0, this.width]);\n cs.r.scale = d3.scaleLinear()\n .domain([this.minTriplet.v3, this.maxTriplet.v3])\n .range([0, cs.r.max]);\n };\n /**\n * Draws the x and y axes on the svg\n * @member drawAxis\n * @function\n */\n const drawAxis = cs => {\n this.drawGrid(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 const points = svgContainer.selectAll('circle').data(this.ds);\n\n cs = this.setOverrides(cs, this.chartData.overrides);\n\n buildScales(cs);\n drawAxis(cs);\n enter(points);\n transition(points);\n exit(points);\n \n return cs;\n};\n\nexport default bubbleChart;\n\n\n\n// WEBPACK FOOTER //\n// ./src/import/bubbleChart.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';\nimport bubbleChart from './import/bubbleChart';\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.generateAxisLabels(cs);\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 * Redraw the Chart when the data is recycled\n * @memberOf Chart\n */\n drawGrid(cs) {\n if (this.chartData.grid && this.chartData.grid.enabled === true) {\n const grid = {\n x: [],\n y: []\n }\n for (let i = this.header; i < (this.height - this.header) * .80; i += this.gridTicks) {\n grid.y.push(i);\n }\n d3.select(`#${this.chartData.selector}`)\n .selectAll('line.gridLine')\n .data(grid.y).enter()\n .append('line')\n .attr('class', 'gridLine')\n .attr('x1', cs.y.axisWidth)\n .attr('x2', this.width)\n .attr('y1', d => d)\n .attr('y2', d => d)\n .style('stroke', '#D3D3D3')\n .style('stroke-width', 1)\n }\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('font-size', '20')\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('font-size', '12')\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.offsetX - 5 - 50)\n .attr('y', e.offsetY - 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.offsetX - 50)\n .attr('y', e.offsetY - 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 cs.palette.lineFill = (Array.isArray(cs.palette.lineFill)) ? cs.palette.lineFill : new Array(cs.palette.lineFill); \n cs.palette.fill = (Array.isArray(cs.palette.fill)) ? cs.palette.fill : new Array(cs.palette.fill); \n this.metric.forEach( (e, i) => {\n d3.select(`#${this.chartData.selector}`)\n .append('text')\n .attr('font-size', '10')\n .attr('x', this.width - 60)\n .attr('y', this.height * 0.95 - (i * 15))\n .style('text-anchor', 'middle')\n .text(this.metric[i]);\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 - (i * 15) - 10)\n .attr(\"width\", 30)\n .attr(\"height\", 10)\n .style(\"fill\", function () {\n const fill = cs.palette.lineFill[i] || cs.palette.fill[i];\n return fill;\n });\n })\n }\n },\n /**\n * Generate Goal \n * @memberOf Chart\n * @param {Object} cs configuration of the coordinate system\n */\n\n generateGoal(cs, shiftAxis, padding) {\n d3.select(`#${this.chartData.selector}`).selectAll('line#goal').remove();\n const x1 = shiftAxis ? cs.y.axisWidth: cs.x.scale(this.goal) + padding;\n const x2 = shiftAxis ? this.width : cs.x.scale(this.goal) + padding;\n const y1 = shiftAxis ? cs.y.scale(this.goal) + padding : this.header;\n const y2 = shiftAxis ? cs.y.scale(this.goal) + padding : this.displayHeight - cs.x.axisHeight;\n \n d3.select(`#${this.chartData.selector}`).append('line')\n .attr('x1', x1)\n .attr('x2', x2)\n .attr('y1', y1)\n .attr('y2', y2)\n .attr('id', 'goal')\n .style('stroke', '#708090')\n .style('stroke-width', 1)\n },\n /**\n * Generate Axis Lables\n * @memberOf Chart\n * @param {Object} cs configuration of the coordinate system \n */\n generateAxisLabels(cs) {\n let footer = (this.chartData.legends) ? .85 : .95;\n if (!this.chartData.label) return;\n d3.select(`#${this.chartData.selector}`).selectAll('text.axisLabel').remove();\n \n if (cs.x && cs.x.label)\n d3.select(`#${this.chartData.selector}`).append('text')\n .attr('font-size', '10')\n .attr('x', this.width / 2)\n .attr('y', this.height * footer)\n .attr('id', 'xAxisLabel')\n .attr('class', 'axisLabel')\n .style('text-anchor', 'middle')\n .text(cs.x.label)\n\n if (cs.y && cs.y.label)\n d3.select(`#${this.chartData.selector}`).append('text')\n .attr('font-size', '10')\n .attr('x', 10)\n .attr('y', this.height / 2)\n .attr('id', 'xAxisLabel')\n .attr('class', 'axisLabel')\n .style('text-anchor', 'middle')\n .text(cs.y.label)\n .attr('transform', `rotate(-90,10, ${this.height / 2})`)\n },\n /**\n * get the values of a metric as an array\n * @memberOf Chart\n * @returns {Array} metric values\n */\n metricAsArray(metric) {\n metric = this.chartData.data.map(d => d[metric]);\n return metric; \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 ...((typeof bubbleChart !== 'undefined') && { bubbleChart }),\n },\n computed: {\n /**\n * Dataset getter function\n * @memberOf Chart\n * @returns {Object} normalized dataset\n */\n ds() {\n const ds = { metric: [] };\n ds.metric = (Array.isArray(this.chartData.metric)) ? ds.metric = this.chartData.metric : new Array(this.chartData.metric);\n ds.dim = this.chartData.dim;\n ds.data = this.chartData.data;\n return ds.data.map((d) => {\n const td = { metric: [] };\n if (!ds.metric[0])\n td.metric[0] = d || 0;\n else {\n ds.metric.forEach(function(e, i){\n td.metric[i] = d[e] || 0;\n })\n }\n td.dim = this.chartData.dim ? d[this.chartData.dim] : null;\n return td;\n });\n },\n /**\n * Dimension getter function\n * @memberOf Chart\n * @returns {string} dim \n */\n dim() {\n return this.chartData.dim || \"undefined\";\n },\n /**\n * Goal getter function\n * @memberOf Chart\n * @returns {number} Goal \n */\n goal() {\n return this.chartData.goal;\n },\n /**\n * Metric getter function\n * @memberOf Chart\n * @returns {array} Metrics \n */\n metric() {\n const metric = (Array.isArray(this.chartData.metric)) ? this.chartData.metric : new Array(this.chartData.metric);\n return metric;\n },\n /**\n * Height getter function\n * @memberOf Chart\n * @returns {number} Chart Height\n */\n height() {\n return this.chartData.height - 10 || 190;\n },\n /**\n * Width getter function\n * @memberOf Chart\n * @returns {number} Chart width\n */\n width() {\n return this.chartData.width - 10 || 190;\n },\n /**\n * Grid Tick getter function\n * @memberOf Chart\n * @returns {number} gridTicks \n */\n gridTicks() {\n if (this.chartData.grid && this.chartData.grid.gridTicks != null) {\n return this.chartData.grid.gridTicks;\n }\n return 100;\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 maxium value for triplet\n * @memberOf Chart\n * @returns {Array} Max values for triplet\n */\n maxTriplet() {\n const max = {\n v1: 0,\n v2: 0,\n v3: 0\n };\n this.ds.forEach(e => {\n max.v1 = max.v1 > e.metric[0] ? max.v1 : e.metric[0];\n max.v2 = max.v2 > e.metric[1] ? max.v2 : e.metric[1];\n max.v3 = max.v3 > e.metric[2] ? max.v3 : e.metric[2];\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 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 * Get the minimum value for triplet\n * @memberOf Chart\n * @returns {Array} Min values for triplet\n */\n minTriplet() {\n var results = {\n v1: [],\n v2: [],\n v3: []\n };\n this.ds.forEach(e => {\n results.v1.push(e.metric[0])\n results.v2.push(e.metric[1])\n results.v3.push(e.metric[2])\n })\n return {\n v1: (Math.min(...results.v1.map(o => o))),\n v2: (Math.min(...results.v2.map(o => o))),\n v3: (Math.min(...results.v3.map(o => o)))\n };\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 * .90;\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\"},[_c('v-chart',{attrs:{\"chartData\":_vm.areaChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12\"},[_c('v-chart',{attrs:{\"chartData\":_vm.bubbleChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12\"},[_c('v-chart',{attrs:{\"chartData\":_vm.vBarChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12\"},[_c('v-chart',{attrs:{\"chartData\":_vm.barChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12\"},[_c('v-chart',{attrs:{\"chartData\":_vm.pieChartData}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-12\"},[_c('v-chart',{attrs:{\"chartData\":_vm.scatterPlotData}})],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-0a5a8b4e\",\"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-0a5a8b4e\\\",\\\"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-0a5a8b4e\\\",\\\"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 28a4745..42e3d8a 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 db833a5f74d14de2a79e"],"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 db833a5f74d14de2a79e"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap 80766eda8bff1378769f"],"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 80766eda8bff1378769f"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/Chart.html b/docs/Chart.html index c55e8c7..d448e5d 100644 --- a/docs/Chart.html +++ b/docs/Chart.html @@ -72,7 +72,7 @@

Chart

Source:
@@ -227,6 +227,178 @@
Parameters:
+ + + + + + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

(static) clearAxis()

+ + + + + + +
+ Remove x and y axes +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(static) clearCanvas()

+ + + + + + +
+ Remove all content from the SVG +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -264,28 +436,843 @@
Parameters:
- + + + + + +

(static) dim() → {string}

+ + + + + + +
+ Dimension getter function +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ dim +
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + + + + +

(static) displayHeight() → {number}

+ + + + + + +
+ Gets the height of the dispaly area +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ Height of the chart display +
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + + + + + +

(static) drawGrid()

+ + + + + + +
+ Redraw the Chart when the data is recycled +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(static) drawTitle()

+ + + + + + +
+ Appends title and subtitle to the chart +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(static) ds() → {Object}

+ + + + + + +
+ Dataset getter function +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ normalized dataset +
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(static) generateAxisLabels(cs)

+ + + + + + +
+ Generate Axis Lables +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cs + + +Object + + + + configuration of the coordinate system
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(static) generateGoal(cs)

+ + + + + + +
+ Generate Goal +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cs + + +Object + + + + configuration of the coordinate system
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(static) generateLegend(cs)

+ + + + + + +
+ Generate legend if option -legends- defined as true +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + - + - -

(static) clearAxis()

- + + + + + + + + - -
- Remove x and y axes -
- + + + + + + + +
NameTypeDescription
cs + + +Object + + configuration of the coordinate system
@@ -321,7 +1308,7 @@

(static) cl
Source:
@@ -355,7 +1342,7 @@

(static) cl -

(static) clearCanvas()

+

(static) goal() → {number}

@@ -363,7 +1350,7 @@

(static)
- Remove all content from the SVG + Goal getter function
@@ -407,7 +1394,7 @@

(static)
Source:
@@ -430,6 +1417,28 @@

(static) +

Returns:
+ + +
+ Goal +
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + @@ -441,7 +1450,7 @@

(static) -

(static) displayHeight() → {number}

+

(static) gridTicks() → {number}

@@ -449,7 +1458,7 @@

(static) - Gets the height of the dispaly area + Grid Tick getter function @@ -493,7 +1502,7 @@

(static) Source:
@@ -520,7 +1529,7 @@
Returns:
- Height of the chart display + gridTicks
@@ -549,7 +1558,7 @@
Returns:
-

(static) drawTitle()

+

(static) header() → {number}

@@ -557,7 +1566,7 @@

(static) dr
- Appends title and subtitle to the chart + Gets the combined height of the title and subtitle
@@ -601,7 +1610,7 @@

(static) dr
Source:
@@ -624,6 +1633,28 @@

(static) dr +

Returns:
+ + +
+ Total header height +
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + @@ -635,7 +1666,7 @@

(static) dr -

(static) ds() → {Object}

+

(static) height() → {number}

@@ -643,7 +1674,7 @@

(static) ds - Dataset getter function + Height getter function @@ -687,7 +1718,7 @@

(static) dsSource:
@@ -714,7 +1745,7 @@
Returns:
- normalized dataset + Chart Height
@@ -725,7 +1756,7 @@
Returns:
-Object +number
@@ -743,7 +1774,7 @@
Returns:
-

(static) generateLegend(cs)

+

(static) initalizeChart()

@@ -751,7 +1782,7 @@

(static) - Generate legend if option -legends- defined as true + Generate a new Chart of type chartType @@ -762,53 +1793,90 @@

(static) Parameters:

+ + + + +
+ - - - - - - + - + - + - + - - - + - - - - - + + + + + + + + + + + +
Source:
+
+ + + + + + + + + + + + - - + + + + + + + + + + - - + - -
NameTypeDescription
cs - - -Object - - configuration of the coordinate system
+

(static) max() → {number}

+ + + + + + +
+ Get the maxium value for metric +
+ + + + + + + @@ -844,7 +1912,7 @@
Parameters:
Source:
@@ -867,6 +1935,28 @@
Parameters:
+
Returns:
+ + +
+ Max value for metric +
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + @@ -878,7 +1968,7 @@
Parameters:
-

(static) header() → {number}

+

(static) maxTriplet() → {Array}

@@ -886,7 +1976,7 @@

(static) heade
- Gets the combined height of the title and subtitle + Get the maxium value for triplet
@@ -930,7 +2020,7 @@

(static) heade
Source:
@@ -957,7 +2047,7 @@

Returns:
- Total header height + Max values for triplet
@@ -968,7 +2058,7 @@
Returns:
-number +Array
@@ -986,7 +2076,7 @@
Returns:
-

(static) height() → {number}

+

(static) metric() → {array}

@@ -994,7 +2084,7 @@

(static) heigh
- Height getter function + Metric getter function
@@ -1038,7 +2128,7 @@

(static) heigh
Source:
@@ -1065,7 +2155,7 @@

Returns:
- Chart Height + Metrics
@@ -1076,7 +2166,7 @@
Returns:
-number +array
@@ -1094,7 +2184,7 @@
Returns:
-

(static) initalizeChart()

+

(static) metricAsArray() → {Array}

@@ -1102,7 +2192,7 @@

(static) - Generate a new Chart of type chartType + get the values of a metric as an array @@ -1146,7 +2236,7 @@

(static) Source:
@@ -1169,6 +2259,28 @@

(static) Returns:

+ + +
+ metric values +
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + @@ -1180,7 +2292,7 @@

(static) (static) max() → {number}

+

(static) min() → {number}

@@ -1188,7 +2300,7 @@

(static) max - Get the maxium value for metric + Get the minimum value for dataset @@ -1232,7 +2344,7 @@

(static) maxSource:
@@ -1259,7 +2371,7 @@
Returns:
- Max value for metric + Min value for metric
@@ -1288,7 +2400,7 @@
Returns:
-

(static) min() → {number}

+

(static) minTriplet() → {Array}

@@ -1296,7 +2408,7 @@

(static) min - Get the minimum value for dataset + Get the minimum value for triplet @@ -1340,7 +2452,7 @@

(static) minSource:
@@ -1367,7 +2479,7 @@
Returns:
- Min value for metric + Min values for triplet
@@ -1378,7 +2490,7 @@
Returns:
-number +Array
@@ -1448,7 +2560,7 @@

(static) Source:
@@ -1583,7 +2695,7 @@

Parameters:
Source:
@@ -1669,7 +2781,7 @@

(static) Source:
@@ -1777,7 +2889,7 @@

(static)
Source:
@@ -1885,7 +2997,7 @@

(static) width<
Source:
@@ -1951,13 +3063,13 @@

Returns:

- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST)
diff --git a/docs/import_areaChart.js.html b/docs/import_areaChart.js.html index 703a203..bcd29a9 100644 --- a/docs/import_areaChart.js.html +++ b/docs/import_areaChart.js.html @@ -68,6 +68,7 @@

Source: import/areaChart.js

}, y: { axisWidth: 45, + ticks: 10, }, }; /** @@ -127,7 +128,7 @@

Source: import/areaChart.js

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); + 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 - cs.x.axisWidth) * i)) / this.ds.length)); @@ -140,6 +141,7 @@

Source: import/areaChart.js

* @function */ const drawAxis = () => { + this.drawGrid(cs); cs.polyFunction = d3.line() .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) .y(d => cs.y.scale(d.metric)); @@ -177,13 +179,13 @@

Source: import/areaChart.js


- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST)
diff --git a/docs/import_barChart.js.html b/docs/import_barChart.js.html index d66ca66..58881bb 100644 --- a/docs/import_barChart.js.html +++ b/docs/import_barChart.js.html @@ -26,7 +26,9 @@

Source: import/barChart.js

-
/** 
+            
import { globalAgent } from 'http';
+
+/** 
  *  @fileOverview Bar chart component definition
  *
  *  @author       Brian Greig
@@ -58,7 +60,7 @@ 

Source: import/barChart.js

*/ let cs = { palette: { - fill: '#005792', + fill: ['#005792', '#ffcdcd'], stroke: '#d1f4fa', }, bar: { @@ -66,13 +68,15 @@

Source: import/barChart.js

vPadding: 5, }, x: { + label: this.dim, axisHeight: 10, ticks: 5, }, y: { + label: this.metric, domain: [], range: [], - axisWidth: null, + axisWidth: 50, }, }; @@ -90,7 +94,7 @@

Source: import/barChart.js

* @function */ const getHeight = () => ( - this.displayHeight - cs.x.axisHeight - this.header - cs.bar.vPadding) / this.ds.length - 1; + (this.displayHeight - cs.x.axisHeight - this.header - cs.bar.vPadding) / this.ds.length - 1) / this.metric.length ; /** * Returns y axis co-ordinate of the bar @@ -100,7 +104,7 @@

Source: import/barChart.js

* @param {Object} i (svg element) */ const getYCoord = (d, i) => i * ( - this.displayHeight - cs.x.axisHeight - this.header) / this.ds.length + 1 + this.header; + this.displayHeight - cs.x.axisHeight - this.header) / this.ds.length + 1 + this.header + cs.bar.offset * getHeight(); /** * Adds a tooltip on mouse over @@ -128,17 +132,22 @@

Source: import/barChart.js

* @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); + this.metric.forEach( (e, i) => { + cs.bar.offset = i; + rects[i].enter() + .append('rect') + .attr('fill', cs.palette.fill[i]) + .attr('stroke', cs.palette.stroke) + .attr('class', this.selector) + .attr('class', 'r' + i) + .attr('width', getWidth) + .attr('height', getHeight) + .attr('y', getYCoord) + .attr('x', cs.y.axisWidth + cs.bar.hPadding) + .on('mouseover', mouseOver) + .on('mouseout', mouseOut); + }); + if (this.goal) this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding); return rects; }; /** @@ -148,11 +157,15 @@

Source: import/barChart.js

* @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); + this.metric.forEach( (e, i) => { + cs.bar.offset = i; + rects[i].transition() + .attr('width', getWidth) + .attr('height', getHeight) + .attr('y', getYCoord) + .attr('x', cs.y.axisWidth + cs.bar.hPadding); + }); + if (this.goal) this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding); return rects; }; /** @@ -162,7 +175,9 @@

Source: import/barChart.js

* @param {Object} rect (svg element) */ const exit = (rects) => { - rects.exit().remove(); + this.metric.forEach( (e, i) => { + rects[i].exit().remove(); + }); return rects; }; /** @@ -185,6 +200,7 @@

Source: import/barChart.js

* @function */ const drawAxis = () => { + this.drawGrid(cs); 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; @@ -203,13 +219,22 @@

Source: import/barChart.js

* @param {number} currentValue */ const getMaxDimLength = (accumulator, currentValue) => { + if(!currentValue.dim) return accumulator; return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator; } - const rects = svgContainer.selectAll('rect').data(this.ds); + const rects = [] + this.metric.forEach( (e, i) => { + rects.push(svgContainer.selectAll('rect.r' + i).data(this.ds.map(d => { + return { + metric: d.metric[i], + dim: d.dim + } + }))) + }) cs = this.setOverrides(cs, this.chartData.overrides); - if (this.ds[0].dim) + if (this.ds[0] && this.ds[0].dim) cs.y.axisWidth = cs.y.axisWidth || (this.ds.reduce(getMaxDimLength, 0)) * 10; buildScales(cs); @@ -232,13 +257,13 @@

Source: import/barChart.js


- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST)
diff --git a/docs/import_boxPlot.js.html b/docs/import_boxPlot.js.html new file mode 100644 index 0000000..ca76188 --- /dev/null +++ b/docs/import_boxPlot.js.html @@ -0,0 +1,228 @@ + + + + + JSDoc: Source: import/boxPlot.js + + + + + + + + + + +
+ +

Source: import/boxPlot.js

+ + + + + + +
+
+
import { globalAgent } from 'http';
+
+/** 
+ *  @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'),
+  require('d3-array'));
+/**
+ * Builds a Box Plot.
+ * @module boxPlot
+ */
+
+const boxPlot = 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', '#ffcdcd'],
+      stroke: '#d1f4fa',
+    },
+    x: {
+      axisHeight: 10,
+      ticks: 5,
+    },
+    y: {
+      axisWidth: 10,
+      ticks: 5,
+    },
+  };
+
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} boxes (svg element)
+   */
+  const enter = (boxes, lines) => {
+    boxes.enter()
+      .append('rect')
+      .attr('fill', 'none')
+      .attr('stroke', 'black')
+      .attr('stroke-width', 3)
+      .attr('class', this.selector)
+      .attr('width', 50)
+      .attr('height', d => cs.y.scale(d.thirdQrt) - cs.y.scale(d.firstQrt))
+      .attr('x', 50)
+      .attr('y', d => cs.y.scale(d.firstQrt))
+    
+    const l = lines.enter()
+      
+      l.append('line')
+      .attr('fill', 'none')
+      .attr('stroke', 'black')
+      .attr('stroke-width', 3)
+      .attr('x1', 75)
+      .attr('y1', d => cs.y.scale(d.min))
+      .attr('x2', 75)
+      .attr('y2', d => cs.y.scale(d.firstQrt))
+    
+      l.append('line')
+      .attr('fill', 'none')
+      .attr('stroke', 'black')
+      .attr('stroke-width', 3)
+      .attr('x1', 75)
+      .attr('y1', d => cs.y.scale(d.thirdQrt))
+      .attr('x2', 75)
+      .attr('y2', d => cs.y.scale(d.max))
+    
+      l.append('line')
+      .attr('fill', 'none')
+      .attr('stroke', 'black')
+      .attr('stroke-width', 3)
+      .attr('x1', 50)
+      .attr('y1', d => cs.y.scale(d.median))
+      .attr('x2', 100)
+      .attr('y2', d => cs.y.scale(d.median))
+      
+      l.append('line')
+      .attr('fill', 'none')
+      .attr('stroke', 'black')
+      .attr('stroke-width', 3)
+      .attr('x1', 50)
+      .attr('y1', d => cs.y.scale(d.min))
+      .attr('x2', 100)
+      .attr('y2', d => cs.y.scale(d.min))
+
+      l.append('line')
+      .attr('fill', 'none')
+      .attr('stroke', 'black')
+      .attr('stroke-width', 3)
+      .attr('x1', 50)
+      .attr('y1', d => cs.y.scale(d.max))
+      .attr('x2', 100)
+      .attr('y2', d => cs.y.scale(d.max))
+                
+    return boxes;
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} boxes (svg element)
+   */
+  const transition = (boxes) => {
+    boxes.transition()
+    return boxes;
+  };
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} boxes (svg element)
+   */
+  const exit = (rects) => {
+    boxes.exit().remove();
+    return rects;
+  };
+  /**
+   * Builds the scales for the x and y axes
+   * @member buildScales
+   * @function
+   */
+  const buildScales = () => {
+    cs.y.scale = d3.scaleLinear()
+      .domain([this.min * 0.95, this.max * 1.05])
+      .range([this.header, this.displayHeight]);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  const drawAxis = () => {
+
+  };
+
+  const ds = this.metricAsArray('total').sort();
+  const a = [{
+    min: this.min,
+    median: d3.quantile(ds, 0.5),
+    max: this.max,
+    firstQrt: d3.quantile(ds, 0.25),
+    thirdQrt: d3.quantile(ds, 0.75)
+  }]
+
+  const boxes = svgContainer.selectAll('rect').data(a);
+  const lines = svgContainer.selectAll('line').data(a);
+
+  cs = this.setOverrides(cs, this.chartData.overrides);
+  buildScales(cs);
+  drawAxis(cs);
+  enter(boxes, lines);
+  transition(boxes, lines);
+  exit(boxes, lines);
+
+  return cs;
+};
+
+export default boxPlot;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST) +
+ + + + + diff --git a/docs/import_bubbleChart.js.html b/docs/import_bubbleChart.js.html new file mode 100644 index 0000000..c5a02c1 --- /dev/null +++ b/docs/import_bubbleChart.js.html @@ -0,0 +1,195 @@ + + + + + JSDoc: Source: import/bubbleChart.js + + + + + + + + + + +
+ +

Source: import/bubbleChart.js

+ + + + + + +
+
+
/** 
+ *  @fileOverview Bubble 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-shape'));
+/**
+ * Builds a Bubble Chart.
+ * @module bubbleChart
+ */
+
+const bubbleChart = 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: {
+      fill: '#005792',
+      stroke: '#d1f4fa',
+    },
+    x: {
+      domain: [],
+      range: [],
+      axisHeight: 20,
+    },
+    y: {
+      axisWidth: 30,
+      ticks: 5,
+    },
+    r: {
+      max: 20,
+    }
+  };
+
+  /**
+   * Runs when a new element is added to the dataset
+   * @member enter
+   * @function
+   * @param {Object} points (svg element) 
+   */
+  const enter = (points) => {
+    points.enter()
+      .append('circle')
+      .attr('class', this.selector)
+      .attr('fill', cs.palette.fill)
+      .attr('stroke', cs.palette.stroke)
+      .on('mouseover', (d) => {
+        this.addTooltip(d, window.event);
+      })
+      .on('mouseout', (d) => {
+        this.removeTooltip(d);
+      })
+      .attr('r', d =>  cs.r.scale(d.metric[2]))
+      .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) 
+      .attr('cy', d => cs.y.scale(d.metric[1]));
+    return points;
+  };
+  /**
+   * Runs when a value of an element in dataset is changed
+   * @member transition
+   * @function
+   * @param {Object} points (svg element) 
+   */
+  const transition = (points) => {
+    points.transition()
+      .attr('r', d => cs.r.scale(d.metric[2]))
+      .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5)
+      .attr('cy', d => cs.y.scale(d.metric[1]));
+    return points;
+  };
+
+  /**
+   * Runs when an element is removed from the dataset
+   * @member exit
+   * @function
+   * @param {Object} points (svg element)
+   */
+  const exit = (points) => {
+    points.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.minTriplet.v2 - cs.r.max, this.maxTriplet.v2 + cs.r.max])
+      .range([this.displayHeight - cs.x.axisHeight, this.header]);
+    cs.x.scale = d3.scaleLinear()
+      .domain([this.minTriplet.v1 - cs.r.max, this.maxTriplet.v1 + cs.r.max])
+      .range([0, this.width]);
+    cs.r.scale = d3.scaleLinear()
+      .domain([this.minTriplet.v3, this.maxTriplet.v3])
+      .range([0, cs.r.max]);
+  };
+  /**
+   * Draws the x and y axes on the svg
+   * @member drawAxis
+   * @function
+   */
+  const drawAxis = cs => {
+    this.drawGrid(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);
+  };
+  
+  const points = svgContainer.selectAll('circle').data(this.ds);
+
+  cs = this.setOverrides(cs, this.chartData.overrides);
+
+  buildScales(cs);
+  drawAxis(cs);
+  enter(points);
+  transition(points);
+  exit(points);
+  
+  return cs;
+};
+
+export default bubbleChart;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST) +
+ + + + + diff --git a/docs/import_lineGraph.js.html b/docs/import_lineGraph.js.html index 4962726..280cd07 100644 --- a/docs/import_lineGraph.js.html +++ b/docs/import_lineGraph.js.html @@ -56,17 +56,19 @@

Source: import/lineGraph.js

*/ let cs = { palette: { - lineFill: '#ffcdcd', + lineFill: ['#ffcdcd', '#005792'], pointFill: '#005792', pointStroke: '#d1f4fa', }, x: { + label: this.dim, domain: [], range: [], axisHeight: 20, }, y: { - axisWidth: 30, + label: this.metric, + axisWidth: 40, ticks: 5, }, }; @@ -78,26 +80,31 @@

Source: import/lineGraph.js

* @param {Object} points (svg element) */ const enter = (points, path) => { - if (mode === 'init') - path.enter() - .append('path') - .attr('d', cs.lineFunction(this.ds)) + this.metric.forEach( (e, i) => { + path[i].enter().append('path') + .attr('d', cs.lineFunction[i](this.ds)) .attr('fill', 'none') - .attr('stroke', cs.palette.lineFill) - .attr('stroke-width', 3); - - points.enter() - .append('circle') - .attr('class', this.selector) - .attr('r', 2) - .on('mouseover', (d) => { - this.addTooltip(d, window.event); - }) - .on('mouseout', (d) => { - this.removeTooltip(d); - }) - .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .attr('cy', d => cs.y.scale(d.metric)); + .attr('id', 'p' + i) + .attr('stroke', cs.palette.lineFill[i]) + .attr('stroke-width', 3) + }) + this.metric.forEach( (e, i) => { + cs.offset = i; + points[i].enter() + .append('circle') + .attr('class', this.selector) + .attr('class', "r" + i) + .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)); + }); + if (this.goal) this.generateGoal(cs, true, 0); return points; }; /** @@ -107,14 +114,20 @@

Source: import/lineGraph.js

* @param {Object} points (svg element) */ const transition = (points, path) => { - path.transition() - .attr('d', cs.lineFunction(this.ds)); - - points.transition() - .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .attr('cy', d => cs.y.scale(d.metric)) - .attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .attr('cy', d => cs.y.scale(d.metric)); + this.metric.forEach( (e, i) => { + path[i].transition() + .attr('d', cs.lineFunction[i](this.ds)); + }) + + this.metric.forEach( (e, i) => { + cs.offset = i; + points[i].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)); + }); + if (this.goal) this.generateGoal(cs, true, 0); return points; }; @@ -125,8 +138,12 @@

Source: import/lineGraph.js

* @param {Object} points (svg element) */ const exit = (points, path) => { - points.exit().remove(); - path.exit().remove(); + this.metric.forEach( (e, i) => { + points[i].exit().remove(); + }); + this.metric.forEach( (e, i) => { + path[i].exit().remove(); + }); return points; }; @@ -135,11 +152,10 @@

Source: import/lineGraph.js

* @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); @@ -149,20 +165,43 @@

Source: import/lineGraph.js

* @member drawAxis * @function */ - const drawAxis = () => { + const drawAxis = cs => { + this.drawGrid(cs); cs.x.axis = d3.axisBottom().scale(cs.x.scale); cs.x.xOffset = cs.y.axisWidth + 5; cs.x.yOffset = this.displayHeight - cs.x.axisHeight; + cs.y.axis = d3.axisLeft().ticks(cs.y.ticks, 's').scale(cs.y.scale); cs.y.xOffset = cs.y.axisWidth; cs.y.yOffset = 0; + svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`) + .call(cs.x.axis); + svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`) + .call(cs.y.axis); }; - cs.lineFunction = d3.line() - .x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) - .y(d => cs.y.scale(d.metric)); - - const points = svgContainer.selectAll('circle').data(this.ds); - const path = svgContainer.selectAll('path').data(this.ds); + 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 = []; + this.metric.forEach( (e, i) => { + points.push(svgContainer.selectAll('circle.r' + i).data(this.ds.map(d => { + return { + metric: d.metric[i], + dim: d.dim + } + }))) + }) + + const path = [] + this.metric.forEach( (e, i) => { + path.push(svgContainer.selectAll('path#p' + i).data(this.ds)) + }) cs = this.setOverrides(cs, this.chartData.overrides); @@ -172,11 +211,6 @@

Source: import/lineGraph.js

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; }; @@ -191,13 +225,13 @@

Source: import/lineGraph.js


- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST)
diff --git a/docs/import_pieChart.js.html b/docs/import_pieChart.js.html index 2805948..313a6ae 100644 --- a/docs/import_pieChart.js.html +++ b/docs/import_pieChart.js.html @@ -166,13 +166,13 @@

Source: import/pieChart.js


- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST)
diff --git a/docs/import_scatterPlot.js.html b/docs/import_scatterPlot.js.html index 6b6bf5c..3cad61f 100644 --- a/docs/import_scatterPlot.js.html +++ b/docs/import_scatterPlot.js.html @@ -56,90 +56,107 @@

Source: import/scatterPlot.js

* @member cs */ let cs = { + palette: { + pointFill: '#005792', + pointStroke: '#d1f4fa', + }, x: { domain: [], range: [], axisHeight: 20, + label: this.metric[0], }, y: { axisWidth: 30, ticks: 5, + label: this.metric[1], }, + r: { + width: 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) + * @param {Object} points (svg element) */ - const enter = (p) => { - p.enter() + const enter = (points) => { + points.enter() .append('circle') .attr('class', this.selector) - .attr('r', 2) + .attr('fill', cs.palette.fill) + .attr('stroke', cs.palette.stroke) + .attr('r', cs.r.width) .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)); + .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) + .attr('cy', d => cs.y.scale(d.metric[1])); return points; }; /** * Runs when a value of an element in dataset is changed * @member transition * @function - * @param {Object} p (svg element) + * @param {Object} points (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)); + const transition = (points) => { + points.transition() + .attr('r', cs.r.width) + .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) + .attr('cy', d => cs.y.scale(d.metric[1])); return points; }; + /** * Runs when an element is removed from the dataset * @member exit * @function - * @param {Object} rect (svg element) + * @param {Object} points (svg element) */ - const exit = () => { + const exit = (points) => { points.exit().remove(); return points; }; + /** * Builds the scales for the x and y axes * @member buildScales * @function */ - const buildScales = () => { + const buildScales = cs => { cs.y.scale = d3.scaleLinear() - .domain([this.min, this.max]) + .domain([this.minTriplet.v2 - this.maxTriplet.v2 * .05, this.maxTriplet.v2 + this.maxTriplet.v2 * .05]) .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); + cs.x.scale = d3.scaleLinear() + .domain([this.minTriplet.v1 - this.maxTriplet.v2 * .05, this.maxTriplet.v1 + this.maxTriplet.v1 * .05]) + .range([0, this.width]); }; /** * Draws the x and y axes on the svg * @member drawAxis * @function */ - const drawAxis = () => { + const drawAxis = cs => { + this.drawGrid(cs); 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.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); + 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); }; + + const points = svgContainer.selectAll('circle').data(this.ds); cs = this.setOverrides(cs, this.chartData.overrides); buildScales(cs); @@ -162,13 +179,13 @@

Source: import/scatterPlot.js


- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST)
diff --git a/docs/import_vBarChart.js.html b/docs/import_vBarChart.js.html index f0e7a62..96d9696 100644 --- a/docs/import_vBarChart.js.html +++ b/docs/import_vBarChart.js.html @@ -57,7 +57,7 @@

Source: import/vBarChart.js

*/ let cs = { palette: { - fill: '#005792', + fill: ['#005792', '#ffcdcd'], stroke: '#d1f4fa', }, bar: { @@ -80,7 +80,7 @@

Source: import/vBarChart.js

* @function */ - const getWidth = () => ((this.width - cs.y.axisWidth) / this.chartData.data.length - 1); + const getWidth = () => ((this.width - cs.y.axisWidth) / this.chartData.data.length - 1) / this.metric.length ; /** * Returns height of the bar @@ -98,7 +98,7 @@

Source: import/vBarChart.js

* @param {Object} i (svg element) */ const getXCoord = (d, i) => ( - i * (this.width - cs.y.axisWidth) / this.chartData.data.length) + cs.y.axisWidth; + i * (this.width - cs.y.axisWidth) / this.chartData.data.length) + cs.y.axisWidth + cs.bar.offset * getWidth(); /** * Returns y axis co-ordinate of the bar * @member getYCoord @@ -134,17 +134,21 @@

Source: import/vBarChart.js

* @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); + this.metric.forEach( (e, i) => { + cs.bar.offset = i; + rects[i].enter() + .append('rect') + .attr('fill', cs.palette.fill[i]) + .attr('stroke', cs.palette.stroke) + .attr('class', this.selector) + .attr('class', 'r' + i) + .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 @@ -153,11 +157,14 @@

Source: import/vBarChart.js

* @param {Object} rects (svg element) */ const transition = (rects) => { - rects.transition() - .attr('width', getWidth) - .attr('height', getHeight) - .attr('x', getXCoord) - .attr('y', getYCoord); + this.metric.forEach( (e, i) => { + cs.bar.offset = i; + rects[i].transition() + .attr('width', getWidth) + .attr('height', getHeight) + .attr('x', getXCoord) + .attr('y', getYCoord); + }); }; /** * Runs when an element is removed from the dataset @@ -166,7 +173,9 @@

Source: import/vBarChart.js

* @param {Object} rects (svg element) */ const exit = (rects) => { - rects.exit().remove(); + this.metric.forEach( (e, i) => { + rects[i].exit().remove(); + }); }; /** * Builds the scales for the x and y axes @@ -188,6 +197,7 @@

Source: import/vBarChart.js

* @function */ const drawAxis = () => { + this.drawGrid(cs); 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; @@ -203,7 +213,15 @@

Source: import/vBarChart.js

.call(cs.x.axis); }; - const rects = svgContainer.selectAll('rect').data(this.ds); + const rects = [] + this.metric.forEach( (e, i) => { + rects.push(svgContainer.selectAll('rect.r' + i).data(this.ds.map(d => { + return { + metric: d.metric[i], + dim: d.dim + } + }))) + }) cs = this.setOverrides(cs, this.chartData.overrides); buildScales(cs); @@ -226,13 +244,13 @@

Source: import/vBarChart.js


- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST)
diff --git a/docs/index.html b/docs/index.html index 50421c5..013180b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,10 +43,33 @@

-

V CHART PLUGIN

logo

-
-

A plugin for adding charts to Vue

-
+

+
+ +
+ A plugin for adding charts to Vue +
+

+ +

+ + version + + + version +

+

+

Table of Contents

+ + +

Screenshot

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.

V Chart Plugin is built using Vue.js' component architecture. This will allow the chart to be a first class citizen of your Vue.js application. Combining multiple charts allows you to create complex dashboards and enable deeper insights into your data. All aspects of the charts can be configured to allow for full customization of your graphs along with the ability to style the SVG elements using the classes and IDs generated for each individual canvas element.

By adding additional charts into the import folder and importing them into the v-chart-plugin.js you can include any custom charts to use with Vue.js. Using the JavaScript API you can hook into the specific methods in the API and create a reusable component that can persist across your application.

@@ -80,18 +103,43 @@

Usage

These instructions are assuming you are using Vue CLI to create title: "Important Data", width: 400, height: 200, - metric: 'count', + metric: 'count', // for two or more metrics pass as an array ['count', 'pyCount'] + data: [ + {'count': 120, + 'fruit': 'apples'}, + {'count': 250, + 'fruit': 'oranges'} + ] + } + } + } +}

Bubble Charts require three metrics (v1, v2, and v3). These should be passed as metrics

+
export default {
+  name: 'example',
+  data () {
+    return {
+      chartData: {
+        chartType: "bubbleChart",
+        selector: "chart",
+        title: "Important Data",
+        width: 400,
+        height: 200,
+        metric: ['count', 'pyCount', 'revenue']
         data: [
           {'count': 120,
+           'pyCount': 115,
+           'revenue': 170,
            'fruit': 'apples'}, 
           {'count': 250,
+           'pyCount': 255,
+           'revenue': 325,
            'fruit': 'oranges'}
         ]
       }
     }
   }
 }

Overrides

If you need to override any of the default values of the charts (pallette colors, ticks, margins, etc) you can pass an overrides object to you chartData.

-
      vBarChartData: {
+
      vBarChartData: {
         chartType: "vBarChart",
         ...   
         overrides: {
@@ -102,13 +150,46 @@ 

Usage

These instructions are assuming you are using Vue CLI to create ticks: 20, }, } - },

Chart types currently supported:

    + },

Legends

Legends are turned off by default. You can add a legend to a chart by including a legends objects in your chartData as such:

+
chartData: {
+  chartType: "vBarChart",
+  ...
+  legends: {
+    enabled: true,
+    height: 25,
+    width: 50,
+  }
+}

Gridlines

Gridlines are turned off by default. You can include and configure your gridlines via the configuration object:

+
chartData: {
+  chartType: "barChart",
+  ...
+  grid: {
+    enabled: true,
+    gridTicks: 25,
+  }
+}

Goals

Goals are used to place a line on your graph showing where your target is for the period:

+
chartData: {
+  chartType: "lineGraph",
+  ...
+  goal: 500,
+}

Labels

Labels are assigned to the x and y axis:

+
chartData: {
+  chartType: "lineGraph",
+  ...
+  label: true,
+}

Chart types currently supported:

  • barChart: a chart in which the numerical values of variables are represented by the width of rectangles of equal height.
  • vBarChart: a chart in which the numerical values of variables are represented by the height of rectangles of equal width.
  • lineGraph: a graph which displays information as a series of data points called 'markers' connected by straight line segments.
  • scatterPlot: a graph in which the values of two variables are plotted along two axes, the pattern of the resulting points revealing any correlation present.
  • pieChart: a chart in which a circle is divided into slices to illustrate proportion
  • areaChart: a chart which displays graphically quantitative data
  • +
  • bubleChart: a bubble chart is a variation of a scatter chart in which the data points are replaced with bubbles, and an additional dimension of the data is represented in the size of the bubbles.
  • +
+

Charts that support two or more metrics

    +
  • barChart
  • +
  • vBarChart
  • +
  • lineGraph

Lastly you will need to add the component and bind your data

<v-chart v-bind:chartData="chartData"></v-chart>

If you wish to style the components of the chart you can via the selectors:

@@ -116,9 +197,8 @@

Usage

These instructions are assuming you are using Vue CLI to create .chart-barChart { fill:blue; } -</style>

screenshot

-

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.

-
import barChart     from './import/barChart' 
+</style>

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.

+
import barChart     from './import/barChart' 
 import vBarChart    from './import/vBarChart'
 import lineGraph    from './import/lineGraph'
 import scatterPlot  from './import/scatterPlot'
@@ -314,7 +394,223 @@ 

import/barChart.js

Source:
+ + + + + + + +

+ + + + + + + + + +

Requires

+ +
    +
  • module:NPM:d3:Vue
  • + +
  • module:src/v-chart-plugin.js
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

import/boxPlot.js

+ + +
+ +
+
+ + +
Bar chart component definition
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • Brian Greig
  • +
+
+ + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + +

Requires

+ +
    +
  • module:NPM:d3:Vue
  • + +
  • module:src/v-chart-plugin.js
  • +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

import/bubbleChart.js

+ + +
+ +
+
+ + +
Bubble Chart component definition
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • Brian Greig
  • +
+
+ + + + + + + + + +
Source:
+
@@ -905,13 +1201,13 @@

Requires


- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST)
diff --git a/docs/module-areaChart.html b/docs/module-areaChart.html index ccc7b04..da88cea 100644 --- a/docs/module-areaChart.html +++ b/docs/module-areaChart.html @@ -322,7 +322,7 @@

(inner) b
Source:
@@ -408,7 +408,7 @@

(inner) draw
Source:
@@ -543,7 +543,7 @@

Parameters:
Source:
@@ -678,7 +678,7 @@
Parameters:
Source:
@@ -813,7 +813,7 @@
Parameters:
Source:
@@ -948,7 +948,7 @@
Parameters:
Source:
@@ -992,13 +992,13 @@
Parameters:

- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST)
diff --git a/docs/module-barChart.html b/docs/module-barChart.html index d64dffb..8c11a04 100644 --- a/docs/module-barChart.html +++ b/docs/module-barChart.html @@ -87,7 +87,7 @@

Module: barChart

Source:
@@ -180,7 +180,7 @@

(inner) csSource:
@@ -242,7 +242,7 @@

(inner)
Source:
@@ -322,7 +322,7 @@

(inner) b
Source:
@@ -408,7 +408,7 @@

(inner) draw
Source:
@@ -543,7 +543,7 @@

Parameters:
Source:
@@ -678,7 +678,7 @@
Parameters:
Source:
@@ -764,7 +764,7 @@

(inner) get
Source:
@@ -922,7 +922,7 @@

Parameters:
Source:
@@ -1057,7 +1057,7 @@
Parameters:
Source:
@@ -1215,7 +1215,7 @@
Parameters:
Source:
@@ -1350,7 +1350,7 @@
Parameters:
Source:
@@ -1485,7 +1485,7 @@
Parameters:
Source:
@@ -1620,7 +1620,7 @@
Parameters:
Source:
@@ -1664,13 +1664,13 @@
Parameters:

- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST)
diff --git a/docs/module-boxPlot.html b/docs/module-boxPlot.html new file mode 100644 index 0000000..db4e5ef --- /dev/null +++ b/docs/module-boxPlot.html @@ -0,0 +1,872 @@ + + + + + JSDoc: Module: boxPlot + + + + + + + + + + +
+ +

Module: boxPlot

+ + + + + + +
+ +
+ + + + + +
+ +
+
+ + +
Builds a Box Plot.
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(inner) cs

+ + + + +
+ The configuration of the coordinate system +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(inner) svgContainer

+ + + + +
+ The SVG that stores the chart +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(inner) buildScales()

+ + + + + + +
+ Builds the scales for the x and y axes +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(inner) drawAxis()

+ + + + + + +
+ Draws the x and y axes on the svg +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(inner) enter(boxes)

+ + + + + + +
+ Runs when a new element is added to the dataset +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
boxes + + +Object + + + + (svg element)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(inner) exit(boxes)

+ + + + + + +
+ Runs when an element is removed from the dataset +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
boxes + + +Object + + + + (svg element)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(inner) transition(boxes)

+ + + + + + +
+ Runs when a value of an element in dataset is changed +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
boxes + + +Object + + + + (svg element)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST) +
+ + + + + \ No newline at end of file diff --git a/docs/module-bubbleChart.html b/docs/module-bubbleChart.html new file mode 100644 index 0000000..9f19537 --- /dev/null +++ b/docs/module-bubbleChart.html @@ -0,0 +1,872 @@ + + + + + JSDoc: Module: bubbleChart + + + + + + + + + + +
+ +

Module: bubbleChart

+ + + + + + +
+ +
+ + + + + +
+ +
+
+ + +
Builds a Bubble Chart.
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(inner) cs

+ + + + +
+ The configuration of the coordinate system +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(inner) svgContainer

+ + + + +
+ The SVG that stores the chart +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(inner) buildScales()

+ + + + + + +
+ Builds the scales for the x and y axes +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(inner) drawAxis()

+ + + + + + +
+ Draws the x and y axes on the svg +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(inner) enter(points)

+ + + + + + +
+ Runs when a new element is added to the dataset +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
points + + +Object + + + + (svg element)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(inner) exit(points)

+ + + + + + +
+ Runs when an element is removed from the dataset +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
points + + +Object + + + + (svg element)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +

(inner) transition(points)

+ + + + + + +
+ Runs when a value of an element in dataset is changed +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
points + + +Object + + + + (svg element)
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST) +
+ + + + + \ No newline at end of file diff --git a/docs/module-lineGraph.html b/docs/module-lineGraph.html index 4ad0b35..cf5d45c 100644 --- a/docs/module-lineGraph.html +++ b/docs/module-lineGraph.html @@ -322,7 +322,7 @@

(inner) b
Source:
@@ -408,7 +408,7 @@

(inner) draw
Source:
@@ -543,7 +543,7 @@

Parameters:
Source:
@@ -678,7 +678,7 @@
Parameters:
Source:
@@ -813,7 +813,7 @@
Parameters:
Source:
@@ -857,13 +857,13 @@
Parameters:

- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST)
diff --git a/docs/module-pieChart.html b/docs/module-pieChart.html index ede5577..f150319 100644 --- a/docs/module-pieChart.html +++ b/docs/module-pieChart.html @@ -1041,13 +1041,13 @@
Parameters:

- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST)
diff --git a/docs/module-scatterPlot.html b/docs/module-scatterPlot.html index f609930..cdbc372 100644 --- a/docs/module-scatterPlot.html +++ b/docs/module-scatterPlot.html @@ -322,7 +322,7 @@

(inner) b
Source:
@@ -408,7 +408,7 @@

(inner) draw
Source:
@@ -442,7 +442,7 @@

(inner) draw -

(inner) enter(p)

+

(inner) enter(points)

@@ -486,7 +486,7 @@
Parameters:
- p + points @@ -543,7 +543,7 @@
Parameters:
Source:
@@ -577,7 +577,7 @@
Parameters:
-

(inner) exit(rect)

+

(inner) exit(points)

@@ -621,7 +621,7 @@
Parameters:
- rect + points @@ -678,7 +678,7 @@
Parameters:
Source:
@@ -712,7 +712,7 @@
Parameters:
-

(inner) transition(p)

+

(inner) transition(points)

@@ -756,7 +756,7 @@
Parameters:
- p + points @@ -813,7 +813,7 @@
Parameters:
Source:
@@ -857,13 +857,13 @@
Parameters:

- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST)
diff --git a/docs/module-vBarChart.html b/docs/module-vBarChart.html index ae0a39b..88e61aa 100644 --- a/docs/module-vBarChart.html +++ b/docs/module-vBarChart.html @@ -322,7 +322,7 @@

(inner) b
Source:
@@ -408,7 +408,7 @@

(inner) draw
Source:
@@ -678,7 +678,7 @@

Parameters:
Source:
@@ -1597,7 +1597,7 @@
Parameters:
Source:
@@ -1641,13 +1641,13 @@
Parameters:

- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:57 GMT-0500 (EST)
diff --git a/docs/v-chart-plugin.js.html b/docs/v-chart-plugin.js.html index c406e60..61e0db8 100644 --- a/docs/v-chart-plugin.js.html +++ b/docs/v-chart-plugin.js.html @@ -41,6 +41,7 @@

Source: v-chart-plugin.js

import scatterPlot from './import/scatterPlot'; import pieChart from './import/pieChart'; import areaChart from './import/areaChart'; +import bubbleChart from './import/bubbleChart'; const d3 = Object.assign({}, require('d3-selection')); @@ -67,6 +68,7 @@

Source: v-chart-plugin.js

initalizeChart() { const cs = this[this.chartData.chartType]('init'); this.drawTitle(); + this.generateAxisLabels(cs); this.generateLegend(cs); }, /** @@ -77,6 +79,32 @@

Source: v-chart-plugin.js

this.clearAxis(); this[this.chartData.chartType]('refresh'); }, + /** + * Redraw the Chart when the data is recycled + * @memberOf Chart + */ + drawGrid(cs) { + if (this.chartData.grid && this.chartData.grid.enabled === true) { + const grid = { + x: [], + y: [] + } + for (let i = this.header; i < (this.height - this.header) * .80; i += this.gridTicks) { + grid.y.push(i); + } + d3.select(`#${this.chartData.selector}`) + .selectAll('line.gridLine') + .data(grid.y).enter() + .append('line') + .attr('class', 'gridLine') + .attr('x1', cs.y.axisWidth) + .attr('x2', this.width) + .attr('y1', d => d) + .attr('y2', d => d) + .style('stroke', '#D3D3D3') + .style('stroke-width', 1) + } + }, /** * Remove x and y axes * @memberOf Chart @@ -98,6 +126,7 @@

Source: v-chart-plugin.js

drawTitle() { d3.select(`#${this.chartData.selector}`) .append('text') + .attr('font-size', '20') .attr('x', this.width / 2) .attr('y', this.titleHeight - this.titleHeight * 0.1) .style('text-anchor', 'middle') @@ -105,6 +134,7 @@

Source: v-chart-plugin.js

d3.select(`#${this.chartData.selector}`) .append('text') + .attr('font-size', '12') .attr('x', this.width / 2) .attr('y', this.titleHeight - this.titleHeight * 0.1 + this.subtitleHeight) .style('text-anchor', 'middle') @@ -119,8 +149,8 @@

Source: v-chart-plugin.js

addTooltip(d, e) { d3.select(`#${this.chartData.selector}`) .append('rect') - .attr('x', e.layerX - 5 - 50) - .attr('y', e.layerY - 13 - 25) + .attr('x', e.offsetX - 5 - 50) + .attr('y', e.offsetY - 13 - 25) .attr('height', '16px') .attr('width', '80px') .attr('class', 'tt') @@ -128,8 +158,8 @@

Source: v-chart-plugin.js

d3.select(`#${this.chartData.selector}`) .append('text') - .attr('x', e.layerX - 50) - .attr('y', e.layerY - 25) + .attr('x', e.offsetX - 50) + .attr('y', e.offsetY - 25) .attr('class', 'tt') .attr('font-size', '10px') .text(`${d.dim}:${d.metric}`); @@ -163,27 +193,94 @@

Source: v-chart-plugin.js

*/ 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('font-size', '10') .attr('x', this.width - 60) - .attr('y', this.height * 0.95) + .attr('y', this.height * 0.95 - (i * 15)) .style('text-anchor', 'middle') - .text(this.chartData.metric); + .text(this.metric[i]); d3.select(`#${this.chartData.selector}`) .append("g") .attr("class", "legends") .append("rect") .attr('x', this.width - 30) - .attr('y', this.height * 0.95 - 10) + .attr('y', this.height * 0.95 - (i * 15) - 10) .attr("width", 30) .attr("height", 10) .style("fill", function () { - const fill = cs.palette.lineFill || cs.palette.fill; + const fill = cs.palette.lineFill[i] || cs.palette.fill[i]; return fill; }); + }) } }, + /** + * Generate Goal + * @memberOf Chart + * @param {Object} cs configuration of the coordinate system + */ + + generateGoal(cs, shiftAxis, padding) { + d3.select(`#${this.chartData.selector}`).selectAll('line#goal').remove(); + const x1 = shiftAxis ? cs.y.axisWidth: cs.x.scale(this.goal) + padding; + const x2 = shiftAxis ? this.width : cs.x.scale(this.goal) + padding; + const y1 = shiftAxis ? cs.y.scale(this.goal) + padding : this.header; + const y2 = shiftAxis ? cs.y.scale(this.goal) + padding : this.displayHeight - cs.x.axisHeight; + + d3.select(`#${this.chartData.selector}`).append('line') + .attr('x1', x1) + .attr('x2', x2) + .attr('y1', y1) + .attr('y2', y2) + .attr('id', 'goal') + .style('stroke', '#708090') + .style('stroke-width', 1) + }, + /** + * Generate Axis Lables + * @memberOf Chart + * @param {Object} cs configuration of the coordinate system + */ + generateAxisLabels(cs) { + let footer = (this.chartData.legends) ? .85 : .95; + if (!this.chartData.label) return; + d3.select(`#${this.chartData.selector}`).selectAll('text.axisLabel').remove(); + + if (cs.x && cs.x.label) + d3.select(`#${this.chartData.selector}`).append('text') + .attr('font-size', '10') + .attr('x', this.width / 2) + .attr('y', this.height * footer) + .attr('id', 'xAxisLabel') + .attr('class', 'axisLabel') + .style('text-anchor', 'middle') + .text(cs.x.label) + + if (cs.y && cs.y.label) + d3.select(`#${this.chartData.selector}`).append('text') + .attr('font-size', '10') + .attr('x', 10) + .attr('y', this.height / 2) + .attr('id', 'xAxisLabel') + .attr('class', 'axisLabel') + .style('text-anchor', 'middle') + .text(cs.y.label) + .attr('transform', `rotate(-90,10, ${this.height / 2})`) + }, + /** + * get the values of a metric as an array + * @memberOf Chart + * @returns {Array} metric values + */ + metricAsArray(metric) { + metric = this.chartData.data.map(d => d[metric]); + return metric; + }, ...((typeof barChart !== 'undefined') && { barChart }), ...((typeof vBarChart !== 'undefined') && { vBarChart }), @@ -191,6 +288,7 @@

Source: v-chart-plugin.js

...((typeof pieChart !== 'undefined') && { pieChart }), ...((typeof areaChart !== 'undefined') && { areaChart }), ...((typeof lineGraph !== 'undefined') && { lineGraph }), + ...((typeof bubbleChart !== 'undefined') && { bubbleChart }), }, computed: { /** @@ -199,20 +297,55 @@

Source: v-chart-plugin.js

* @returns {Object} normalized dataset */ ds() { - return this.chartData.data.map((d) => { - const td = {}; - td.metric = this.chartData.metric ? d[this.chartData.metric] : d; + const ds = { metric: [] }; + ds.metric = (Array.isArray(this.chartData.metric)) ? ds.metric = this.chartData.metric : new Array(this.chartData.metric); + ds.dim = this.chartData.dim; + ds.data = this.chartData.data; + return ds.data.map((d) => { + const td = { metric: [] }; + if (!ds.metric[0]) + td.metric[0] = d || 0; + else { + ds.metric.forEach(function(e, i){ + td.metric[i] = d[e] || 0; + }) + } td.dim = this.chartData.dim ? d[this.chartData.dim] : null; return td; }); }, + /** + * Dimension getter function + * @memberOf Chart + * @returns {string} dim + */ + dim() { + return this.chartData.dim || "undefined"; + }, + /** + * Goal getter function + * @memberOf Chart + * @returns {number} Goal + */ + goal() { + return this.chartData.goal; + }, + /** + * Metric getter function + * @memberOf Chart + * @returns {array} Metrics + */ + metric() { + const metric = (Array.isArray(this.chartData.metric)) ? this.chartData.metric : new Array(this.chartData.metric); + return metric; + }, /** * Height getter function * @memberOf Chart * @returns {number} Chart Height */ height() { - return this.chartData.height || 200; + return this.chartData.height - 10 || 190; }, /** * Width getter function @@ -220,7 +353,18 @@

Source: v-chart-plugin.js

* @returns {number} Chart width */ width() { - return this.chartData.width || 200; + return this.chartData.width - 10 || 190; + }, + /** + * Grid Tick getter function + * @memberOf Chart + * @returns {number} gridTicks + */ + gridTicks() { + if (this.chartData.grid && this.chartData.grid.gridTicks != null) { + return this.chartData.grid.gridTicks; + } + return 100; }, /** * Get the maxium value for metric @@ -229,8 +373,30 @@

Source: v-chart-plugin.js

*/ max() { let max = 0; - this.ds.forEach((e) => { - max = max > e.metric ? max : e.metric; + var results = []; + this.ds.forEach(e => { + results = results.concat([...e.metric]); + }); + results.forEach((e) => { + max = max > e ? max : e; + }); + return max; + }, + /** + * Get the maxium value for triplet + * @memberOf Chart + * @returns {Array} Max values for triplet + */ + maxTriplet() { + const max = { + v1: 0, + v2: 0, + v3: 0 + }; + this.ds.forEach(e => { + max.v1 = max.v1 > e.metric[0] ? max.v1 : e.metric[0]; + max.v2 = max.v2 > e.metric[1] ? max.v2 : e.metric[1]; + max.v3 = max.v3 > e.metric[2] ? max.v3 : e.metric[2]; }); return max; }, @@ -240,16 +406,33 @@

Source: v-chart-plugin.js

* @returns {number} Min value for metric */ min() { - return Math.min(...this.ds.map(o => o.metric)); + var results = []; + this.ds.forEach(e => { + results = results.concat([...e.metric]); + }); + return Math.min(...results.map(o => o)); }, /** - * Gets the height of the title + * Get the minimum value for triplet * @memberOf Chart - * @returns {number} Height of the chart title + * @returns {Array} Min values for triplet */ - titleHeight() { - if (this.chartData.title) return this.chartData.textHeight || 25; - return 0; + minTriplet() { + var results = { + v1: [], + v2: [], + v3: [] + }; + this.ds.forEach(e => { + results.v1.push(e.metric[0]) + results.v2.push(e.metric[1]) + results.v3.push(e.metric[2]) + }) + return { + v1: (Math.min(...results.v1.map(o => o))), + v2: (Math.min(...results.v2.map(o => o))), + v3: (Math.min(...results.v3.map(o => o))) + }; }, /** * Gets the height of the dispaly area @@ -260,9 +443,18 @@

Source: v-chart-plugin.js

if (this.chartData.legends && this.chartData.legends.enabled === true) { return this.height * .80; } else { - return this.height; + return this.height * .90; } }, + /** + * 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 @@ -312,13 +504,13 @@

Source: v-chart-plugin.js


- Documentation generated by JSDoc 3.5.5 on Wed Oct 31 2018 22:43:41 GMT-0400 (EDT) + Documentation generated by JSDoc 3.5.5 on Fri Dec 07 2018 21:32:56 GMT-0500 (EST)
diff --git a/package.json b/package.json index 8de018a..ea58c12 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "v-chart-plugin", "main": "./dist/module/v-chart-plugin.js", - "version": "0.3.3", + "version": "1.0.0", "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/test/unit/coverage/lcov-report/index.html b/test/unit/coverage/lcov-report/index.html index 3f1c310..59250f1 100644 --- a/test/unit/coverage/lcov-report/index.html +++ b/test/unit/coverage/lcov-report/index.html @@ -20,24 +20,24 @@

- 73.09% + 65.7% Statements - 334/457 + 341/519
- 47.22% + 45.08% Branches - 51/108 + 55/122
- 60% + 50.68% Functions - 75/125 + 75/148
- 75% + 67.07% Lines - 324/432 + 330/492
@@ -60,15 +60,15 @@

src/ -
- 65.05% - 67/103 - 48.78% - 40/82 - 66.67% - 10/15 - 65% - 65/100 +
+ 62.07% + 72/116 + 45.83% + 44/96 + 62.5% + 10/16 + 62.16% + 69/111 @@ -99,15 +99,15 @@

src/import/ -
- 76.29% - 267/350 +
+ 67.42% + 269/399 42.31% 11/26 - 60.19% - 65/108 - 78.96% - 259/328 + 50% + 65/130 + 69.23% + 261/377 @@ -116,7 +116,7 @@

diff --git a/test/unit/coverage/lcov-report/src/App.vue.html b/test/unit/coverage/lcov-report/src/App.vue.html index e2a883c..91f947e 100644 --- a/test/unit/coverage/lcov-report/src/App.vue.html +++ b/test/unit/coverage/lcov-report/src/App.vue.html @@ -130,7 +130,7 @@

diff --git a/test/unit/coverage/lcov-report/src/assets/data/index.html b/test/unit/coverage/lcov-report/src/assets/data/index.html index 1c2d3bf..e5ac436 100644 --- a/test/unit/coverage/lcov-report/src/assets/data/index.html +++ b/test/unit/coverage/lcov-report/src/assets/data/index.html @@ -90,7 +90,7 @@

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 index ed72fba..71d04a7 100644 --- a/test/unit/coverage/lcov-report/src/assets/data/pop.js.html +++ b/test/unit/coverage/lcov-report/src/assets/data/pop.js.html @@ -2482,7 +2482,7 @@

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 index 8411e11..583e6dc 100644 --- a/test/unit/coverage/lcov-report/src/assets/data/sales.js.html +++ b/test/unit/coverage/lcov-report/src/assets/data/sales.js.html @@ -346,7 +346,7 @@

diff --git a/test/unit/coverage/lcov-report/src/components/chartExample.vue.html b/test/unit/coverage/lcov-report/src/components/chartExample.vue.html index d96f389..01fa006 100644 --- a/test/unit/coverage/lcov-report/src/components/chartExample.vue.html +++ b/test/unit/coverage/lcov-report/src/components/chartExample.vue.html @@ -203,7 +203,39 @@

158 159 160 -161  +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  +  +  +  +  +  +        @@ -363,6 +395,26 @@

      +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +   
<template>
   <div class="container">
     <div class="row">
@@ -382,20 +434,26 @@ 

<div class="col-6 col-md-8"> <div class="row"> <div class="col-12"> - <v-chart v-bind:chartData="bubbleChartData"></v-chart> + <v-chart v-bind:chartData="lineGraphData"></v-chart> </div> - <div class="col-12 col-lg-6"> + <div class="col-12"> <v-chart v-bind:chartData="areaChartData"></v-chart> </div> - <div class="col-12 col-lg-6"> - <v-chart v-bind:chartData="lineGraphData"></v-chart> + <div class="col-12"> + <v-chart v-bind:chartData="bubbleChartData"></v-chart> </div> - <div class="col-12 col-lg-6"> + <div class="col-12"> <v-chart v-bind:chartData="vBarChartData"></v-chart> </div> - <div class="col-12 col-lg-6"> + <div class="col-12"> + <v-chart v-bind:chartData="barChartData"></v-chart> + </div> + <div class="col-12"> <v-chart v-bind:chartData="pieChartData"></v-chart> </div> + <div class="col-12"> + <v-chart v-bind:chartData="scatterPlotData"></v-chart> + </div> </div> </div> </div> @@ -429,8 +487,8 @@

chartType: "areaChart", selector: "areaChart", title: "Area Chart", - width: 300, - height: 200, + width: 600, + height: 500, metric: ["total"], dim: "month", data: sales, @@ -442,35 +500,31 @@

}, bubbleChartData: { chartType: "bubbleChart", - selector: "chart", - title: "Bubble Plot", + selector: "bubbleChart", + title: "Bubble Chart", subtitle: "Sales by month", width: 600, height: 500, - metric: ["total", "forecast", "yoy"], + dim: "month", + grid: { + enabled: true, + }, + metric: ['total', 'forecast', 'yoy'], data: sales, goal: 500, - legends: { - enabled: true, - height: 25, - width: 50 - }, - grid: { - enabled: true, - gridTicks: 25 - } }, lineGraphData: { chartType: "lineGraph", selector: "lineGraph", title: "Line Graph", - width: 200, subtitle: "Sales by month", - height: 200, - goal: 500, + width: 600, + height: 500, + goal: 600, metric: ["total", "forecast"], dim: "month", data: sales, + label: true, legends: { enabled: true, height: 25, @@ -484,12 +538,12 @@

} }, vBarChartData: { - chartType: "barChart", + chartType: "vBarChart", selector: "vChart", title: "Bar Chart", subtitle: "Sales by month", - width: 300, - height: 300, + width: 600, + height: 500, metric: ["total", "forecast"], dim: "month", data: sales, @@ -498,20 +552,44 @@

height: 25, width: 50 }, - overrides: { - } + }, + barChartData: { + chartType: "barChart", + selector: "barChart", + title: "Bar Chart", + subtitle: "Sales by month", + width: 600, + height: 500, + metric: ["total", "forecast"], + dim: "month", + data: sales, + label: true }, pieChartData: { chartType: "pieChart", selector: "pieChart", title: "Pie Chart", subtitle: "Sales by month", - width: 300, - height: 200, + width: 600, + height: 500, metric: "total", dim: "month", data: sales }, + scatterPlotData: { + chartType: "scatterPlot", + selector: "scatterPlot", + title: "Scatter Plot", + subtitle: "Sales by month", + width: 600, + height: 500, + dim: "month", + label: { + enabled: true, + }, + metric: ['total', 'forecast'], + data: sales, + }, }; } }; @@ -529,7 +607,7 @@

diff --git a/test/unit/coverage/lcov-report/src/components/index.html b/test/unit/coverage/lcov-report/src/components/index.html index 21e7458..3b4baf6 100644 --- a/test/unit/coverage/lcov-report/src/components/index.html +++ b/test/unit/coverage/lcov-report/src/components/index.html @@ -77,7 +77,7 @@

diff --git a/test/unit/coverage/lcov-report/src/import/areaChart.js.html b/test/unit/coverage/lcov-report/src/import/areaChart.js.html index 17806e5..46612cd 100644 --- a/test/unit/coverage/lcov-report/src/import/areaChart.js.html +++ b/test/unit/coverage/lcov-report/src/import/areaChart.js.html @@ -185,7 +185,8 @@

140 141 142 -143  +143 +144        @@ -235,6 +236,7 @@

      +      @@ -369,6 +371,7 @@

}, y: { axisWidth: 45, + ticks: 10, }, }; /** @@ -428,7 +431,7 @@

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); + 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 - cs.x.axisWidth) * i)) / this.ds.length)); @@ -475,7 +478,7 @@

diff --git a/test/unit/coverage/lcov-report/src/import/barChart.js.html b/test/unit/coverage/lcov-report/src/import/barChart.js.html index d6a1a46..29cb072 100644 --- a/test/unit/coverage/lcov-report/src/import/barChart.js.html +++ b/test/unit/coverage/lcov-report/src/import/barChart.js.html @@ -262,7 +262,9 @@

217 218 219 -220  +220 +221 +222        @@ -320,6 +322,8 @@

      +  +      @@ -523,13 +527,15 @@

vPadding: 5, }, x: { + label: this.dim, axisHeight: 10, ticks: 5, }, y: { + label: this.metric, domain: [], range: [], - axisWidth: null, + axisWidth: 50, }, };   @@ -600,7 +606,7 @@

.on('mouseover', mouseOver) .on('mouseout', mouseOut); }); - Iif (this.goal) this.generateGoal(cs, svgContainer, false, cs.y.axisWidth + cs.bar.hPadding); + Iif (this.goal) this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding); return rects; }; /** @@ -618,7 +624,7 @@

.attr('y', getYCoord) .attr('x', cs.y.axisWidth + cs.bar.hPadding); }); - Iif (this.goal) this.generateGoal(cs, svgContainer, false, cs.y.axisWidth + cs.bar.hPadding); + Iif (this.goal) this.generateGoal(cs, false, cs.y.axisWidth + cs.bar.hPadding); return rects; }; /** @@ -706,7 +712,7 @@

diff --git a/test/unit/coverage/lcov-report/src/import/bubbleChart.js.html b/test/unit/coverage/lcov-report/src/import/bubbleChart.js.html index e3dc424..c436ee0 100644 --- a/test/unit/coverage/lcov-report/src/import/bubbleChart.js.html +++ b/test/unit/coverage/lcov-report/src/import/bubbleChart.js.html @@ -20,9 +20,9 @@

- 4.88% + 4.65% Statements - 2/41 + 2/43
100% @@ -32,12 +32,12 @@

0% Functions - 0/12 + 0/14
- 4.88% + 4.65% Lines - 2/41 + 2/43

@@ -179,7 +179,15 @@

134 135 136 -137  +137 +138 +139 +140 +141 +142 +143 +144 +145        @@ -236,6 +244,14 @@

      +  +  +  +  +  +  +  +        @@ -345,8 +361,8 @@

*/ let cs = { palette: { - pointFill: '#005792', - pointStroke: '#d1f4fa', + fill: '#005792', + stroke: '#d1f4fa', }, x: { domain: [], @@ -372,6 +388,14 @@

points.enter() .append('circle') .attr('class', this.selector) + .attr('fill', cs.palette.fill) + .attr('stroke', cs.palette.stroke) + .on('mouseover', (d) => { + this.addTooltip(d, window.event); + }) + .on('mouseout', (d) => { + this.removeTooltip(d); + }) .attr('r', d => cs.r.scale(d.metric[2])) .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric[1])); @@ -457,7 +481,7 @@

diff --git a/test/unit/coverage/lcov-report/src/import/index.html b/test/unit/coverage/lcov-report/src/import/index.html index 0061036..f039055 100644 --- a/test/unit/coverage/lcov-report/src/import/index.html +++ b/test/unit/coverage/lcov-report/src/import/index.html @@ -20,9 +20,9 @@

- 76.29% + 67.42% Statements - 267/350 + 269/399
42.31% @@ -30,14 +30,14 @@

11/26

- 60.19% + 50% Functions - 65/108 + 65/130
- 78.96% + 69.23% Lines - 259/328 + 261/377
@@ -84,17 +84,30 @@

53/59 + + boxPlot.js +
+ 4.44% + 2/45 + 100% + 0/0 + 0% + 0/18 + 4.44% + 2/45 + + bubbleChart.js -
- 4.88% - 2/41 +
+ 4.65% + 2/43 100% 0/0 0% - 0/12 - 4.88% - 2/41 + 0/14 + 4.65% + 2/43 @@ -125,15 +138,15 @@

scatterPlot.js -
- 89.47% - 34/38 +
+ 85% + 34/40 100% 0/0 - 60% - 6/10 - 89.47% - 34/38 + 50% + 6/12 + 85% + 34/40 @@ -155,7 +168,7 @@

diff --git a/test/unit/coverage/lcov-report/src/import/lineGraph.js.html b/test/unit/coverage/lcov-report/src/import/lineGraph.js.html index 8fd24da..4021cf5 100644 --- a/test/unit/coverage/lcov-report/src/import/lineGraph.js.html +++ b/test/unit/coverage/lcov-report/src/import/lineGraph.js.html @@ -230,7 +230,9 @@

185 186 187 -188  +188 +189 +190        @@ -281,6 +283,8 @@

      +  +  @@ -452,12 +456,14 @@

pointStroke: '#d1f4fa', }, x: { + label: this.dim, domain: [], range: [], axisHeight: 20, }, y: { - axisWidth: 30, + label: this.metric, + axisWidth: 40, ticks: 5, }, }; @@ -493,7 +499,7 @@

.attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric)); }); - Iif (this.goal) this.generateGoal(cs, svgContainer, true, 0); + Iif (this.goal) this.generateGoal(cs, true, 0); return points; }; /** @@ -516,7 +522,7 @@

.attr('cx', d => cs.x.scale(d.dim) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric)); }); - Iif (this.goal) this.generateGoal(cs, svgContainer, true, 0); + Iif (this.goal) this.generateGoal(cs, true, 0); return points; };   @@ -610,7 +616,7 @@

diff --git a/test/unit/coverage/lcov-report/src/import/pieChart.js.html b/test/unit/coverage/lcov-report/src/import/pieChart.js.html index c971910..a792bef 100644 --- a/test/unit/coverage/lcov-report/src/import/pieChart.js.html +++ b/test/unit/coverage/lcov-report/src/import/pieChart.js.html @@ -439,7 +439,7 @@

diff --git a/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html b/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html index 340d1f5..c40c60a 100644 --- a/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html +++ b/test/unit/coverage/lcov-report/src/import/scatterPlot.js.html @@ -20,9 +20,9 @@

- 89.47% + 85% Statements - 34/38 + 34/40
100% @@ -30,14 +30,14 @@

0/0

- 60% + 50% Functions - 6/10 + 6/12
- 89.47% + 85% Lines - 34/38 + 34/40
@@ -176,7 +176,17 @@

131 132 133 -134  +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144        @@ -230,11 +240,21 @@

      +  +        +  +  +  +  +  +  +  +      @@ -347,10 +367,12 @@

domain: [], range: [], axisHeight: 20, + label: this.metric[0], }, y: { axisWidth: 30, ticks: 5, + label: this.metric[1], }, r: { width: 5 @@ -367,7 +389,15 @@

points.enter() .append('circle') .attr('class', this.selector) + .attr('fill', cs.palette.fill) + .attr('stroke', cs.palette.stroke) .attr('r', cs.r.width) + .on('mouseover', (d) => { + this.addTooltip(d, window.event); + }) + .on('mouseout', (d) => { + this.removeTooltip(d); + }) .attr('cx', d => cs.x.scale(d.metric[0]) + cs.y.axisWidth + 5) .attr('cy', d => cs.y.scale(d.metric[1])); return points; @@ -404,10 +434,10 @@

*/ const buildScales = cs => { cs.y.scale = d3.scaleLinear() - .domain([this.minTriplet.v2, this.maxTriplet.v2]) + .domain([this.minTriplet.v2 - this.maxTriplet.v2 * .05, this.maxTriplet.v2 + this.maxTriplet.v2 * .05]) .range([this.displayHeight - cs.x.axisHeight, this.header]); cs.x.scale = d3.scaleLinear() - .domain([this.minTriplet.v1, this.maxTriplet.v1]) + .domain([this.minTriplet.v1 - this.maxTriplet.v2 * .05, this.maxTriplet.v1 + this.maxTriplet.v1 * .05]) .range([0, this.width]); }; /** @@ -448,7 +478,7 @@

diff --git a/test/unit/coverage/lcov-report/src/import/vBarChart.js.html b/test/unit/coverage/lcov-report/src/import/vBarChart.js.html index 490ae69..f845b73 100644 --- a/test/unit/coverage/lcov-report/src/import/vBarChart.js.html +++ b/test/unit/coverage/lcov-report/src/import/vBarChart.js.html @@ -673,7 +673,7 @@

diff --git a/test/unit/coverage/lcov-report/src/index.html b/test/unit/coverage/lcov-report/src/index.html index 4c1fea6..cd0ba0f 100644 --- a/test/unit/coverage/lcov-report/src/index.html +++ b/test/unit/coverage/lcov-report/src/index.html @@ -20,24 +20,24 @@

- 65.05% + 62.07% Statements - 67/103 + 72/116
- 48.78% + 45.83% Branches - 40/82 + 44/96
- 66.67% + 62.5% Functions - 10/15 + 10/16
- 65% + 62.16% Lines - 65/100 + 69/111
@@ -73,15 +73,15 @@

v-chart-plugin.js -
- 65.05% - 67/103 - 48.78% - 40/82 - 66.67% - 10/15 - 65% - 65/100 +
+ 62.07% + 72/116 + 45.83% + 44/96 + 62.5% + 10/16 + 62.16% + 69/111 @@ -90,7 +90,7 @@

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 index 70a5c9f..766b615 100644 --- a/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html +++ b/test/unit/coverage/lcov-report/src/v-chart-plugin.js.html @@ -20,24 +20,24 @@

- 65.05% + 62.07% Statements - 67/103 + 72/116
- 48.78% + 45.83% Branches - 40/82 + 44/96
- 66.67% + 62.5% Functions - 10/15 + 10/16
- 65% + 62.16% Lines - 65/100 + 69/111
@@ -459,7 +459,59 @@

414 415 416 -417  +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        @@ -502,6 +554,7 @@

+       @@ -563,6 +616,7 @@

      +      @@ -577,6 +631,7 @@

      +        @@ -633,6 +688,7 @@

      +        @@ -676,6 +732,46 @@

      + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +        @@ -717,8 +813,16 @@

      - - + +  +  +  +  +  +  +  + +       @@ -917,6 +1021,7 @@

initalizeChart() { const cs = this[this.chartData.chartType]('init'); this.drawTitle(); + this.generateAxisLabels(cs); this.generateLegend(cs); }, /** @@ -974,6 +1079,7 @@

drawTitle() { d3.select(`#${this.chartData.selector}`) .append('text') + .attr('font-size', '20') .attr('x', this.width / 2) .attr('y', this.titleHeight - this.titleHeight * 0.1) .style('text-anchor', 'middle') @@ -981,6 +1087,7 @@

  d3.select(`#${this.chartData.selector}`) .append('text') + .attr('font-size', '12') .attr('x', this.width / 2) .attr('y', this.titleHeight - this.titleHeight * 0.1 + this.subtitleHeight) .style('text-anchor', 'middle') @@ -1044,6 +1151,7 @@

this.metric.forEach( (e, i) => { d3.select(`#${this.chartData.selector}`) .append('text') + .attr('font-size', '10') .attr('x', this.width - 60) .attr('y', this.height * 0.95 - (i * 15)) .style('text-anchor', 'middle') @@ -1070,14 +1178,14 @@

* @param {Object} cs configuration of the coordinate system */   - generateGoal(cs, svgContainer, shiftAxis, padding) { - svgContainer.selectAll('line#goal').remove(); + generateGoal(cs, shiftAxis, padding) { + d3.select(`#${this.chartData.selector}`).selectAll('line#goal').remove(); const x1 = shiftAxis ? cs.y.axisWidth: cs.x.scale(this.goal) + padding; - const x2 = shiftAxis ? 500 : cs.x.scale(this.goal) + padding; + const x2 = shiftAxis ? this.width : cs.x.scale(this.goal) + padding; const y1 = shiftAxis ? cs.y.scale(this.goal) + padding : this.header; const y2 = shiftAxis ? cs.y.scale(this.goal) + padding : this.displayHeight - cs.x.axisHeight; - svgContainer.append("line") + d3.select(`#${this.chartData.selector}`).append('line') .attr('x1', x1) .attr('x2', x2) .attr('y1', y1) @@ -1086,6 +1194,46 @@

.style('stroke', '#708090') .style('stroke-width', 1) }, + /** + * Generate Axis Lables + * @memberOf Chart + * @param {Object} cs configuration of the coordinate system + */ + generateAxisLabels(cs) { + let footer = (this.chartData.legends) ? .85 : .95; + Eif (!this.chartData.label) return; + d3.select(`#${this.chartData.selector}`).selectAll('text.axisLabel').remove(); + + if (cs.x && cs.x.label) + d3.select(`#${this.chartData.selector}`).append('text') + .attr('font-size', '10') + .attr('x', this.width / 2) + .attr('y', this.height * footer) + .attr('id', 'xAxisLabel') + .attr('class', 'axisLabel') + .style('text-anchor', 'middle') + .text(cs.x.label) +  + if (cs.y && cs.y.label) + d3.select(`#${this.chartData.selector}`).append('text') + .attr('font-size', '10') + .attr('x', 10) + .attr('y', this.height / 2) + .attr('id', 'xAxisLabel') + .attr('class', 'axisLabel') + .style('text-anchor', 'middle') + .text(cs.y.label) + .attr('transform', `rotate(-90,10, ${this.height / 2})`) + }, + /** + * get the values of a metric as an array + * @memberOf Chart + * @returns {Array} metric values + */ + metricAsArray(metric) { + metric = this.chartData.data.map(d => d[metric]); + return metric; + },   ...((typeof barChart !== 'undefined') && { barChart }), ...((typeof vBarChart !== 'undefined') && { vBarChart }), @@ -1119,6 +1267,14 @@

return td; }); }, + /** + * Dimension getter function + * @memberOf Chart + * @returns {string} dim + */ + dim() { + return this.chartData.dim || "undefined"; + }, /** * Goal getter function * @memberOf Chart @@ -1142,7 +1298,7 @@

* @returns {number} Chart Height */ height() { - return this.chartData.height || 200; + return this.chartData.height - 10 || 190; }, /** * Width getter function @@ -1150,7 +1306,7 @@

* @returns {number} Chart width */ width() { - return this.chartData.width || 200; + return this.chartData.width - 10 || 190; }, /** * Grid Tick getter function @@ -1240,7 +1396,7 @@

Iif (this.chartData.legends && this.chartData.legends.enabled === true) { return this.height * .80; } else { - return this.height; + return this.height * .90; } }, /** @@ -1297,7 +1453,7 @@

diff --git a/test/unit/coverage/lcov.info b/test/unit/coverage/lcov.info index 69c4b81..254ceed 100644 --- a/test/unit/coverage/lcov.info +++ b/test/unit/coverage/lcov.info @@ -1,37 +1,39 @@ TN: SF:/Users/briangreig/workspace/http/v-chart-plugin/src/v-chart-plugin.js -FN:73,(anonymous_0) -FN:74,(anonymous_1) -FN:167,(anonymous_2) -FN:183,(anonymous_3) -FN:232,(anonymous_4) -FN:237,(anonymous_5) -FN:297,(anonymous_6) -FN:300,(anonymous_7) -FN:316,(anonymous_8) -FN:330,(anonymous_9) -FN:333,(anonymous_10) -FN:346,(anonymous_11) -FN:352,(anonymous_12) -FN:353,(anonymous_13) -FN:354,(anonymous_14) -FNF:15 +FN:74,(anonymous_0) +FN:75,(anonymous_1) +FN:170,(anonymous_2) +FN:187,(anonymous_3) +FN:253,(anonymous_4) +FN:276,(anonymous_5) +FN:281,(anonymous_6) +FN:349,(anonymous_7) +FN:352,(anonymous_8) +FN:368,(anonymous_9) +FN:382,(anonymous_10) +FN:385,(anonymous_11) +FN:398,(anonymous_12) +FN:404,(anonymous_13) +FN:405,(anonymous_14) +FN:406,(anonymous_15) +FNF:16 FNH:10 FNDA:0,(anonymous_0) FNDA:0,(anonymous_1) FNDA:0,(anonymous_2) FNDA:0,(anonymous_3) -FNDA:12,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:8,(anonymous_6) +FNDA:0,(anonymous_4) +FNDA:12,(anonymous_5) +FNDA:0,(anonymous_6) FNDA:8,(anonymous_7) -FNDA:2,(anonymous_8) +FNDA:8,(anonymous_8) FNDA:2,(anonymous_9) FNDA:2,(anonymous_10) FNDA:2,(anonymous_11) FNDA:2,(anonymous_12) FNDA:2,(anonymous_13) FNDA:2,(anonymous_14) +FNDA:2,(anonymous_15) DA:18,1 DA:26,1 DA:28,1 @@ -39,207 +41,232 @@ DA:31,6 DA:41,6 DA:42,6 DA:43,6 -DA:50,0 +DA:44,6 DA:51,0 -DA:58,5 -DA:59,0 -DA:63,0 +DA:52,0 +DA:59,5 +DA:60,0 DA:64,0 -DA:66,0 -DA:73,0 +DA:65,0 +DA:67,0 DA:74,0 -DA:84,0 -DA:91,0 -DA:98,6 -DA:105,6 -DA:119,0 -DA:128,0 -DA:142,0 -DA:152,6 -DA:153,6 -DA:154,6 -DA:155,21 +DA:75,0 +DA:85,0 +DA:92,0 +DA:99,6 +DA:107,6 +DA:122,0 +DA:131,0 +DA:145,0 +DA:155,6 DA:156,6 -DA:164,6 -DA:165,0 -DA:166,0 -DA:167,0 +DA:157,6 +DA:158,21 +DA:159,6 +DA:167,6 DA:168,0 -DA:175,0 -DA:184,0 -DA:185,0 -DA:197,0 -DA:198,0 -DA:199,0 -DA:200,0 +DA:169,0 +DA:170,0 +DA:171,0 +DA:179,0 +DA:188,0 +DA:189,0 DA:201,0 +DA:202,0 DA:203,0 -DA:228,6 -DA:229,6 -DA:230,6 -DA:231,6 -DA:232,6 -DA:233,12 -DA:234,12 -DA:235,12 +DA:204,0 +DA:205,0 +DA:207,0 +DA:222,6 +DA:223,6 +DA:224,0 +DA:226,0 +DA:227,0 +DA:236,0 DA:237,0 -DA:238,0 -DA:241,12 -DA:242,12 -DA:251,2 -DA:259,3 -DA:260,3 -DA:268,6 +DA:253,0 +DA:254,0 +DA:272,6 +DA:273,6 +DA:274,6 +DA:275,6 DA:276,6 -DA:284,0 -DA:285,0 -DA:287,0 -DA:295,4 -DA:296,4 -DA:297,4 -DA:298,8 -DA:300,4 -DA:301,8 -DA:303,4 -DA:311,1 -DA:316,1 -DA:317,2 -DA:318,2 -DA:319,2 -DA:321,1 -DA:329,1 -DA:330,1 -DA:331,2 -DA:333,2 -DA:341,1 -DA:346,1 -DA:347,2 -DA:348,2 -DA:349,2 -DA:351,1 -DA:352,2 -DA:353,2 -DA:354,2 -DA:363,5 -DA:364,0 -DA:366,5 -DA:375,6 -DA:376,0 -DA:384,6 -DA:385,6 -DA:393,5 -DA:397,6 -DA:402,0 -DA:415,1 +DA:277,12 +DA:278,12 +DA:279,12 +DA:281,0 +DA:282,0 +DA:285,12 +DA:286,12 +DA:295,2 +DA:303,2 +DA:311,4 +DA:312,4 +DA:320,6 +DA:328,6 +DA:336,0 +DA:337,0 +DA:339,0 +DA:347,4 +DA:348,4 +DA:349,4 +DA:350,8 +DA:352,4 +DA:353,8 +DA:355,4 +DA:363,1 +DA:368,1 +DA:369,2 +DA:370,2 +DA:371,2 +DA:373,1 +DA:381,1 +DA:382,1 +DA:383,2 +DA:385,2 +DA:393,1 +DA:398,1 +DA:399,2 +DA:400,2 +DA:401,2 +DA:403,1 +DA:404,2 +DA:405,2 +DA:406,2 +DA:415,5 DA:416,0 -LF:100 -LH:65 -BRDA:58,0,0,0 -BRDA:58,0,1,5 -BRDA:58,1,0,5 -BRDA:58,1,1,0 -BRDA:152,2,0,6 -BRDA:152,2,1,6 -BRDA:164,3,0,0 -BRDA:164,3,1,6 -BRDA:164,4,0,6 -BRDA:164,4,1,0 -BRDA:165,5,0,0 -BRDA:165,5,1,0 -BRDA:166,6,0,0 -BRDA:166,6,1,0 -BRDA:184,7,0,0 -BRDA:184,7,1,0 -BRDA:198,8,0,0 -BRDA:198,8,1,0 -BRDA:199,9,0,0 -BRDA:199,9,1,0 -BRDA:200,10,0,0 -BRDA:200,10,1,0 -BRDA:201,11,0,0 -BRDA:201,11,1,0 -BRDA:213,12,0,1 -BRDA:213,12,1,1 -BRDA:214,13,0,1 -BRDA:214,13,1,1 -BRDA:215,14,0,1 -BRDA:215,14,1,1 -BRDA:216,15,0,1 -BRDA:216,15,1,1 -BRDA:217,16,0,1 -BRDA:217,16,1,1 -BRDA:218,17,0,1 -BRDA:218,17,1,1 -BRDA:219,18,0,1 -BRDA:219,18,1,1 -BRDA:229,19,0,0 -BRDA:229,19,1,6 -BRDA:234,20,0,12 -BRDA:234,20,1,0 -BRDA:235,21,0,12 -BRDA:235,21,1,0 -BRDA:238,22,0,0 -BRDA:238,22,1,0 -BRDA:241,23,0,0 -BRDA:241,23,1,12 -BRDA:259,24,0,0 -BRDA:259,24,1,3 -BRDA:268,25,0,6 -BRDA:268,25,1,0 -BRDA:276,26,0,6 -BRDA:276,26,1,0 -BRDA:284,27,0,0 -BRDA:284,27,1,0 -BRDA:284,28,0,0 -BRDA:284,28,1,0 -BRDA:301,29,0,0 -BRDA:301,29,1,8 -BRDA:317,30,0,0 -BRDA:317,30,1,2 -BRDA:318,31,0,0 -BRDA:318,31,1,2 -BRDA:319,32,0,0 -BRDA:319,32,1,2 -BRDA:363,33,0,0 -BRDA:363,33,1,5 -BRDA:363,34,0,5 -BRDA:363,34,1,0 -BRDA:375,35,0,6 -BRDA:375,35,1,0 -BRDA:375,36,0,6 -BRDA:375,36,1,6 -BRDA:384,37,0,0 -BRDA:384,37,1,6 -BRDA:384,38,0,0 -BRDA:384,38,1,0 -BRDA:415,39,0,0 -BRDA:415,39,1,1 -BRDA:415,40,0,1 -BRDA:415,40,1,1 -BRF:82 -BRH:40 +DA:418,5 +DA:427,6 +DA:428,0 +DA:436,6 +DA:437,6 +DA:445,5 +DA:449,6 +DA:454,0 +DA:467,1 +DA:468,0 +LF:111 +LH:69 +BRDA:59,0,0,0 +BRDA:59,0,1,5 +BRDA:59,1,0,5 +BRDA:59,1,1,0 +BRDA:155,2,0,6 +BRDA:155,2,1,6 +BRDA:167,3,0,0 +BRDA:167,3,1,6 +BRDA:167,4,0,6 +BRDA:167,4,1,0 +BRDA:168,5,0,0 +BRDA:168,5,1,0 +BRDA:169,6,0,0 +BRDA:169,6,1,0 +BRDA:188,7,0,0 +BRDA:188,7,1,0 +BRDA:202,8,0,0 +BRDA:202,8,1,0 +BRDA:203,9,0,0 +BRDA:203,9,1,0 +BRDA:204,10,0,0 +BRDA:204,10,1,0 +BRDA:205,11,0,0 +BRDA:205,11,1,0 +BRDA:222,12,0,0 +BRDA:222,12,1,6 +BRDA:223,13,0,6 +BRDA:223,13,1,0 +BRDA:226,14,0,0 +BRDA:226,14,1,0 +BRDA:226,15,0,0 +BRDA:226,15,1,0 +BRDA:236,16,0,0 +BRDA:236,16,1,0 +BRDA:236,17,0,0 +BRDA:236,17,1,0 +BRDA:257,18,0,1 +BRDA:257,18,1,1 +BRDA:258,19,0,1 +BRDA:258,19,1,1 +BRDA:259,20,0,1 +BRDA:259,20,1,1 +BRDA:260,21,0,1 +BRDA:260,21,1,1 +BRDA:261,22,0,1 +BRDA:261,22,1,1 +BRDA:262,23,0,1 +BRDA:262,23,1,1 +BRDA:263,24,0,1 +BRDA:263,24,1,1 +BRDA:273,25,0,0 +BRDA:273,25,1,6 +BRDA:278,26,0,12 +BRDA:278,26,1,0 +BRDA:279,27,0,12 +BRDA:279,27,1,0 +BRDA:282,28,0,0 +BRDA:282,28,1,0 +BRDA:285,29,0,0 +BRDA:285,29,1,12 +BRDA:295,30,0,2 +BRDA:295,30,1,2 +BRDA:311,31,0,0 +BRDA:311,31,1,4 +BRDA:320,32,0,6 +BRDA:320,32,1,0 +BRDA:328,33,0,6 +BRDA:328,33,1,0 +BRDA:336,34,0,0 +BRDA:336,34,1,0 +BRDA:336,35,0,0 +BRDA:336,35,1,0 +BRDA:353,36,0,0 +BRDA:353,36,1,8 +BRDA:369,37,0,0 +BRDA:369,37,1,2 +BRDA:370,38,0,0 +BRDA:370,38,1,2 +BRDA:371,39,0,0 +BRDA:371,39,1,2 +BRDA:415,40,0,0 +BRDA:415,40,1,5 +BRDA:415,41,0,5 +BRDA:415,41,1,0 +BRDA:427,42,0,6 +BRDA:427,42,1,0 +BRDA:427,43,0,6 +BRDA:427,43,1,6 +BRDA:436,44,0,0 +BRDA:436,44,1,6 +BRDA:436,45,0,0 +BRDA:436,45,1,0 +BRDA:467,46,0,0 +BRDA:467,46,1,1 +BRDA:467,47,0,1 +BRDA:467,47,1,1 +BRF:96 +BRH:44 end_of_record TN: SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/barChart.js FN:23,chart -FN:59,(anonymous_1) -FN:66,(anonymous_2) -FN:76,(anonymous_3) -FN:85,(anonymous_4) -FN:95,(anonymous_5) -FN:104,(anonymous_6) -FN:105,(anonymous_7) -FN:129,(anonymous_8) -FN:130,(anonymous_9) -FN:147,(anonymous_10) -FN:148,(anonymous_11) -FN:158,(anonymous_12) -FN:162,(anonymous_13) -FN:163,(anonymous_14) -FN:172,(anonymous_15) -FN:191,(anonymous_16) -FN:197,(anonymous_17) -FN:198,(anonymous_18) +FN:61,(anonymous_1) +FN:68,(anonymous_2) +FN:78,(anonymous_3) +FN:87,(anonymous_4) +FN:97,(anonymous_5) +FN:106,(anonymous_6) +FN:107,(anonymous_7) +FN:131,(anonymous_8) +FN:132,(anonymous_9) +FN:149,(anonymous_10) +FN:150,(anonymous_11) +FN:160,(anonymous_12) +FN:164,(anonymous_13) +FN:165,(anonymous_14) +FN:174,(anonymous_15) +FN:193,(anonymous_16) +FN:199,(anonymous_17) +FN:200,(anonymous_18) FNF:19 FNH:13 FNDA:1,chart @@ -265,36 +292,34 @@ DA:13,1 DA:23,1 DA:28,1 DA:33,1 -DA:59,1 -DA:66,1 -DA:76,1 -DA:85,1 -DA:86,0 -DA:95,1 -DA:96,0 -DA:104,1 -DA:105,1 +DA:61,1 +DA:68,1 +DA:78,1 +DA:87,1 +DA:88,0 +DA:97,1 +DA:98,0 DA:106,1 DA:107,1 -DA:120,1 -DA:121,1 -DA:129,1 -DA:130,1 +DA:108,1 +DA:109,1 +DA:122,1 +DA:123,1 DA:131,1 DA:132,1 -DA:138,1 -DA:139,1 -DA:147,1 -DA:148,1 +DA:133,1 +DA:134,1 +DA:140,1 +DA:141,1 DA:149,1 +DA:150,1 DA:151,1 -DA:158,1 -DA:159,1 -DA:162,2 -DA:163,2 -DA:165,1 -DA:172,1 -DA:173,1 +DA:153,1 +DA:160,1 +DA:161,1 +DA:164,2 +DA:165,2 +DA:167,1 DA:174,1 DA:175,1 DA:176,1 @@ -302,42 +327,44 @@ DA:177,1 DA:178,1 DA:179,1 DA:180,1 -DA:181,0 +DA:181,1 DA:182,1 -DA:191,1 -DA:192,0 -DA:193,0 -DA:196,1 -DA:197,1 +DA:183,0 +DA:184,1 +DA:193,1 +DA:194,0 +DA:195,0 DA:198,1 -DA:199,2 -DA:206,1 -DA:207,1 -DA:208,0 -DA:210,1 -DA:211,1 +DA:199,1 +DA:200,1 +DA:201,2 +DA:208,1 +DA:209,1 +DA:210,0 DA:212,1 DA:213,1 DA:214,1 +DA:215,1 DA:216,1 +DA:218,1 LF:59 LH:53 -BRDA:120,0,0,0 -BRDA:120,0,1,1 -BRDA:138,1,0,0 -BRDA:138,1,1,1 -BRDA:180,2,0,0 -BRDA:180,2,1,1 -BRDA:192,3,0,0 -BRDA:192,3,1,0 -BRDA:193,4,0,0 -BRDA:193,4,1,0 -BRDA:207,5,0,0 -BRDA:207,5,1,1 -BRDA:207,6,0,1 -BRDA:207,6,1,1 -BRDA:208,7,0,0 -BRDA:208,7,1,0 +BRDA:122,0,0,0 +BRDA:122,0,1,1 +BRDA:140,1,0,0 +BRDA:140,1,1,1 +BRDA:182,2,0,0 +BRDA:182,2,1,1 +BRDA:194,3,0,0 +BRDA:194,3,1,0 +BRDA:195,4,0,0 +BRDA:195,4,1,0 +BRDA:209,5,0,0 +BRDA:209,5,1,1 +BRDA:209,6,0,1 +BRDA:209,6,1,1 +BRDA:210,7,0,0 +BRDA:210,7,1,0 BRF:16 BRH:6 end_of_record @@ -443,33 +470,33 @@ end_of_record TN: SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/lineGraph.js FN:19,chart -FN:52,(anonymous_1) -FN:53,(anonymous_2) -FN:61,(anonymous_3) -FN:68,(anonymous_4) -FN:71,(anonymous_5) -FN:74,(anonymous_6) -FN:75,(anonymous_7) -FN:86,(anonymous_8) -FN:87,(anonymous_9) -FN:92,(anonymous_10) -FN:95,(anonymous_11) -FN:96,(anonymous_12) -FN:97,(anonymous_13) -FN:98,(anonymous_14) -FN:110,(anonymous_15) -FN:111,(anonymous_16) -FN:114,(anonymous_17) -FN:125,(anonymous_18) -FN:129,(anonymous_19) -FN:130,(anonymous_20) -FN:138,(anonymous_21) -FN:153,(anonymous_22) -FN:156,(anonymous_23) -FN:157,(anonymous_24) -FN:162,(anonymous_25) -FN:163,(anonymous_26) -FN:172,(anonymous_27) +FN:54,(anonymous_1) +FN:55,(anonymous_2) +FN:63,(anonymous_3) +FN:70,(anonymous_4) +FN:73,(anonymous_5) +FN:76,(anonymous_6) +FN:77,(anonymous_7) +FN:88,(anonymous_8) +FN:89,(anonymous_9) +FN:94,(anonymous_10) +FN:97,(anonymous_11) +FN:98,(anonymous_12) +FN:99,(anonymous_13) +FN:100,(anonymous_14) +FN:112,(anonymous_15) +FN:113,(anonymous_16) +FN:116,(anonymous_17) +FN:127,(anonymous_18) +FN:131,(anonymous_19) +FN:132,(anonymous_20) +FN:140,(anonymous_21) +FN:155,(anonymous_22) +FN:158,(anonymous_23) +FN:159,(anonymous_24) +FN:164,(anonymous_25) +FN:165,(anonymous_26) +FN:174,(anonymous_27) FNF:28 FNH:20 FNDA:1,chart @@ -504,43 +531,41 @@ 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:62,1 +DA:55,1 +DA:56,1 DA:63,1 -DA:69,0 -DA:72,0 +DA:64,1 +DA:65,1 +DA:71,0 DA:74,0 -DA:75,0 -DA:77,1 -DA:78,1 -DA:86,1 -DA:87,1 +DA:76,0 +DA:77,0 +DA:79,1 +DA:80,1 DA:88,1 -DA:92,1 -DA:93,1 +DA:89,1 +DA:90,1 DA:94,1 -DA:95,0 -DA:96,0 +DA:95,1 +DA:96,1 DA:97,0 DA:98,0 -DA:100,1 -DA:101,1 -DA:110,1 -DA:111,1 +DA:99,0 +DA:100,0 +DA:102,1 +DA:103,1 DA:112,1 +DA:113,1 DA:114,1 -DA:115,1 +DA:116,1 DA:117,1 -DA:125,1 -DA:126,1 -DA:129,2 -DA:130,2 -DA:131,1 -DA:138,1 -DA:139,1 +DA:119,1 +DA:127,1 +DA:128,1 +DA:131,2 +DA:132,2 +DA:133,1 DA:140,1 DA:141,1 DA:142,1 @@ -548,98 +573,106 @@ DA:143,1 DA:144,1 DA:145,1 DA:146,1 +DA:147,1 DA:148,1 -DA:152,1 -DA:153,1 +DA:150,1 DA:154,1 -DA:156,4 -DA:157,4 -DA:161,1 -DA:162,1 +DA:155,1 +DA:156,1 +DA:158,4 +DA:159,4 DA:163,1 -DA:164,2 -DA:171,1 -DA:172,1 +DA:164,1 +DA:165,1 +DA:166,2 DA:173,1 -DA:176,1 +DA:174,1 +DA:175,1 DA:178,1 -DA:179,1 DA:180,1 DA:181,1 DA:182,1 +DA:183,1 DA:184,1 +DA:186,1 LF:68 LH:60 -BRDA:77,0,0,0 -BRDA:77,0,1,1 -BRDA:100,1,0,0 -BRDA:100,1,1,1 +BRDA:79,0,0,0 +BRDA:79,0,1,1 +BRDA:102,1,0,0 +BRDA:102,1,1,1 BRF:4 BRH:2 end_of_record TN: SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/scatterPlot.js FN:20,chart -FN:55,(anonymous_1) -FN:60,(anonymous_2) -FN:61,(anonymous_3) +FN:57,(anonymous_1) +FN:64,(anonymous_2) +FN:67,(anonymous_3) FN:70,(anonymous_4) -FN:73,(anonymous_5) -FN:74,(anonymous_6) -FN:84,(anonymous_7) -FN:94,(anonymous_8) -FN:107,(anonymous_9) -FNF:10 +FN:71,(anonymous_5) +FN:80,(anonymous_6) +FN:83,(anonymous_7) +FN:84,(anonymous_8) +FN:94,(anonymous_9) +FN:104,(anonymous_10) +FN:117,(anonymous_11) +FNF:12 FNH:6 FNDA:1,chart FNDA:1,(anonymous_1) FNDA:0,(anonymous_2) FNDA:0,(anonymous_3) -FNDA:1,(anonymous_4) +FNDA:0,(anonymous_4) FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:1,(anonymous_7) -FNDA:1,(anonymous_8) +FNDA:1,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) FNDA:1,(anonymous_9) +FNDA:1,(anonymous_10) +FNDA:1,(anonymous_11) DA:11,1 DA:20,1 DA:25,1 DA:30,1 -DA:55,1 -DA:56,1 -DA:60,0 -DA:61,0 -DA:62,1 -DA:70,1 -DA:71,1 -DA:73,0 -DA:74,0 -DA:75,1 -DA:84,1 +DA:57,1 +DA:58,1 +DA:65,0 +DA:68,0 +DA:70,0 +DA:71,0 +DA:72,1 +DA:80,1 +DA:81,1 +DA:83,0 +DA:84,0 DA:85,1 -DA:86,1 DA:94,1 DA:95,1 -DA:98,1 -DA:107,1 +DA:96,1 +DA:104,1 +DA:105,1 DA:108,1 -DA:109,1 -DA:110,1 -DA:111,1 -DA:112,1 -DA:113,1 -DA:114,1 -DA:115,1 DA:117,1 +DA:118,1 +DA:119,1 +DA:120,1 DA:121,1 +DA:122,1 DA:123,1 DA:124,1 DA:125,1 -DA:126,1 DA:127,1 -DA:128,1 -DA:130,1 -LF:38 +DA:131,1 +DA:133,1 +DA:134,1 +DA:135,1 +DA:136,1 +DA:137,1 +DA:138,1 +DA:140,1 +LF:40 LH:34 BRF:0 BRH:0 @@ -703,17 +736,17 @@ end_of_record TN: SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/areaChart.js FN:20,chart -FN:51,(anonymous_1) -FN:54,(anonymous_2) -FN:66,(anonymous_3) -FN:79,(anonymous_4) -FN:89,(anonymous_5) -FN:98,(anonymous_6) -FN:103,(anonymous_7) -FN:104,(anonymous_8) -FN:114,(anonymous_9) -FN:117,(anonymous_10) -FN:118,(anonymous_11) +FN:52,(anonymous_1) +FN:55,(anonymous_2) +FN:67,(anonymous_3) +FN:80,(anonymous_4) +FN:90,(anonymous_5) +FN:99,(anonymous_6) +FN:104,(anonymous_7) +FN:105,(anonymous_8) +FN:115,(anonymous_9) +FN:118,(anonymous_10) +FN:119,(anonymous_11) FNF:12 FNH:8 FNDA:1,chart @@ -732,49 +765,49 @@ DA:11,1 DA:20,1 DA:25,1 DA:30,1 -DA:51,1 -DA:52,0 +DA:52,1 DA:53,0 DA:54,0 DA:55,0 -DA:58,1 -DA:66,1 +DA:56,0 +DA:59,1 DA:67,1 -DA:79,1 +DA:68,1 DA:80,1 -DA:89,1 +DA:81,1 DA:90,1 DA:91,1 -DA:98,1 +DA:92,1 DA:99,1 -DA:102,1 -DA:103,2 +DA:100,1 +DA:103,1 DA:104,2 -DA:106,1 +DA:105,2 DA:107,1 -DA:114,1 +DA:108,1 DA:115,1 DA:116,1 -DA:117,0 +DA:117,1 DA:118,0 -DA:119,1 +DA:119,0 DA:120,1 DA:121,1 DA:122,1 DA:123,1 -DA:126,1 -DA:127,0 -DA:132,1 +DA:124,1 +DA:127,1 +DA:128,0 DA:133,1 DA:134,1 DA:135,1 DA:136,1 DA:137,1 -DA:139,1 +DA:138,1 +DA:140,1 LF:43 LH:36 -BRDA:126,0,0,0 -BRDA:126,0,1,1 +BRDA:127,0,0,0 +BRDA:127,0,1,1 BRF:2 BRH:1 end_of_record @@ -782,17 +815,19 @@ TN: SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/bubbleChart.js FN:19,chart FN:54,(anonymous_1) -FN:58,(anonymous_2) -FN:59,(anonymous_3) -FN:60,(anonymous_4) -FN:69,(anonymous_5) -FN:71,(anonymous_6) -FN:72,(anonymous_7) -FN:73,(anonymous_8) -FN:83,(anonymous_9) -FN:93,(anonymous_10) -FN:109,(anonymous_11) -FNF:12 +FN:60,(anonymous_2) +FN:63,(anonymous_3) +FN:66,(anonymous_4) +FN:67,(anonymous_5) +FN:68,(anonymous_6) +FN:77,(anonymous_7) +FN:79,(anonymous_8) +FN:80,(anonymous_9) +FN:81,(anonymous_10) +FN:91,(anonymous_11) +FN:101,(anonymous_12) +FN:117,(anonymous_13) +FNF:14 FNH:0 FNDA:0,chart FNDA:0,(anonymous_1) @@ -806,48 +841,52 @@ FNDA:0,(anonymous_8) FNDA:0,(anonymous_9) FNDA:0,(anonymous_10) FNDA:0,(anonymous_11) +FNDA:0,(anonymous_12) +FNDA:0,(anonymous_13) DA:9,1 DA:19,1 DA:24,0 DA:29,0 DA:54,0 DA:55,0 -DA:58,0 -DA:59,0 -DA:60,0 DA:61,0 +DA:64,0 +DA:66,0 +DA:67,0 +DA:68,0 DA:69,0 -DA:70,0 -DA:71,0 -DA:72,0 -DA:73,0 -DA:74,0 -DA:83,0 -DA:84,0 -DA:85,0 +DA:77,0 +DA:78,0 +DA:79,0 +DA:80,0 +DA:81,0 +DA:82,0 +DA:91,0 +DA:92,0 DA:93,0 -DA:94,0 -DA:97,0 -DA:100,0 -DA:109,0 -DA:110,0 -DA:111,0 -DA:112,0 -DA:113,0 -DA:114,0 -DA:115,0 -DA:116,0 +DA:101,0 +DA:102,0 +DA:105,0 +DA:108,0 DA:117,0 +DA:118,0 DA:119,0 +DA:120,0 +DA:121,0 +DA:122,0 DA:123,0 +DA:124,0 DA:125,0 DA:127,0 -DA:128,0 -DA:129,0 -DA:130,0 DA:131,0 DA:133,0 -LF:41 +DA:135,0 +DA:136,0 +DA:137,0 +DA:138,0 +DA:139,0 +DA:141,0 +LF:43 LH:2 BRF:0 BRH:0 @@ -863,16 +902,16 @@ BRH:0 end_of_record TN: SF:/Users/briangreig/workspace/http/v-chart-plugin/src/components/chartExample.vue -FN:47,(anonymous_0) -FN:55,(anonymous_1) +FN:53,(anonymous_0) +FN:61,(anonymous_1) FNF:2 FNH:0 FNDA:0,(anonymous_0) FNDA:0,(anonymous_1) -DA:48,0 -DA:56,0 -DA:57,0 -DA:61,0 +DA:54,0 +DA:62,0 +DA:63,0 +DA:67,0 LF:4 LH:0 BRF:0 @@ -896,3 +935,93 @@ LH:0 BRF:0 BRH:0 end_of_record +TN: +SF:/Users/briangreig/workspace/http/v-chart-plugin/src/import/boxPlot.js +FN:24,chart +FN:55,(anonymous_1) +FN:63,(anonymous_2) +FN:65,(anonymous_3) +FN:74,(anonymous_4) +FN:76,(anonymous_5) +FN:83,(anonymous_6) +FN:85,(anonymous_7) +FN:92,(anonymous_8) +FN:94,(anonymous_9) +FN:101,(anonymous_10) +FN:103,(anonymous_11) +FN:110,(anonymous_12) +FN:112,(anonymous_13) +FN:122,(anonymous_14) +FN:132,(anonymous_15) +FN:141,(anonymous_16) +FN:151,(anonymous_17) +FNF:18 +FNH:0 +FNDA:0,chart +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,(anonymous_9) +FNDA:0,(anonymous_10) +FNDA:0,(anonymous_11) +FNDA:0,(anonymous_12) +FNDA:0,(anonymous_13) +FNDA:0,(anonymous_14) +FNDA:0,(anonymous_15) +FNDA:0,(anonymous_16) +FNDA:0,(anonymous_17) +DA:13,1 +DA:24,1 +DA:29,0 +DA:34,0 +DA:55,0 +DA:56,0 +DA:63,0 +DA:65,0 +DA:67,0 +DA:69,0 +DA:74,0 +DA:76,0 +DA:78,0 +DA:83,0 +DA:85,0 +DA:87,0 +DA:92,0 +DA:94,0 +DA:96,0 +DA:101,0 +DA:103,0 +DA:105,0 +DA:110,0 +DA:112,0 +DA:114,0 +DA:122,0 +DA:123,0 +DA:124,0 +DA:132,0 +DA:133,0 +DA:134,0 +DA:141,0 +DA:142,0 +DA:151,0 +DA:155,0 +DA:156,0 +DA:164,0 +DA:165,0 +DA:167,0 +DA:168,0 +DA:169,0 +DA:170,0 +DA:171,0 +DA:172,0 +DA:174,0 +LF:45 +LH:2 +BRF:0 +BRH:0 +end_of_record From 5251424e7381e05ef696a473548021412bd4ad00 Mon Sep 17 00:00:00 2001 From: Brian Greig Date: Fri, 7 Dec 2018 21:36:03 -0500 Subject: [PATCH 7/7] readme updates --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 89de879..ed89eeb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@

- version