aboutsummaryrefslogtreecommitdiff
path: root/doc/README.md
blob: 495c624ee4e0be80608b338fca82b0299dec3a83 (plain)
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
## 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) |