@@ -424,14 +424,6 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
424
424
425
425
def configure_axes (args , constructor , fig , orders ):
426
426
configurators = {
427
- go .Scatter : configure_cartesian_axes ,
428
- go .Scattergl : configure_cartesian_axes ,
429
- go .Bar : configure_cartesian_axes ,
430
- go .Box : configure_cartesian_axes ,
431
- go .Violin : configure_cartesian_axes ,
432
- go .Histogram : configure_cartesian_axes ,
433
- go .Histogram2dContour : configure_cartesian_axes ,
434
- go .Histogram2d : configure_cartesian_axes ,
435
427
go .Scatter3d : configure_3d_axes ,
436
428
go .Scatterternary : configure_ternary_axes ,
437
429
go .Scatterpolar : configure_polar_axes ,
@@ -443,6 +435,10 @@ def configure_axes(args, constructor, fig, orders):
443
435
go .Scattergeo : configure_geo ,
444
436
go .Choropleth : configure_geo ,
445
437
}
438
+ cartesians = [go .Scatter , go .Scattergl , go .Bar , go .Funnel , go .Box , go .Violin ]
439
+ cartesians += [go .Histogram , go .Histogram2d , go .Histogram2dContour ]
440
+ for c in cartesians :
441
+ configurators [c ] = configure_cartesian_axes
446
442
if constructor in configurators :
447
443
configurators [constructor ](args , fig , orders )
448
444
@@ -1134,7 +1130,7 @@ def build_dataframe(args, constructor):
1134
1130
1135
1131
wide_mode = False
1136
1132
var_name = None
1137
- if constructor in [go .Scatter , go .Bar , go .Violin , go .Box , go .Histogram ]:
1133
+ if constructor in [go .Scatter , go .Bar , go .Violin , go .Box , go .Histogram , go . Funnel ]:
1138
1134
wide_cross_name = None
1139
1135
if wide_x and wide_y :
1140
1136
raise ValueError (
@@ -1144,7 +1140,10 @@ def build_dataframe(args, constructor):
1144
1140
wide_mode = True
1145
1141
args ["_column_" ] = list (df_input .columns )
1146
1142
var_name = df_input .columns .name or "_column_"
1147
- wide_orientation = args .get ("orientation" , None ) or "v"
1143
+ if constructor == go .Funnel :
1144
+ wide_orientation = args .get ("orientation" , None ) or "h"
1145
+ else :
1146
+ wide_orientation = args .get ("orientation" , None ) or "v"
1148
1147
args ["orientation" ] = wide_orientation
1149
1148
args ["wide_cross" ] = None
1150
1149
elif wide_x != wide_y :
@@ -1161,17 +1160,19 @@ def build_dataframe(args, constructor):
1161
1160
wide_cross_name = "__x__" if wide_y else "__y__"
1162
1161
1163
1162
missing_bar_dim = None
1164
- if constructor in [go .Scatter , go .Bar ]:
1163
+ if constructor in [go .Scatter , go .Bar , go . Funnel ]:
1165
1164
if not wide_mode and (no_x != no_y ):
1166
1165
for ax in ["x" , "y" ]:
1167
1166
if args .get (ax , None ) is None :
1168
1167
args [ax ] = df_input .index if df_provided else Range ()
1169
- if constructor == go .Scatter :
1170
- if args ["orientation" ] is None :
1171
- args ["orientation" ] = "v" if ax == "x" else "h"
1172
1168
if constructor == go .Bar :
1173
1169
missing_bar_dim = ax
1170
+ else :
1171
+ if args ["orientation" ] is None :
1172
+ args ["orientation" ] = "v" if ax == "x" else "h"
1174
1173
if wide_mode and wide_cross_name is None :
1174
+ if no_x != no_y and args ["orientation" ] is None :
1175
+ args ["orientation" ] = "v" if no_x else "h"
1175
1176
if df_provided :
1176
1177
args ["wide_cross" ] = df_input .index
1177
1178
wide_cross_name = df_input .index .name or "index"
@@ -1222,7 +1223,7 @@ def build_dataframe(args, constructor):
1222
1223
if wide_cross_name == "__y__" :
1223
1224
wide_cross_name = args ["y" ]
1224
1225
1225
- if constructor == go .Scatter :
1226
+ if constructor in [ go .Scatter , go . Funnel ] :
1226
1227
args ["x" if orient_v else "y" ] = wide_cross_name
1227
1228
args ["y" if orient_v else "x" ] = "_value_"
1228
1229
args ["color" ] = args ["color" ] or var_name
0 commit comments