1 # Template for UIState (Currently supports only colors)
2 UI_STATE_BODY = {"vis": {"colors": None}}
5 def generate(dash_config, viz_config):
9 # Check for 'color' key in 'series' or 'seriesParams' in
10 # either viz_config and dash_config
12 # Note:- 'series' simplifies 'seriesParams' and 'aggs'
13 # and avoids duplication
16 series = dash_config["y-axis"]["series"]
17 for _, value in series.items():
19 colors[value["label"]] = value["color"]
26 series = viz_config["series"]
27 for _, value in series.items():
29 colors[value["label"]] = value["color"]
36 seriesParams = dash_config["y-axis"]["seriesParams"]
37 for _, value in seriesParams.items():
39 colors[value["label"]] = value["color"]
46 seriesParams = viz_config["seriesParams"]
47 for _, value in seriesParams.items():
49 colors[value["label"]] = value["color"]
55 UI_STATE_BODY["vis"]["colors"] = colors