@@ -400,10 +400,10 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
400
400
if hover_is_dict and not attr_value [col ]:
401
401
continue
402
402
if col in [
403
- args .get ("x" , None ),
404
- args .get ("y" , None ),
405
- args .get ("z" , None ),
406
- args .get ("base" , None ),
403
+ args .get ("x" ),
404
+ args .get ("y" ),
405
+ args .get ("z" ),
406
+ args .get ("base" ),
407
407
]:
408
408
continue
409
409
try :
@@ -1286,8 +1286,8 @@ def build_dataframe(args, constructor):
1286
1286
1287
1287
# now we handle special cases like wide-mode or x-xor-y specification
1288
1288
# by rearranging args to tee things up for process_args_into_dataframe to work
1289
- no_x = args .get ("x" , None ) is None
1290
- no_y = args .get ("y" , None ) is None
1289
+ no_x = args .get ("x" ) is None
1290
+ no_y = args .get ("y" ) is None
1291
1291
wide_x = False if no_x else _is_col_list (df_input , args ["x" ])
1292
1292
wide_y = False if no_y else _is_col_list (df_input , args ["y" ])
1293
1293
@@ -1314,9 +1314,9 @@ def build_dataframe(args, constructor):
1314
1314
if var_name in [None , "value" , "index" ] or var_name in df_input :
1315
1315
var_name = "variable"
1316
1316
if constructor == go .Funnel :
1317
- wide_orientation = args .get ("orientation" , None ) or "h"
1317
+ wide_orientation = args .get ("orientation" ) or "h"
1318
1318
else :
1319
- wide_orientation = args .get ("orientation" , None ) or "v"
1319
+ wide_orientation = args .get ("orientation" ) or "v"
1320
1320
args ["orientation" ] = wide_orientation
1321
1321
args ["wide_cross" ] = None
1322
1322
elif wide_x != wide_y :
@@ -1347,7 +1347,7 @@ def build_dataframe(args, constructor):
1347
1347
if constructor in [go .Scatter , go .Bar , go .Funnel ] + hist2d_types :
1348
1348
if not wide_mode and (no_x != no_y ):
1349
1349
for ax in ["x" , "y" ]:
1350
- if args .get (ax , None ) is None :
1350
+ if args .get (ax ) is None :
1351
1351
args [ax ] = df_input .index if df_provided else Range ()
1352
1352
if constructor == go .Bar :
1353
1353
missing_bar_dim = ax
@@ -1371,7 +1371,7 @@ def build_dataframe(args, constructor):
1371
1371
)
1372
1372
1373
1373
no_color = False
1374
- if type (args .get ("color" , None )) == str and args ["color" ] == NO_COLOR :
1374
+ if type (args .get ("color" )) == str and args ["color" ] == NO_COLOR :
1375
1375
no_color = True
1376
1376
args ["color" ] = None
1377
1377
# now that things have been prepped, we do the systematic rewriting of `args`
@@ -1787,17 +1787,17 @@ def infer_config(args, constructor, trace_patch, layout_patch):
1787
1787
args [other_position ] = None
1788
1788
1789
1789
# If both marginals and faceting are specified, faceting wins
1790
- if args .get ("facet_col" , None ) is not None and args .get ("marginal_y" , None ) :
1790
+ if args .get ("facet_col" ) is not None and args .get ("marginal_y" ) is not None :
1791
1791
args ["marginal_y" ] = None
1792
1792
1793
- if args .get ("facet_row" , None ) is not None and args .get ("marginal_x" , None ) :
1793
+ if args .get ("facet_row" ) is not None and args .get ("marginal_x" ) is not None :
1794
1794
args ["marginal_x" ] = None
1795
1795
1796
1796
# facet_col_wrap only works if no marginals or row faceting is used
1797
1797
if (
1798
- args .get ("marginal_x" , None ) is not None
1799
- or args .get ("marginal_y" , None ) is not None
1800
- or args .get ("facet_row" , None ) is not None
1798
+ args .get ("marginal_x" ) is not None
1799
+ or args .get ("marginal_y" ) is not None
1800
+ or args .get ("facet_row" ) is not None
1801
1801
):
1802
1802
args ["facet_col_wrap" ] = 0
1803
1803
@@ -1984,7 +1984,7 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
1984
1984
row = m .val_map [val ]
1985
1985
else :
1986
1986
if (
1987
- args .get ("marginal_x" , None ) is not None # there is a marginal
1987
+ args .get ("marginal_x" ) is not None # there is a marginal
1988
1988
and trace_spec .marginal != "x" # and we're not it
1989
1989
):
1990
1990
row = 2
@@ -2068,10 +2068,10 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
2068
2068
nrows = math .ceil (ncols / facet_col_wrap )
2069
2069
ncols = min (ncols , facet_col_wrap )
2070
2070
2071
- if args .get ("marginal_x" , None ) is not None :
2071
+ if args .get ("marginal_x" ) is not None :
2072
2072
nrows += 1
2073
2073
2074
- if args .get ("marginal_y" , None ) is not None :
2074
+ if args .get ("marginal_y" ) is not None :
2075
2075
ncols += 1
2076
2076
2077
2077
fig = init_figure (
@@ -2118,7 +2118,7 @@ def init_figure(args, subplot_type, frame_list, nrows, ncols, col_labels, row_la
2118
2118
2119
2119
# Build column_widths/row_heights
2120
2120
if subplot_type == "xy" :
2121
- if args .get ("marginal_x" , None ) is not None :
2121
+ if args .get ("marginal_x" ) is not None :
2122
2122
if args ["marginal_x" ] == "histogram" or ("color" in args and args ["color" ]):
2123
2123
main_size = 0.74
2124
2124
else :
@@ -2127,11 +2127,11 @@ def init_figure(args, subplot_type, frame_list, nrows, ncols, col_labels, row_la
2127
2127
row_heights = [main_size ] * (nrows - 1 ) + [1 - main_size ]
2128
2128
vertical_spacing = 0.01
2129
2129
elif facet_col_wrap :
2130
- vertical_spacing = args .get ("facet_row_spacing" , None ) or 0.07
2130
+ vertical_spacing = args .get ("facet_row_spacing" ) or 0.07
2131
2131
else :
2132
- vertical_spacing = args .get ("facet_row_spacing" , None ) or 0.03
2132
+ vertical_spacing = args .get ("facet_row_spacing" ) or 0.03
2133
2133
2134
- if args .get ("marginal_y" , None ) is not None :
2134
+ if args .get ("marginal_y" ) is not None :
2135
2135
if args ["marginal_y" ] == "histogram" or ("color" in args and args ["color" ]):
2136
2136
main_size = 0.74
2137
2137
else :
@@ -2140,18 +2140,18 @@ def init_figure(args, subplot_type, frame_list, nrows, ncols, col_labels, row_la
2140
2140
column_widths = [main_size ] * (ncols - 1 ) + [1 - main_size ]
2141
2141
horizontal_spacing = 0.005
2142
2142
else :
2143
- horizontal_spacing = args .get ("facet_col_spacing" , None ) or 0.02
2143
+ horizontal_spacing = args .get ("facet_col_spacing" ) or 0.02
2144
2144
else :
2145
2145
# Other subplot types:
2146
2146
# 'scene', 'geo', 'polar', 'ternary', 'mapbox', 'domain', None
2147
2147
#
2148
2148
# We can customize subplot spacing per type once we enable faceting
2149
2149
# for all plot types
2150
2150
if facet_col_wrap :
2151
- vertical_spacing = args .get ("facet_row_spacing" , None ) or 0.07
2151
+ vertical_spacing = args .get ("facet_row_spacing" ) or 0.07
2152
2152
else :
2153
- vertical_spacing = args .get ("facet_row_spacing" , None ) or 0.03
2154
- horizontal_spacing = args .get ("facet_col_spacing" , None ) or 0.02
2153
+ vertical_spacing = args .get ("facet_row_spacing" ) or 0.03
2154
+ horizontal_spacing = args .get ("facet_col_spacing" ) or 0.02
2155
2155
2156
2156
if facet_col_wrap :
2157
2157
subplot_labels = [None ] * nrows * ncols
0 commit comments