web.dash_app¶
dash_app.py
Dash web application for analyzing Tableau workbooks and visualizing field dependencies.
This application allows users to upload or select sample Tableau workbooks, which are then processed in the background. The resulting metadata is visualized as interactive dependency graphs, KPI summaries, and detailed information panels. The UI is fully reactive and supports multi-user, per-session processing through isolated task threads.
Key Features:
Upload local Tableau workbooks or choose from bundled sample workbooks.
Background processing of TWB/TWBX files with per-session progress tracking.
Optional PNG generation in addition to the default SVG output.
Interactive dependency graph viewer with node selection, highlighting, shortest-path tracing, and calculation-chain inspection.
KPI cards summarizing the workbook’s structure (fields, calcs, sheets, LODs).
Downloadable output folder containing cleaned DOT graphs, metadata tables, and optional PNG exports.
Session-aware cancel functionality that cleanly interrupts long-running tasks.
Configuration:
The application organizes files into dedicated folders: - Uploaded files → static/uploads/<session-id>/ - Processed output → static/output/<session-id>/ - Sample workbooks → static/sample/
These folders are created automatically if they do not exist.
Usage:
Run this module to start the Dash development server.
- web.dash_app.assign_session_id(current_id)¶
Assign a unique session ID per browser tab.
Generates a new UUID when the page first loads, ensuring each user (or tab) gets an isolated session context instead of sharing a global ID across all connections.
- web.dash_app.clear_selected_node(*_)¶
Reset selected node when file changes or user clears.
- web.dash_app.handle_file_selection(active_tab, upload_contents, upload_filename, sample_path, sample_filename, user_id)¶
Handle both sample selection and user uploads depending on the active tab. No file copying is needed for samples since they are served directly from the static/sample folder.
- web.dash_app.load_dot_source(selected_file, layout, base_dir, selected_folder)¶
Load the selected .dot file, parse its node attributes, and identify the main node as [id, label].
- web.dash_app.show_info(_, f)¶
Display selected filename from upload component (if available)
- web.dash_app.start_processing(_, upload_filename, sample_filename, file_ready, active_tab, include_png, user_id)¶
Triggered by the ‘Process ZIP’ button. Decides which file (uploaded or sample) to process based on the active tab.
- web.dash_app.toggle_calc_modal(open_click, close_click, is_open, calc_content)¶
- web.dash_app.update_file_dropdown(base_dir, selected_folder)¶
Update .dot file list based on selected folder.
- web.dash_app.update_folder_dropdown(base_dir)¶
- web.dash_app.update_graph_and_info(dot_source, selected, main_node, node_attrs, df_root)¶
Render DOT graph + info: highlight path and show metadata, dependency chain.
- web.dash_app.update_kpi(df_root)¶
- web.dash_app.update_main_node(main_node, df_root)¶
- web.dash_app.update_progress(*args)¶