Skip to content

Commit 4171a69

Browse files
Merge pull request #111 from ignoreintuition/development
Update Docs
2 parents f13b102 + dd2024c commit 4171a69

22 files changed

+929
-623
lines changed

docs/Chart.html

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSDoc: Namespace: Chart</title>
6+
7+
<script src="scripts/prettify/prettify.js"> </script>
8+
<script src="scripts/prettify/lang-css.js"> </script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14+
</head>
15+
16+
<body>
17+
18+
<div id="main">
19+
20+
<h1 class="page-title">Namespace: Chart</h1>
21+
22+
23+
24+
25+
26+
27+
<section>
28+
29+
<header>
30+
31+
<h2>Chart</h2>
32+
33+
34+
</header>
35+
36+
<article>
37+
<div class="container-overview">
38+
39+
40+
<div class="description">Chart is the generic component used for any chart type</div>
41+
42+
43+
44+
45+
46+
<dl class="details">
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+
<dt class="tag-source">Source:</dt>
74+
<dd class="tag-source"><ul class="dummy"><li>
75+
<a href="v-chart-plugin.js.html">v-chart-plugin.js</a>, <a href="v-chart-plugin.js.html#line25">line 25</a>
76+
</li></ul></dd>
77+
78+
79+
80+
81+
82+
83+
84+
</dl>
85+
86+
87+
88+
89+
</div>
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
110+
</article>
111+
112+
</section>
113+
114+
115+
116+
117+
</div>
118+
119+
<nav>
120+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-areaChart.html">areaChart</a></li><li><a href="module-barChart.html">barChart</a></li><li><a href="module-lineGraph.html">lineGraph</a></li><li><a href="module-pieChart.html">pieChart</a></li><li><a href="module-scatterPlot.html">scatterPlot</a></li><li><a href="module-vBarChart.html">vBarChart</a></li></ul><h3>Namespaces</h3><ul><li><a href="Chart.html">Chart</a></li></ul>
121+
</nav>
122+
123+
<br class="clear">
124+
125+
<footer>
126+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Oct 31 2018 22:03:17 GMT-0400 (EDT)
127+
</footer>
128+
129+
<script> prettyPrint(); </script>
130+
<script src="scripts/linenumber.js"> </script>
131+
</body>
132+
</html>

