@@ -143,7 +143,7 @@ def _add_shapes_to_fig(fig, annot_rect_color):
143
143
def _facet_grid_color_categorical (df , x , y , facet_row , facet_col , color_name ,
144
144
colormap , title , height , width , num_of_rows ,
145
145
num_of_cols , facet_row_labels ,
146
- facet_col_labels , scattergl , ** kwargs ):
146
+ facet_col_labels , trace_type , ** kwargs ):
147
147
fig = make_subplots (rows = num_of_rows , cols = num_of_cols ,
148
148
shared_xaxes = True , shared_yaxes = True ,
149
149
horizontal_spacing = HORIZONTAL_SPACING ,
@@ -157,7 +157,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
157
157
x = group [1 ][x ].tolist (),
158
158
y = group [1 ][y ].tolist (),
159
159
mode = 'markers' ,
160
- type = 'scatter' + scattergl * 'gl' ,
160
+ type = trace_type ,
161
161
name = group [0 ],
162
162
marker = dict (
163
163
color = colormap [group [0 ]]
@@ -175,7 +175,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
175
175
x = data_by_color [x ].tolist (),
176
176
y = data_by_color [y ].tolist (),
177
177
mode = 'markers' ,
178
- type = 'scatter' + scattergl * 'gl' ,
178
+ type = trace_type ,
179
179
name = color_val ,
180
180
marker = dict (
181
181
color = colormap [color_val ]
@@ -200,7 +200,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
200
200
x = data_by_color [x ].tolist (),
201
201
y = data_by_color [y ].tolist (),
202
202
mode = 'markers' ,
203
- type = 'scatter' + scattergl * 'gl' ,
203
+ type = trace_type ,
204
204
name = color_val ,
205
205
marker = dict (
206
206
color = colormap [color_val ]
@@ -239,7 +239,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
239
239
x = group_filtered [x ].tolist (),
240
240
y = group_filtered [y ].tolist (),
241
241
mode = 'markers' ,
242
- type = 'scatter' + scattergl * 'gl' ,
242
+ type = trace_type ,
243
243
name = color_val ,
244
244
marker = dict (
245
245
color = colormap [color_val ]
@@ -251,7 +251,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
251
251
x = group [x ].tolist (),
252
252
y = group [y ].tolist (),
253
253
mode = 'markers' ,
254
- type = 'scatter' + scattergl * 'gl' ,
254
+ type = trace_type ,
255
255
name = color_val ,
256
256
marker = dict (
257
257
color = colormap [color_val ]
@@ -287,7 +287,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
287
287
def _facet_grid_color_numerical (df , x , y , facet_row , facet_col , color_name ,
288
288
colormap , title , height , width ,
289
289
num_of_rows , num_of_cols , facet_row_labels ,
290
- facet_col_labels , scattergl , ** kwargs ):
290
+ facet_col_labels , trace_type , ** kwargs ):
291
291
fig = make_subplots (rows = num_of_rows , cols = num_of_cols ,
292
292
shared_xaxes = True , shared_yaxes = True ,
293
293
horizontal_spacing = HORIZONTAL_SPACING ,
@@ -299,7 +299,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
299
299
x = df [x ].tolist (),
300
300
y = df [y ].tolist (),
301
301
mode = 'markers' ,
302
- type = 'scatter' + scattergl * 'gl' ,
302
+ type = trace_type ,
303
303
marker = dict (
304
304
color = df [color_name ],
305
305
colorscale = colormap ,
@@ -316,7 +316,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
316
316
x = group [1 ][x ].tolist (),
317
317
y = group [1 ][y ].tolist (),
318
318
mode = 'markers' ,
319
- type = 'scatter' + scattergl * 'gl' ,
319
+ type = trace_type ,
320
320
marker = dict (
321
321
color = df [color_name ].tolist (),
322
322
colorscale = colormap ,
@@ -341,7 +341,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
341
341
x = group [1 ][x ].tolist (),
342
342
y = group [1 ][y ].tolist (),
343
343
mode = 'markers' ,
344
- type = 'scatter' + scattergl * 'gl' ,
344
+ type = trace_type ,
345
345
marker = dict (
346
346
color = df [color_name ].tolist (),
347
347
colorscale = colormap ,
@@ -378,7 +378,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
378
378
x = group [x ].tolist (),
379
379
y = group [y ].tolist (),
380
380
mode = 'markers' ,
381
- type = 'scatter' + scattergl * 'gl' ,
381
+ type = trace_type ,
382
382
marker = dict (
383
383
color = df [color_name ].tolist (),
384
384
colorscale = colormap ,
@@ -392,7 +392,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
392
392
x = group [x ].tolist (),
393
393
y = group [y ].tolist (),
394
394
mode = 'markers' ,
395
- type = 'scatter' + scattergl * 'gl' ,
395
+ type = trace_type ,
396
396
showlegend = False ,
397
397
** kwargs
398
398
)
@@ -423,7 +423,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
423
423
424
424
def _facet_grid (df , x , y , facet_row , facet_col , title , height , width ,
425
425
num_of_rows , num_of_cols , facet_row_labels , facet_col_labels ,
426
- scattergl , ** kwargs ):
426
+ trace_type , ** kwargs ):
427
427
fig = make_subplots (rows = num_of_rows , cols = num_of_cols ,
428
428
shared_xaxes = True , shared_yaxes = True ,
429
429
horizontal_spacing = HORIZONTAL_SPACING ,
@@ -434,7 +434,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
434
434
x = df [x ].tolist (),
435
435
y = df [y ].tolist (),
436
436
mode = 'markers' ,
437
- type = 'scatter' + scattergl * 'gl' ,
437
+ type = trace_type ,
438
438
marker = dict (
439
439
color = DEFUALT_MARKER_COLOR
440
440
),
@@ -449,7 +449,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
449
449
x = group [1 ][x ].tolist (),
450
450
y = group [1 ][y ].tolist (),
451
451
mode = 'markers' ,
452
- type = 'scatter' + scattergl * 'gl' ,
452
+ type = trace_type ,
453
453
marker = dict (
454
454
color = DEFUALT_MARKER_COLOR
455
455
),
@@ -479,7 +479,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
479
479
x = group [1 ][x ].tolist (),
480
480
y = group [1 ][y ].tolist (),
481
481
mode = 'markers' ,
482
- type = 'scatter' + scattergl * 'gl' ,
482
+ type = trace_type ,
483
483
marker = dict (
484
484
color = DEFUALT_MARKER_COLOR
485
485
),
@@ -510,7 +510,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
510
510
x = group [x ].tolist (),
511
511
y = group [y ].tolist (),
512
512
mode = 'markers' ,
513
- type = 'scatter' + scattergl * 'gl' ,
513
+ type = trace_type ,
514
514
marker = dict (
515
515
color = DEFUALT_MARKER_COLOR
516
516
),
@@ -547,7 +547,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
547
547
def create_facet_grid (df , x , y , facet_row = None , facet_col = None ,
548
548
color_name = None , colormap = None , facet_row_labels = None ,
549
549
facet_col_labels = None , title = 'facet grid' , height = 600 ,
550
- width = 600 , scattergl = False , ** kwargs ):
550
+ width = 600 , trace_type = 'scatter' , ** kwargs ):
551
551
"""
552
552
Returns figure for facet grid.
553
553
@@ -574,8 +574,8 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
574
574
:param (str) title: the title of the facet grid figure.
575
575
:param (int) height: the height of the facet grid figure.
576
576
:param (int) width: the width of the facet grid figure.
577
- :param (bool) scattergl: enables whether or not scattergl points are
578
- plotted. Default = False
577
+ :param (str) trace_type: decides the type of plot to appear in the
578
+ facet grid. The defualt is 'scatter'.
579
579
:param (dict) kwargs: a dictionary of scatterplot arguments.
580
580
581
581
"""
@@ -661,7 +661,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
661
661
colormap , title , height ,
662
662
width , num_of_rows ,
663
663
num_of_cols , facet_row_labels ,
664
- facet_col_labels , scattergl ,
664
+ facet_col_labels , trace_type ,
665
665
** kwargs )
666
666
667
667
elif isinstance (df [color_name ][0 ], Number ):
@@ -683,7 +683,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
683
683
num_of_cols ,
684
684
facet_row_labels ,
685
685
facet_col_labels ,
686
- scattergl , ** kwargs )
686
+ trace_type , ** kwargs )
687
687
688
688
elif isinstance (colormap , list ):
689
689
colorscale_list = colormap
@@ -696,7 +696,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
696
696
num_of_cols ,
697
697
facet_row_labels ,
698
698
facet_col_labels ,
699
- scattergl , ** kwargs )
699
+ trace_type , ** kwargs )
700
700
elif isinstance (colormap , str ):
701
701
if colormap in colors .PLOTLY_SCALES .keys ():
702
702
colorscale_list = colors .PLOTLY_SCALES [colormap ]
@@ -713,7 +713,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
713
713
num_of_cols ,
714
714
facet_row_labels ,
715
715
facet_col_labels ,
716
- scattergl , ** kwargs )
716
+ trace_type , ** kwargs )
717
717
else :
718
718
colorscale_list = colors .PLOTLY_SCALES ['Reds' ]
719
719
fig = _facet_grid_color_numerical (df , x , y , facet_row ,
@@ -723,12 +723,12 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
723
723
num_of_cols ,
724
724
facet_row_labels ,
725
725
facet_col_labels ,
726
- scattergl , ** kwargs )
726
+ trace_type , ** kwargs )
727
727
728
728
else :
729
729
fig = _facet_grid (df , x , y , facet_row , facet_col , title , height ,
730
730
width , num_of_rows , num_of_cols , facet_row_labels ,
731
- facet_col_labels , scattergl , ** kwargs )
731
+ facet_col_labels , trace_type , ** kwargs )
732
732
733
733
fig ['layout' ].update (height = height , width = width , title = title )
734
734
fig ['layout' ].update (plot_bgcolor = PLOT_BGCOLOR )
0 commit comments