Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added plot tab #264

Merged
merged 2 commits into from
May 28, 2024
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
37 changes: 25 additions & 12 deletions project/ui/qprof-ui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"import ipywidgets as widgets\n",
"from datetime import datetime\n",
"import verticapy as vp\n",
"import plotly.graph_objects as go\n",
"from verticapy.performance.vertica import QueryProfilerInterface, QueryProfiler\n",
"logging.info('[Query Profile Tree Page] Successfully Imported Libraries ')\n",
"output_initial = widgets.Output()\n",
Expand Down Expand Up @@ -134,15 +135,6 @@
"source": [
"# Loading display settings\n",
"with output_initial:\n",
" # Initialize variables with default values\n",
" # count_widget_val = None\n",
" # footer_widget_val = None\n",
" # comma_widget_val = None\n",
" # percent_bar_widget_val = None\n",
" # max_cell_width_widget_val = None\n",
" # max_columns_widget_val = None\n",
" # max_rows_widget_val = None\n",
"\n",
" # Attempt to load stored variables\n",
" try:\n",
" %store -r count_widget_val\n",
Expand Down Expand Up @@ -422,6 +414,27 @@
" transactions_table = widgets.VBox([widgets.HTML(f\"<p style='color:red'>The following error occured: </p> <p> {e}</p>\")])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "88d01b31-5b2a-4ed1-95e7-5452e3e86183",
"metadata": {},
"outputs": [],
"source": [
"# Plots\n",
"# query_execution_steps_widget = qprof.get_qsteps()\n",
"query_plan_profile = qprof.get_qplan_profile()\n",
"query_plan_profile_plot = go.FigureWidget(data=[query_plan_profile.data[i] for i in range(len(query_plan_profile.data))],)\n",
"\n",
"query_execution = qprof.get_qexecution()\n",
"query_execution_plot = go.FigureWidget(data=[query_execution.data[i] for i in range(len(query_execution.data))],)\n",
"\n",
"plot_tabs = widgets.Tab()\n",
"\n",
"plot_tabs.children = [query_plan_profile_plot, query_execution_plot]\n",
"plot_tabs.titles = [\"Query Plan Profile\", \"Query Execution Plot\"]\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -441,9 +454,9 @@
"child_1 = widgets.VBox([output_tree])\n",
"child_2 = widgets.VBox([transactions_table])\n",
"child_3 = widgets.VBox([tables])\n",
"\n",
"tabs.children = [child_1, child_2, child_3]\n",
"tabs.titles = [\"Tree\", \"Transaction List\", \"Other info\"]\n",
"child_4 = widgets.VBox([plot_tabs])\n",
"tabs.children = [child_1, child_2, child_3, child_4]\n",
"tabs.titles = [\"Tree\", \"Transaction List\", \"Other info\", \"Plots\"]\n",
"display(tabs)"
]
},
Expand Down
Loading