docs/import_areaChart.js.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ <h1 class="page-title">Source: import/areaChart.js</h1>
106106
const buildScales = () => {
107107
cs.y.scale = d3.scaleLinear()
108108
.domain([0, this.max])
109-
.range([this.height - cs.x.axisHeight, this.titleHeight]);
109+
.range([this.displayHeight - cs.x.axisHeight, this.titleHeight]);
110110
cs.y.axis = d3.axisLeft().ticks(10, 's').scale(cs.y.scale);
111111
this.ds.forEach(t => cs.x.domain.push(t.dim));
112112
this.ds.forEach((t, i) => cs.x.range.push((((
@@ -123,7 +123,7 @@ <h1 class="page-title">Source: import/areaChart.js</h1>
123123
.x(d => cs.x.scale(d.dim) + cs.y.axisWidth + 5)
124124
.y(d => cs.y.scale(d.metric));
125125
cs.x.xOffset = cs.y.axisWidth + 5;
126-
cs.x.yOffset = this.height - cs.x.axisHeight;
126+
cs.x.yOffset = this.displayHeight - cs.x.axisHeight;
127127
cs.y.xOffset = cs.y.axisWidth;
128128
cs.y.yOffset = 0;
129129
svgContainer.append('g').append('g')
@@ -134,12 +134,14 @@ <h1 class="page-title">Source: import/areaChart.js</h1>
134134
.attr('transform', `translate(${cs.y.xOffset},${cs.y.yOffset})`)
135135
.call(cs.y.axis);
136136
};
137-
cs = this.setOverrides(cs, this.chartData.overrides);
137+
cs = this.setOverrides(cs, this.chartData.overrides);
138138
buildScales(cs);
139139
drawAxis(cs);
140140
enter(poly);
141141
transition(poly);
142142
exit(poly);
143+
144+
return cs;
143145
};
144146

145147
export default areaChart;
@@ -153,13 +155,13 @@ <h1 class="page-title">Source: import/areaChart.js</h1>
153155
</div>
154156

155157
<nav>
156-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-areaChart.html">areaChart</a></li><li><a href="module-barChart.html">barChart</a></li><li><a href="module-lineGraph.html">lineGraph</a></li><li><a href="module-pieChart.html">pieChart</a></li><li><a href="module-scatterPlot.html">scatterPlot</a></li><li><a href="module-v-chart-plugin-module.html">v-chart-plugin-module</a></li><li><a href="module-vBarChart.html">vBarChart</a></li></ul>
158+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-areaChart.html">areaChart</a></li><li><a href="module-barChart.html">barChart</a></li><li><a href="module-lineGraph.html">lineGraph</a></li><li><a href="module-pieChart.html">pieChart</a></li><li><a href="module-scatterPlot.html">scatterPlot</a></li><li><a href="module-vBarChart.html">vBarChart</a></li></ul><h3>Namespaces</h3><ul><li><a href="Chart.html">Chart</a></li></ul>
157159
</nav>
158160

159161
<br class="clear">
160162

161163
<footer>
162-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Oct 30 2018 22:19:35 GMT-0400 (EDT)
164+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Oct 31 2018 22:03:17 GMT-0400 (EDT)
163165
</footer>
164166

165167
<script> prettyPrint(); </script>

docs/import_barChart.js.html

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ <h1 class="page-title">Source: import/barChart.js</h1>
3535
/**
3636
* Builds a Bar Chart.
3737
* @constructor
38-
* @param {String} mode (init / refresh)
3938
* @exports barChart
4039
*/
4140

@@ -61,52 +60,51 @@ <h1 class="page-title">Source: import/barChart.js</h1>
6160
},
6261
};
6362

64-
6563
/**
66-
* @method getWidth
67-
* @param {Object} d (svg element)
68-
* @description Returns width of the bar
69-
*/
64+
* @method getWidth
65+
* @param {Object} d (svg element)
66+
* @description Returns width of the bar
67+
*/
7068
const getWidth = d => cs.x.scale(d.metric);
7169

72-
/**
73-
* @method getHeight
74-
* @description Returns height of the bar
75-
*/
70+
/**
71+
* @method getHeight
72+
* @description Returns height of the bar
73+
*/
7674
const getHeight = () => (
77-
this.height - cs.x.axisHeight - this.header - cs.bar.vPadding) / this.ds.length - 1;
75+
this.displayHeight - cs.x.axisHeight - this.header - cs.bar.vPadding) / this.ds.length - 1;
7876

7977
/**
80-
* @method getYCoord
81-
* @param {Object} d (svg element)
82-
* @param {Object} i (svg element)
83-
* @description Returns y axis co-ordinate of the bar
84-
*/
78+
* @method getYCoord
79+
* @param {Object} d (svg element)
80+
* @param {Object} i (svg element)
81+
* @description Returns y axis co-ordinate of the bar
82+
*/
8583
const getYCoord = (d, i) => i * (
86-
this.height - cs.x.axisHeight - this.header) / this.ds.length + 1 + this.header;
84+
this.displayHeight - cs.x.axisHeight - this.header) / this.ds.length + 1 + this.header;
8785

8886
/**
89-
* @method mouseOver
90-
* @param {Object} d (svg element)
91-
* @description Adds a tooltip on mouse over
92-
*/
87+
* @method mouseOver
88+
* @param {Object} d (svg element)
89+
* @description Adds a tooltip on mouse over
90+
*/
9391
const mouseOver = (d) => {
9492
this.addTooltip(d, window.event);
9593
};
9694

