]> git.r.bdr.sh - rbdr/sorting-hat-renderer/blobdiff - doc/README.md
Add jsdoc, fix linter
[rbdr/sorting-hat-renderer] / doc / README.md
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..495c624ee4e0be80608b338fca82b0299dec3a83 100644 (file)
@@ -0,0 +1,103 @@
+## Classes
+
+<dl>
+<dt><a href="#StatusComponent">StatusComponent</a></dt>
+<dd></dd>
+<dt><a href="#WaveRenderer">WaveRenderer</a></dt>
+<dd></dd>
+<dt><a href="#DataService">DataService</a></dt>
+<dd></dd>
+<dt><a href="#SortingHat">SortingHat</a></dt>
+<dd></dd>
+</dl>
+
+## Typedefs
+
+<dl>
+<dt><a href="#tSortingHatData">tSortingHatData</a> : <code>object</code></dt>
+<dd><p>The data structure representing the sorting hat data</p>
+</dd>
+<dt><a href="#tRunningAverages">tRunningAverages</a> : <code>object</code></dt>
+<dd><p>The running averages, including the current sum and count</p>
+</dd>
+</dl>
+
+<a name="StatusComponent"></a>
+
+## StatusComponent
+**Kind**: global class  
+<a name="new_StatusComponent_new"></a>
+
+### new StatusComponent()
+The status class, renders the winner during the poll stage, and a
+message while waiting
+
+<a name="WaveRenderer"></a>
+
+## WaveRenderer
+**Kind**: global class  
+<a name="new_WaveRenderer_new"></a>
+
+### new WaveRenderer()
+The wave renderer, draws some waves in a canvas to represent a set of
+cateogirzed averages
+
+<a name="DataService"></a>
+
+## DataService
+**Kind**: global class  
+
+* [DataService](#DataService)
+    * [new DataService()](#new_DataService_new)
+    * [.data()](#DataService.data) ⇒
+
+<a name="new_DataService_new"></a>
+
+### new DataService()
+The main data service, connects to a socket and updates the internal
+data structure
+
+<a name="DataService.data"></a>
+
+### DataService.data() ⇒
+Returns the internal data structure, intended to be used as the data
+property in vue components
+
+**Kind**: static method of [<code>DataService</code>](#DataService)  
+**Returns**: tSortingHatData  
+<a name="SortingHat"></a>
+
+## SortingHat
+**Kind**: global class  
+<a name="new_SortingHat_new"></a>
+
+### new SortingHat()
+The main vue application, it is composed by the other components, no real
+logic otherwise
+
+<a name="tSortingHatData"></a>
+
+## tSortingHatData : <code>object</code>
+The data structure representing the sorting hat data
+
+**Kind**: global typedef  
+
+| Param | Type | Description |
+| --- | --- | --- |
+| state | <code>number</code> | the current state: 0 for waiting, 1 for polling, 2 for cool down. |
+| [winner] | <code>string</code> | the winner after polling, might be null if no winner is detected |
+| runningAverages | <code>Object.&lt;string, tRunningAverages&gt;</code> | the running averages for the different categories, used to render the waves |
+
+<a name="tRunningAverages"></a>
+
+## tRunningAverages : <code>object</code>
+The running averages, including the current sum and count
+
+**Kind**: global typedef  
+
+| Param | Type | Description |
+| --- | --- | --- |
+| sum | <code>number</code> | the current total |
+| count | <code>number</code> | the number of samples |
+| average | <code>number</code> | the average (sum / count) |
+