Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 586496986
  • Loading branch information
drewbryant authored and colaboratory-team committed Nov 30, 2023
1 parent dc427c8 commit 1901694
Showing 1 changed file with 46 additions and 45 deletions.
91 changes: 46 additions & 45 deletions google/colab/_quickchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,69 +94,70 @@ def determine_charts(df, dataframe_registry, max_chart_instances=None):
chart_sections = []

if numeric_cols:
chart_sections.append(
_quickchart_helpers.histograms_section(
df, numeric_cols[:max_chart_instances], dataframe_registry
)
section = _quickchart_helpers.histograms_section(
df, numeric_cols[:max_chart_instances], dataframe_registry
)
if section.charts:
chart_sections.append(section)

if categorical_cols:
selected_categorical_cols = categorical_cols[:max_chart_instances]
chart_sections += [
_quickchart_helpers.categorical_histograms_section(
df, selected_categorical_cols, dataframe_registry
),
]
section = _quickchart_helpers.categorical_histograms_section(
df, selected_categorical_cols, dataframe_registry
)
if section.charts:
chart_sections.append(section)

if len(numeric_cols) >= 2:
chart_sections += [
_quickchart_helpers.scatter_section(
df,
_select_first_k_pairs(numeric_cols, k=max_chart_instances),
dataframe_registry,
),
]
section = _quickchart_helpers.scatter_section(
df,
_select_first_k_pairs(numeric_cols, k=max_chart_instances),
dataframe_registry,
)
if section.charts:
chart_sections.append(section)

if time_cols:
chart_sections.append(
_quickchart_helpers.time_series_line_plots_section(
df,
_select_time_series_cols(
time_cols=time_cols,
numeric_cols=numeric_cols,
categorical_cols=categorical_cols,
k=max_chart_instances,
),
dataframe_registry,
section = _quickchart_helpers.time_series_line_plots_section(
df,
_select_time_series_cols(
time_cols=time_cols,
numeric_cols=numeric_cols,
categorical_cols=categorical_cols,
k=max_chart_instances,
),
dataframe_registry,
)
if section.charts:
chart_sections.append(section)

if numeric_cols:
chart_sections.append(
_quickchart_helpers.value_plots_section(
df, numeric_cols[:max_chart_instances], dataframe_registry
)
section = _quickchart_helpers.value_plots_section(
df, numeric_cols[:max_chart_instances], dataframe_registry
)
if section.charts:
chart_sections.append(section)

if len(categorical_cols) >= 2:
chart_sections += [
_quickchart_helpers.heatmaps_section(
df,
_select_first_k_pairs(categorical_cols, k=max_chart_instances),
dataframe_registry,
),
]
section = _quickchart_helpers.heatmaps_section(
df,
_select_first_k_pairs(categorical_cols, k=max_chart_instances),
dataframe_registry,
)
if section.charts:
chart_sections.append(section)

if categorical_cols and numeric_cols:
chart_sections += [
_quickchart_helpers.faceted_distributions_section(
df,
_select_faceted_numeric_cols(
numeric_cols, categorical_cols, k=max_chart_instances
),
dataframe_registry,
section = _quickchart_helpers.faceted_distributions_section(
df,
_select_faceted_numeric_cols(
numeric_cols, categorical_cols, k=max_chart_instances
),
]
dataframe_registry,
)
if section.charts:
chart_sections.append(section)

return chart_sections


Expand Down

0 comments on commit 1901694

Please sign in to comment.