X-Git-Url: https://git.r.bdr.sh/rbdr/sorting-hat-renderer/blobdiff_plain/4b3d812031dd07c251623d7155159115e99d2671..21f11b5ae525f52fd1a2bf1a741ad79bfccb1278:/doc/README.md?ds=inline diff --git a/doc/README.md b/doc/README.md index e69de29..495c624 100644 --- a/doc/README.md +++ b/doc/README.md @@ -0,0 +1,103 @@ +## Classes + +
+
StatusComponent
+
+
WaveRenderer
+
+
DataService
+
+
SortingHat
+
+
+ +## Typedefs + +
+
tSortingHatData : object
+

The data structure representing the sorting hat data

+
+
tRunningAverages : object
+

The running averages, including the current sum and count

+
+
+ + + +## StatusComponent +**Kind**: global class + + +### new StatusComponent() +The status class, renders the winner during the poll stage, and a +message while waiting + + + +## WaveRenderer +**Kind**: global class + + +### new WaveRenderer() +The wave renderer, draws some waves in a canvas to represent a set of +cateogirzed averages + + + +## DataService +**Kind**: global class + +* [DataService](#DataService) + * [new DataService()](#new_DataService_new) + * [.data()](#DataService.data) ⇒ + + + +### new DataService() +The main data service, connects to a socket and updates the internal +data structure + + + +### DataService.data() ⇒ +Returns the internal data structure, intended to be used as the data +property in vue components + +**Kind**: static method of [DataService](#DataService) +**Returns**: tSortingHatData + + +## SortingHat +**Kind**: global class + + +### new SortingHat() +The main vue application, it is composed by the other components, no real +logic otherwise + + + +## tSortingHatData : object +The data structure representing the sorting hat data + +**Kind**: global typedef + +| Param | Type | Description | +| --- | --- | --- | +| state | number | the current state: 0 for waiting, 1 for polling, 2 for cool down. | +| [winner] | string | the winner after polling, might be null if no winner is detected | +| runningAverages | Object.<string, tRunningAverages> | the running averages for the different categories, used to render the waves | + + + +## tRunningAverages : object +The running averages, including the current sum and count + +**Kind**: global typedef + +| Param | Type | Description | +| --- | --- | --- | +| sum | number | the current total | +| count | number | the number of samples | +| average | number | the average (sum / count) | +