29
29
]
30
30
31
31
32
- def set_all_colorbars (template , colorbar ):
33
- for parent_path in colorscale_parent_paths :
34
- if not template .data [parent_path [0 ]]:
35
- template .data [parent_path [0 ]] = [{}]
36
-
37
- for trace in template .data [parent_path [0 ]]:
38
- parent = trace [parent_path [1 :]]
39
-
40
- if "colorbar" in parent :
41
- parent .colorbar = colorbar
42
-
43
-
44
32
def initialize_template (
45
33
annotation_defaults ,
46
34
axis_common ,
@@ -82,10 +70,11 @@ def initialize_template(
82
70
template .layout .plot_bgcolor = panel_background_clr
83
71
template .layout .polar .bgcolor = panel_background_clr
84
72
template .layout .ternary .bgcolor = panel_background_clr
85
- set_all_colorbars ( template , colorbar_common )
73
+
86
74
cartesian_axis = dict (axis_common , zerolinecolor = zerolinecolor_clr )
87
75
88
76
# Colorscales
77
+ template .layout .coloraxis .colorbar = colorbar_common
89
78
template .layout .colorscale .sequential = colorscale
90
79
if colorscale_minus is not None :
91
80
template .layout .colorscale .sequentialminus = colorscale_minus
@@ -95,13 +84,6 @@ def initialize_template(
95
84
if colorscale_diverging is not None :
96
85
template .layout .colorscale .diverging = colorscale_diverging
97
86
98
- template .data .heatmap [0 ].colorscale = colorscale
99
- template .data .histogram2d [0 ].colorscale = colorscale
100
- template .data .histogram2dcontour [0 ].colorscale = colorscale
101
- template .data .contour [0 ].colorscale = colorscale
102
- template .data .surface [0 ].colorscale = colorscale
103
- template .data .heatmapgl [0 ].colorscale = colorscale
104
-
105
87
# Cartesian
106
88
template .layout .xaxis = cartesian_axis
107
89
template .layout .yaxis = cartesian_axis
0 commit comments