@@ -98,11 +98,11 @@ class QueryChat(QueryChatBase[IntoFrameT]):
9898 tools
9999 Which querychat tools to include in the chat client by default. Can be:
100100 - A single tool string: `"update"` or `"query"`
101- - A tuple of tools: `("update", "query", "visualize_dashboard", " visualize_query")`
101+ - A tuple of tools: `("update", "query", "visualize_query")`
102102 - `None` or `()` to disable all tools
103103
104- Default is `("update", "query")`. Visualization tools (`"visualize_dashboard"`,
105- `"visualize_query"`) can be opted into by including them in the tuple.
104+ Default is `("update", "query")`. The visualization tool (`"visualize_query"`)
105+ can be opted into by including it in the tuple.
106106
107107 Set to `"update"` to prevent the LLM from accessing data values, only
108108 allowing dashboard filtering without answering questions.
@@ -250,9 +250,8 @@ def app(
250250 Creates a Shiny app with a chat sidebar and tabbed view -- providing a
251251 quick-and-easy way to start chatting with your data.
252252
253- The app includes three tabs:
253+ The app includes two tabs:
254254 - **Data**: Shows the filtered data table
255- - **Filter Plot**: Shows the persistent dashboard visualization
256255 - **Query Plot**: Shows the most recent query visualization
257256
258257 Parameters
@@ -278,7 +277,6 @@ def app(
278277 if isinstance (self .tools , str )
279278 else (self .tools or ())
280279 )
281- has_filter_viz = "visualize_dashboard" in tools_tuple
282280 has_query_viz = "visualize_query" in tools_tuple
283281
284282 def app_ui (request ):
@@ -291,13 +289,6 @@ def app_ui(request):
291289 ),
292290 ),
293291 ]
294- if has_filter_viz :
295- nav_panels .append (
296- ui .nav_panel (
297- "Filter Plot" ,
298- ui .output_ui ("filter_plot_container" ),
299- )
300- )
301292 if has_query_viz :
302293 nav_panels .append (
303294 ui .nav_panel (
@@ -374,37 +365,6 @@ def sql_output():
374365 width = "100%" ,
375366 )
376367
377- if has_filter_viz :
378-
379- @render .ui
380- def filter_plot_container ():
381- from shinywidgets import output_widget , render_altair
382-
383- chart = vals .filter_viz_chart ()
384- if chart is None :
385- return ui .card (
386- ui .card_body (
387- ui .p (
388- "No filter visualization yet. "
389- "Use the chat to create one."
390- ),
391- class_ = "text-muted text-center py-5" ,
392- ),
393- )
394-
395- @render_altair
396- def filter_chart ():
397- return chart
398-
399- return ui .card (
400- ui .card_header (
401- bs_icon ("bar-chart-fill" ),
402- " " ,
403- vals .filter_viz_title .get () or "Filter Visualization" ,
404- ),
405- output_widget ("filter_chart" ),
406- )
407-
408368 if has_query_viz :
409369
410370 @render .ui
@@ -971,68 +931,38 @@ def title(self, value: Optional[str] = None) -> str | None | bool:
971931 else :
972932 return self ._vals .title .set (value )
973933
974- def ggvis (self , source : Literal [ "filter" , "query" ] = "filter" ) -> alt .Chart | None :
934+ def ggvis (self ) -> alt .Chart | None :
975935 """
976- Get the visualization chart.
977-
978- Parameters
979- ----------
980- source
981- Which visualization to return:
982- - "filter": Chart from visualize_dashboard (updates with filter changes)
983- - "query": Chart from visualize_query (most recent inline visualization)
936+ Get the visualization chart from the most recent visualize_query call.
984937
985938 Returns
986939 -------
987940 :
988941 The Altair chart, or None if no visualization exists.
989942
990943 """
991- if source == "filter" :
992- return self ._vals .filter_viz_chart ()
993- else :
994- return self ._vals .query_viz_chart ()
944+ return self ._vals .query_viz_chart ()
995945
996- def ggsql (self , source : Literal [ "filter" , "query" ] = "filter" ) -> str | None :
946+ def ggsql (self ) -> str | None :
997947 """
998- Get the ggsql specification.
999-
1000- Parameters
1001- ----------
1002- source
1003- Which specification to return:
1004- - "filter": VISUALISE spec only (from visualize_dashboard)
1005- - "query": Full ggsql query (from visualize_query)
948+ Get the full ggsql query from the most recent visualize_query call.
1006949
1007950 Returns
1008951 -------
1009952 :
1010- The ggsql specification , or None if no visualization exists.
953+ The ggsql query string , or None if no visualization exists.
1011954
1012955 """
1013- if source == "filter" :
1014- return self ._vals .filter_viz_spec .get ()
1015- else :
1016- return self ._vals .query_viz_ggsql .get ()
956+ return self ._vals .query_viz_ggsql .get ()
1017957
1018- def ggtitle (self , source : Literal [ "filter" , "query" ] = "filter" ) -> str | None :
958+ def ggtitle (self ) -> str | None :
1019959 """
1020- Get the visualization title.
1021-
1022- Parameters
1023- ----------
1024- source
1025- Which title to return:
1026- - "filter": Title from visualize_dashboard
1027- - "query": Title from visualize_query
960+ Get the visualization title from the most recent visualize_query call.
1028961
1029962 Returns
1030963 -------
1031964 :
1032965 The title, or None if no visualization exists.
1033966
1034967 """
1035- if source == "filter" :
1036- return self ._vals .filter_viz_title .get ()
1037- else :
1038- return self ._vals .query_viz_title .get ()
968+ return self ._vals .query_viz_title .get ()
0 commit comments