9795
/**
98-
* @method mouseOut
99-
* @param {Object} d (svg element)
100-
* @description Removes tooltip on mouse out
101-
*/
96+
* @method mouseOut
97+
* @param {Object} d (svg element)
98+
* @description Removes tooltip on mouse out
99+
*/
102100
const mouseOut = (d) => {
103101
this.removeTooltip(d);
104102
};
105-
/**
106-
* @method enter
107-
* @param {Object} rects (svg element)
108-
* @description Runs when a new element is added to the dataset
109-
*/
103+
/**
104+
* @method enter
105+
* @param {Object} rects (svg element)
106+
* @description Runs when a new element is added to the dataset
107+
*/
110108
const enter = (rects) => {
111109
rects.enter()
112110
.append('rect')
@@ -121,11 +119,11 @@ <h1 class="page-title">Source: import/barChart.js</h1>
121119
.on('mouseout', mouseOut);
122120
return rects;
123121
};
124-
/**
125-
* @method transition
126-
* @param {Object} rects (svg element)
127-
* @description Runs when a value of an element in dataset is changed
128-
*/
122+
/**
123+
* @method transition
124+
* @param {Object} rects (svg element)
125+
* @description Runs when a value of an element in dataset is changed
126+
*/
129127
const transition = (rects) => {
130128
rects.transition()
131129
.attr('width', getWidth)
@@ -134,59 +132,66 @@ <h1 class="page-title">Source: import/barChart.js</h1>
134132
.attr('x', cs.y.axisWidth + cs.bar.hPadding);
135133
return rects;
136134
};
137-
/**
138-
* @method exit
139-
* @param {Object} rect (svg element)
140-
* @description Runs when an element is removed from the dataset
141-
*/
135+
/**
136+
* @method exit
137+
* @param {Object} rect (svg element)
138+
* @description Runs when an element is removed from the dataset
139+
*/
142140
const exit = (rects) => {
143141
rects.exit().remove();
144142
return rects;
145143
};
146-
/**
147-
* @method buildScales
148-
* @description builds the scales for the x and y axes
149-
*/
144+
/**
145+
* @method buildScales
146+
* @description builds the scales for the x and y axes
147+
*/
150148
const buildScales = () => {
151149
cs.x.scale = d3.scaleLinear()
152150
.domain([0, this.max])
153151
.range([0, this.width - cs.bar.hPadding - cs.y.axisWidth]);
154152
this.ds.forEach(t => cs.y.domain.push(t.dim));
155153
this.ds.forEach((t, i) => cs.y.range.push(((
156-
this.chartData.height - cs.x.axisHeight - this.header + cs.bar.vPadding) * i) / this.ds.length));
154+
this.displayHeight - cs.x.axisHeight - this.header + cs.bar.vPadding) * i) / this.ds.length));
157155
cs.y.scale = d3.scaleOrdinal().domain(cs.y.domain).range(cs.y.range);
158156
};
159-
/**
160-
* @method drawAxis
161-
* @description draws the x and y axes on the svg
162-
*/
157+
/**
158+
* @method drawAxis
159+
* @description draws the x and y axes on the svg
160+
*/
163161
const drawAxis = () => {
164162
cs.x.axis = d3.axisBottom().ticks(cs.x.ticks, 's').scale(cs.x.scale);
165163
cs.y.axis = d3.axisLeft().scale(cs.y.scale);
166-
cs.x.yOffset = this.height - cs.x.axisHeight;
164+
cs.x.yOffset = this.displayHeight - cs.x.axisHeight;
167165
cs.x.xOffset = cs.bar.hPadding + cs.y.axisWidth;
168166
cs.y.yOffset = cs.bar.vPadding + this.header - 1;
169167
cs.y.xOffset = cs.y.axisWidth;
170168
if (this.ds[0].dim)
171169
svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.y.xOffset}, ${cs.y.yOffset})`).call(cs.y.axis);
172170
svgContainer.append('g').attr('class', 'axis').attr('transform', `translate(${cs.x.xOffset}, ${cs.x.yOffset})`).call(cs.x.axis);
173171
};
174-
172+
/**
173+
* @method getMaxDimLength
174+
* @param {number} accumulator
175+
* @param {number} currentValue
176+
* @description get the maximum dimension length
177+
*/
175178
const getMaxDimLength = (accumulator, currentValue) => {
176179
return (currentValue.dim.length > accumulator) ? currentValue.dim.length : accumulator;
177180
}
178181

179182
const rects = svgContainer.selectAll('rect').data(this.ds);
180183

181-
cs = this.setOverrides(cs, this.chartData.overrides);
184+
cs = this.setOverrides(cs, this.chartData.overrides);
182185
if (this.ds[0].dim)
183186
cs.y.axisWidth = cs.y.axisWidth || (this.ds.reduce(getMaxDimLength, 0)) * 10;
184-
187+
185188
buildScales(cs);
186189
drawAxis(cs);
187190
enter(rects);
188191
transition(rects);
189192
exit(rects);
193+
194+
return cs;
190195
};
191196

192197
export default barChart;
@@ -200,13 +205,13 @@ <h1 class="page-title">Source: import/barChart.js</h1>
200205
</div>
201206

202207
<nav>
203-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-areaChart.html">areaChart</a></li><li><a href="module-barChart.html">barChart</a></li><li><a href="module-lineGraph.html">lineGraph</a></li><li><a href="module-pieChart.html">pieChart</a></li><li><a href="module-scatterPlot.html">scatterPlot</a></li><li><a href="module-v-chart-plugin-module.html">v-chart-plugin-module</a></li><li><a href="module-vBarChart.html">vBarChart</a></li></ul>
208+
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-areaChart.html">areaChart</a></li><li><a href="module-barChart.html">barChart</a></li><li><a href="module-lineGraph.html">lineGraph</a></li><li><a href="module-pieChart.html">pieChart</a></li><li><a href="module-scatterPlot.html">scatterPlot</a></li><li><a href="module-vBarChart.html">vBarChart</a></li></ul><h3>Namespaces</h3><ul><li><a href="Chart.html">Chart</a></li></ul>
204209
</nav>
205210

206211
<br class="clear">
207212

208213
<footer>
209-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Oct 30 2018 22:19:35 GMT-0400 (EDT)
214+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Oct 31 2018 22:03:17 GMT-0400 (EDT)
210215
</footer>
211216

212217
<script> prettyPrint(); </script>

0 commit comments

Comments
 (0)