]>
Commit | Line | Data |
---|---|---|
1 | ## Classes | |
2 | ||
3 | <dl> | |
4 | <dt><a href="#StatusComponent">StatusComponent</a></dt> | |
5 | <dd></dd> | |
6 | <dt><a href="#WaveRenderer">WaveRenderer</a></dt> | |
7 | <dd></dd> | |
8 | <dt><a href="#DataService">DataService</a></dt> | |
9 | <dd></dd> | |
10 | <dt><a href="#SortingHat">SortingHat</a></dt> | |
11 | <dd></dd> | |
12 | </dl> | |
13 | ||
14 | ## Typedefs | |
15 | ||
16 | <dl> | |
17 | <dt><a href="#tSortingHatData">tSortingHatData</a> : <code>object</code></dt> | |
18 | <dd><p>The data structure representing the sorting hat data</p> | |
19 | </dd> | |
20 | <dt><a href="#tRunningAverages">tRunningAverages</a> : <code>object</code></dt> | |
21 | <dd><p>The running averages, including the current sum and count</p> | |
22 | </dd> | |
23 | </dl> | |
24 | ||
25 | <a name="StatusComponent"></a> | |
26 | ||
27 | ## StatusComponent | |
28 | **Kind**: global class | |
29 | <a name="new_StatusComponent_new"></a> | |
30 | ||
31 | ### new StatusComponent() | |
32 | The status class, renders the winner during the poll stage, and a | |
33 | message while waiting | |
34 | ||
35 | <a name="WaveRenderer"></a> | |
36 | ||
37 | ## WaveRenderer | |
38 | **Kind**: global class | |
39 | <a name="new_WaveRenderer_new"></a> | |
40 | ||
41 | ### new WaveRenderer() | |
42 | The wave renderer, draws some waves in a canvas to represent a set of | |
43 | cateogirzed averages | |
44 | ||
45 | <a name="DataService"></a> | |
46 | ||
47 | ## DataService | |
48 | **Kind**: global class | |
49 | ||
50 | * [DataService](#DataService) | |
51 | * [new DataService()](#new_DataService_new) | |
52 | * [.data()](#DataService.data) ⇒ | |
53 | ||
54 | <a name="new_DataService_new"></a> | |
55 | ||
56 | ### new DataService() | |
57 | The main data service, connects to a socket and updates the internal | |
58 | data structure | |
59 | ||
60 | <a name="DataService.data"></a> | |
61 | ||
62 | ### DataService.data() ⇒ | |
63 | Returns the internal data structure, intended to be used as the data | |
64 | property in vue components | |
65 | ||
66 | **Kind**: static method of [<code>DataService</code>](#DataService) | |
67 | **Returns**: tSortingHatData | |
68 | <a name="SortingHat"></a> | |
69 | ||
70 | ## SortingHat | |
71 | **Kind**: global class | |
72 | <a name="new_SortingHat_new"></a> | |
73 | ||
74 | ### new SortingHat() | |
75 | The main vue application, it is composed by the other components, no real | |
76 | logic otherwise | |
77 | ||
78 | <a name="tSortingHatData"></a> | |
79 | ||
80 | ## tSortingHatData : <code>object</code> | |
81 | The data structure representing the sorting hat data | |
82 | ||
83 | **Kind**: global typedef | |
84 | ||
85 | | Param | Type | Description | | |
86 | | --- | --- | --- | | |
87 | | state | <code>number</code> | the current state: 0 for waiting, 1 for polling, 2 for cool down. | | |
88 | | [winner] | <code>string</code> | the winner after polling, might be null if no winner is detected | | |
89 | | runningAverages | <code>Object.<string, tRunningAverages></code> | the running averages for the different categories, used to render the waves | | |
90 | ||
91 | <a name="tRunningAverages"></a> | |
92 | ||
93 | ## tRunningAverages : <code>object</code> | |
94 | The running averages, including the current sum and count | |
95 | ||
96 | **Kind**: global typedef | |
97 | ||
98 | | Param | Type | Description | | |
99 | | --- | --- | --- | | |
100 | | sum | <code>number</code> | the current total | | |
101 | | count | <code>number</code> | the number of samples | | |
102 | | average | <code>number</code> | the average (sum / count) | | |
103 |