8000 Conditionally hide the suggest plot button. by copybara-service[bot] · Pull Request #5766 · googlecolab/colabtools · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion google/colab/_quickchart_hint_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
_output_callbacks = {}
_MAX_CHART_INSTANCES = 4
_ENABLE_GENERATE = False
_ENABLE_SUGGEST_PLOTS = False
_QUICKCHART_BUTTON_MIN_ROW_COUNT = 2 # Min # rows to enable quickchart button.

_ICON_SVG = textwrap.dedent("""
Expand Down Expand Up @@ -259,7 +260,7 @@ def register_df_and_get_html(df):
def _df_formatter_with_hint_buttons(df):
"""Alternate df formatter with buttons for interactive and quickchart."""
buttons = []
if len(df) >= _QUICKCHART_BUTTON_MIN_ROW_COUNT:
if _ENABLE_SUGGEST_PLOTS and len(df) >= _QUICKCHART_BUTTON_MIN_ROW_COUNT:
buttons.append(register_df_and_get_html(df))
if _ENABLE_GENERATE:
buttons.append(_generate_with_variable.get_html(df))
Expand Down
0