File tree Expand file tree Collapse file tree 4 files changed +22
-16
lines changed
packages/python/plotly/plotly Expand file tree Collapse file tree 4 files changed +22
-16
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ def swatches():
18
18
"#EF553B" ,
19
19
"#00cc96" ,
20
20
"#ab63fa" ,
21
+ "#FFA15A" ,
21
22
"#19d3f3" ,
22
- "#e763fa" ,
23
- "#fecb52" ,
24
- "#ffa15a" ,
25
- "#ff6692" ,
26
- "#b6e880" ,
23
+ "#FF6692" ,
24
+ "#B6E880" ,
25
+ "#FF97FF" ,
26
+ "#FECB52" ,
27
27
]
28
28
29
29
D3 = [
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ def swatches():
105
105
PuBuGn ,
106
106
PuRd ,
107
107
Purples ,
108
+ RdBu ,
108
109
RdPu ,
109
110
Reds ,
110
111
YlGn ,
Original file line number Diff line number Diff line change @@ -659,19 +659,19 @@ def apply_default_cascade(args):
659
659
args ["color_continuous_scale" ] = [
660
660
x [1 ] for x in template .layout .colorscale .sequential
661
661
]
662
- except AttributeError :
662
+ except ( AttributeError , TypeError ) :
663
663
pass
664
664
if args ["color_continuous_scale" ] is None :
665
- args ["color_continuous_scale" ] = sequential .Plasma
665
+ args ["color_continuous_scale" ] = sequential .Viridis
666
666
667
667
if "color_discrete_sequence" in args :
668
668
if args ["color_discrete_sequence" ] is None :
669
669
try :
670
670
args ["color_discrete_sequence" ] = template .layout .colorway
671
- except AttributeError :
671
+ except ( AttributeError , TypeError ) :
672
672
pass
673
673
if args ["color_discrete_sequence" ] is None :
674
- args ["color_discrete_sequence" ] = qualitative .Plotly
674
+ args ["color_discrete_sequence" ] = qualitative .D3
675
675
676
676
# If both marginals and faceting are specified, faceting wins
677
677
if args .get ("facet_col" , None ) and args .get ("marginal_y" , None ):
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ def __init__(self):
40
40
"plotly_dark" ,
41
41
"presentation" ,
42
42
"xgridoff" ,
43
+ "none" ,
43
44
]
44
45
45
46
for template_name in default_templates :
@@ -64,13 +65,17 @@ def __getitem__(self, item):
64
65
if template is Lazy :
65
66
from plotly .graph_objs .layout import Template
66
67
67
- # Load template from package data
68
- path = os .path .join ("package_data" , "templates" , item + ".json" )
69
- template_str = pkgutil .get_data ("plotly" , path ).decode ("utf-8" )
70
- template_dict = json .loads (template_str )
71
- template = Template (template_dict )
72
-
73
- self ._templates [item ] = template
68
+ if item == "none" :
69
+ # "none" is a special built-in named template that applied no defaults
70
+ self ._templates [item ] = Template ()
71
+ else :
72
+ # Load template from package data
73
+ path = os .path .join ("package_data" , "templates" , item + ".json" )
74
+ template_str = pkgutil .get_data ("plotly" , path ).decode ("utf-8" )
75
+ template_dict = json .loads (template_str )
76
+ template = Template (template_dict )
77
+
78
+ self ._templates [item ] = template
74
79
75
80
return template
76
81
You can’t perform that action at this time.
0 commit comments