Chart¶
-
class
awe.chart.Chart[source]¶ -
add(data)[source]¶ Add new data to a chart after it has been created.
Parameters: data – A list of data items. Each data item is expected to match the format the transformer expects. A data item may also be supplied in the form of a 2-tuple (or a list) of (time, data), in which case, the first item is the epoch time in seconds with ms precision and the second item is the data item itself.
-
set(data)[source]¶ Override existing chart data with new data.
Parameters: data – A list of data items. Each data item is expected to match the format the transformer expects. A data item may also be supplied in the form of a 2-tuple (or a list) of (time, data), in which case, the first item is the epoch time in seconds with ms precision and the second item is the data item itself.
-
transformer¶ Returns: The currently set transformer.
-
Chart Data Transformers¶
noop¶
numbers¶
flat¶
-
class
awe.chart.FlatDictTransformer(chart_mapping, series_mapping, value_key)[source]¶ A transformer that expects data items to be dictionaries.
key:
flatParameters: - chart_mapping – A list of keys to build charts from. (combinations of them)
- series_mapping – A list of keys to build chart series from. (combinations of them)
- value_key – The key to the value of the data item.
[Ns]to[Ms]¶
-
class
awe.chart.DictLevelsTransformer[source]¶ A transformer that handles nested dictionaries data items.
Usually instantiated by supplying a transform key in this format:
[chart levels]to[series levels].For example, a key of
23to1assumes a “3 level” nested dictionary where the charts will be generated from the different combinations of keys in the 2nd and 3rd levels and the series for each chart will be generated from each key in the 1st level.key:
[Ns]to[Ms]