Skip to content

Commit 8f5dc34

Browse files
committed
trace_type instead of type
1 parent 82883b4 commit 8f5dc34

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

plotly/figure_factory/_facet_grid.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _add_shapes_to_fig(fig, annot_rect_color):
143143
def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
144144
colormap, title, height, width, num_of_rows,
145145
num_of_cols, facet_row_labels,
146-
facet_col_labels, scattergl, **kwargs):
146+
facet_col_labels, trace_type, **kwargs):
147147
fig = make_subplots(rows=num_of_rows, cols=num_of_cols,
148148
shared_xaxes=True, shared_yaxes=True,
149149
horizontal_spacing=HORIZONTAL_SPACING,
@@ -157,7 +157,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
157157
x=group[1][x].tolist(),
158158
y=group[1][y].tolist(),
159159
mode='markers',
160-
type='scatter' + scattergl * 'gl',
160+
type=trace_type,
161161
name=group[0],
162162
marker=dict(
163163
color=colormap[group[0]]
@@ -175,7 +175,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
175175
x=data_by_color[x].tolist(),
176176
y=data_by_color[y].tolist(),
177177
mode='markers',
178-
type='scatter' + scattergl * 'gl',
178+
type=trace_type,
179179
name=color_val,
180180
marker=dict(
181181
color=colormap[color_val]
@@ -200,7 +200,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
200200
x=data_by_color[x].tolist(),
201201
y=data_by_color[y].tolist(),
202202
mode='markers',
203-
type='scatter' + scattergl * 'gl',
203+
type=trace_type,
204204
name=color_val,
205205
marker=dict(
206206
color=colormap[color_val]
@@ -239,7 +239,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
239239
x=group_filtered[x].tolist(),
240240
y=group_filtered[y].tolist(),
241241
mode='markers',
242-
type='scatter' + scattergl * 'gl',
242+
type=trace_type,
243243
name=color_val,
244244
marker=dict(
245245
color=colormap[color_val]
@@ -251,7 +251,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
251251
x=group[x].tolist(),
252252
y=group[y].tolist(),
253253
mode='markers',
254-
type='scatter' + scattergl * 'gl',
254+
type=trace_type,
255255
name=color_val,
256256
marker=dict(
257257
color=colormap[color_val]
@@ -287,7 +287,7 @@ def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name,
287287
def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
288288
colormap, title, height, width,
289289
num_of_rows, num_of_cols, facet_row_labels,
290-
facet_col_labels, scattergl, **kwargs):
290+
facet_col_labels, trace_type, **kwargs):
291291
fig = make_subplots(rows=num_of_rows, cols=num_of_cols,
292292
shared_xaxes=True, shared_yaxes=True,
293293
horizontal_spacing=HORIZONTAL_SPACING,
@@ -299,7 +299,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
299299
x=df[x].tolist(),
300300
y=df[y].tolist(),
301301
mode='markers',
302-
type='scatter' + scattergl * 'gl',
302+
type=trace_type,
303303
marker=dict(
304304
color=df[color_name],
305305
colorscale=colormap,
@@ -316,7 +316,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
316316
x=group[1][x].tolist(),
317317
y=group[1][y].tolist(),
318318
mode='markers',
319-
type='scatter' + scattergl * 'gl',
319+
type=trace_type,
320320
marker=dict(
321321
color=df[color_name].tolist(),
322322
colorscale=colormap,
@@ -341,7 +341,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
341341
x=group[1][x].tolist(),
342342
y=group[1][y].tolist(),
343343
mode='markers',
344-
type='scatter' + scattergl * 'gl',
344+
type=trace_type,
345345
marker=dict(
346346
color=df[color_name].tolist(),
347347
colorscale=colormap,
@@ -378,7 +378,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
378378
x=group[x].tolist(),
379379
y=group[y].tolist(),
380380
mode='markers',
381-
type='scatter' + scattergl * 'gl',
381+
type=trace_type,
382382
marker=dict(
383383
color=df[color_name].tolist(),
384384
colorscale=colormap,
@@ -392,7 +392,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
392392
x=group[x].tolist(),
393393
y=group[y].tolist(),
394394
mode='markers',
395-
type='scatter' + scattergl * 'gl',
395+
type=trace_type,
396396
showlegend=False,
397397
**kwargs
398398
)
@@ -423,7 +423,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
423423

424424
def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
425425
num_of_rows, num_of_cols, facet_row_labels, facet_col_labels,
426-
scattergl, **kwargs):
426+
trace_type, **kwargs):
427427
fig = make_subplots(rows=num_of_rows, cols=num_of_cols,
428428
shared_xaxes=True, shared_yaxes=True,
429429
horizontal_spacing=HORIZONTAL_SPACING,
@@ -434,7 +434,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
434434
x=df[x].tolist(),
435435
y=df[y].tolist(),
436436
mode='markers',
437-
type='scatter' + scattergl * 'gl',
437+
type=trace_type,
438438
marker=dict(
439439
color=DEFUALT_MARKER_COLOR
440440
),
@@ -449,7 +449,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
449449
x=group[1][x].tolist(),
450450
y=group[1][y].tolist(),
451451
mode='markers',
452-
type='scatter' + scattergl * 'gl',
452+
type=trace_type,
453453
marker=dict(
454454
color=DEFUALT_MARKER_COLOR
455455
),
@@ -479,7 +479,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
479479
x=group[1][x].tolist(),
480480
y=group[1][y].tolist(),
481481
mode='markers',
482-
type='scatter' + scattergl * 'gl',
482+
type=trace_type,
483483
marker=dict(
484484
color=DEFUALT_MARKER_COLOR
485485
),
@@ -510,7 +510,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
510510
x=group[x].tolist(),
511511
y=group[y].tolist(),
512512
mode='markers',
513-
type='scatter' + scattergl * 'gl',
513+
type=trace_type,
514514
marker=dict(
515515
color=DEFUALT_MARKER_COLOR
516516
),
@@ -547,7 +547,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, title, height, width,
547547
def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
548548
color_name=None, colormap=None, facet_row_labels=None,
549549
facet_col_labels=None, title='facet grid', height=600,
550-
width=600, scattergl=False, **kwargs):
550+
width=600, trace_type='scatter', **kwargs):
551551
"""
552552
Returns figure for facet grid.
553553
@@ -574,8 +574,8 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
574574
:param (str) title: the title of the facet grid figure.
575575
:param (int) height: the height of the facet grid figure.
576576
: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'.
579579
:param (dict) kwargs: a dictionary of scatterplot arguments.
580580
581581
"""
@@ -661,7 +661,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
661661
colormap, title, height,
662662
width, num_of_rows,
663663
num_of_cols, facet_row_labels,
664-
facet_col_labels, scattergl,
664+
facet_col_labels, trace_type,
665665
**kwargs)
666666

667667
elif isinstance(df[color_name][0], Number):
@@ -683,7 +683,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
683683
num_of_cols,
684684
facet_row_labels,
685685
facet_col_labels,
686-
scattergl, **kwargs)
686+
trace_type, **kwargs)
687687

688688
elif isinstance(colormap, list):
689689
colorscale_list = colormap
@@ -696,7 +696,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
696696
num_of_cols,
697697
facet_row_labels,
698698
facet_col_labels,
699-
scattergl, **kwargs)
699+
trace_type, **kwargs)
700700
elif isinstance(colormap, str):
701701
if colormap in colors.PLOTLY_SCALES.keys():
702702
colorscale_list = colors.PLOTLY_SCALES[colormap]
@@ -713,7 +713,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
713713
num_of_cols,
714714
facet_row_labels,
715715
facet_col_labels,
716-
scattergl, **kwargs)
716+
trace_type, **kwargs)
717717
else:
718718
colorscale_list = colors.PLOTLY_SCALES['Reds']
719719
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,
723723
num_of_cols,
724724
facet_row_labels,
725725
facet_col_labels,
726-
scattergl, **kwargs)
726+
trace_type, **kwargs)
727727

728728
else:
729729
fig = _facet_grid(df, x, y, facet_row, facet_col, title, height,
730730
width, num_of_rows, num_of_cols, facet_row_labels,
731-
facet_col_labels, scattergl, **kwargs)
731+
facet_col_labels, trace_type, **kwargs)
732732

733733
fig['layout'].update(height=height, width=width, title=title)
734734
fig['layout'].update(plot_bgcolor=PLOT_BGCOLOR)

0 commit comments

Comments
 (0)