1 # Template for UIState (Currently supports only colors)
9 def generate(dash_config, viz_config):
13 # Check for 'color' key in 'series' or 'seriesParams' in
14 # either viz_config and dash_config
16 # Note:- 'series' simplifies 'seriesParams' and 'aggs'
17 # and avoids duplication
20 series = dash_config['y-axis']['series']
21 for _, value in series.items():
23 colors[value['label']] = value['color']
30 series = viz_config['series']
31 for _, value in series.items():
33 colors[value['label']] = value['color']
40 seriesParams = dash_config['y-axis']['seriesParams']
41 for _, value in seriesParams.items():
43 colors[value['label']] = value['color']
50 seriesParams = viz_config['seriesParams']
51 for _, value in seriesParams.items():
53 colors[value['label']] = value['color']
59 UI_STATE_BODY['vis']['colors'] = colors