From 894dd1d92dd6015bccd37bcb960139ebb793ab13 Mon Sep 17 00:00:00 2001 From: Ekaropolus Date: Sun, 18 May 2025 18:11:37 -0600 Subject: [PATCH] index page for waste --- .../templates/pxy_dashboard/index.html | 577 +----------------- .../partials/dashboard/DASHBOARD.md | 86 +++ .../partials/dashboard/channels_row.html | 193 ++++++ .../partials/dashboard/charts_row.html | 110 ++++ .../partials/dashboard/kpi_row.html | 141 +++++ .../partials/dashboard/location_row.html | 107 ++++ 6 files changed, 644 insertions(+), 570 deletions(-) create mode 100644 pxy_dashboard/templates/pxy_dashboard/partials/dashboard/DASHBOARD.md create mode 100644 pxy_dashboard/templates/pxy_dashboard/partials/dashboard/channels_row.html create mode 100644 pxy_dashboard/templates/pxy_dashboard/partials/dashboard/charts_row.html create mode 100644 pxy_dashboard/templates/pxy_dashboard/partials/dashboard/kpi_row.html create mode 100644 pxy_dashboard/templates/pxy_dashboard/partials/dashboard/location_row.html diff --git a/pxy_dashboard/templates/pxy_dashboard/index.html b/pxy_dashboard/templates/pxy_dashboard/index.html index 28dad56..f68b9db 100644 --- a/pxy_dashboard/templates/pxy_dashboard/index.html +++ b/pxy_dashboard/templates/pxy_dashboard/index.html @@ -7,7 +7,9 @@ -{% endblock extra_css %} {% block content %} +{% endblock extra_css %} + +{% block content %}
@@ -27,584 +29,19 @@
-
-
-
-
-
-
-
Customers
-

54,214

-

- 2,541 - Since last month -

-
-
- - - -
-
-
-
-
-
-
-
-
-
-
Orders
-

7,543

-

- 1.08% - Since last month -

-
-
- - - -
-
-
-
-
+ {% include "pxy_dashboard/partials/dashboard/kpi_row.html" %} -
-
-
-
-
-
Revenue
-

$9,254

-

- 7.00% - Since last month -

-
-
- - - -
-
+ {% include "pxy_dashboard/partials/dashboard/charts_row.html" %} -
-
-
+ {% include "pxy_dashboard/partials/dashboard/location_row.html" %} -
-
-
-
-
-
Growth
-

+ 20.6%

-

- 4.87% - Since last month -

-
-
- - - -
-
+ {% include "pxy_dashboard/partials/dashboard/channels_row.html" %} -
-
-
-
-
-
-
-
-
Conversation
-

9.62%

-

- 3.07% - Since last month -

-
-
- - - -
-
-
-
-
-
-
-
-
-
-
Balance
-

$168.5k

-

- 18.34% - Since last month -

-
-
- - - -
-
-
-
-
-
-
-
-
-
-

Total Sales

- -
-
-
- -
Brooklyn, New York
-
- 72k -
-
-
-
- -
The Castro, San Francisco
-
- 39k -
-
-
-
- -
Kovan, Singapore
-
- 61k -
-
-
-
-
-
-
-
-
-
-

Revenue

- -
-
-
-
-
-

Current Week

-

- $1705.54 -

-
-
-

Previous Week

-

- $6,523.25 -

-
-
-

Conversation

-

- 8.27% -

-
-
-

Customers

-

- 69k -

-
-
-
-
-
-
-
-
-
-
-
-
- - -
-
-
-
-

Revenue By Locations

- -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

Top Selling Products

- Export -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProductPriceOrdersAvl. QuantitySeller
ASOS Ridley High Waist$79.49828,540Adidas
Marco Lightweight Shirt$12.5586,320Puma
Half Sleeve Shirt$9.9925410,258Nike
Lightweight Jacket$69.995601,020Puma
Marco Sport Shoes$119.9975357Adidas
Custom Women's T-shirts$45.0085135Branded
Marco Sport Shoes$119.9975357Adidas
-
-
- View All -
-
-
-
-
- - -
-
-
-
-

Channels

- Export -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ChannelVisitsProgress
Direct2,050 -
-
-
-
Organic Search1,405 -
-
-
-
Refferal750 -
-
-
-
Social540 -
-
-
-
Other8,965 -
-
-
-
-
-
-
-
- -
-
-
-

Social Media Traffic

- Export -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NetworkVisitsProgress
Facebook2,250 -
-
-
-
Instagram1,501 -
-
-
-
Twitter750 -
-
-
-
LinkedIn540 -
-
-
-
Other13,851 -
-
-
-
-
-
-
-
- -
-
-
-

Engagement Overview

- Export -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Duration (Secs)SessionsViews
0-302,2504,250
31-601,5012,050
61-1207501,600
121-2405401,040
141-42056886
-
-
-
-
- -
- {% endblock content %} {% block extra_js %} diff --git a/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/DASHBOARD.md b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/DASHBOARD.md new file mode 100644 index 0000000..df8eee3 --- /dev/null +++ b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/DASHBOARD.md @@ -0,0 +1,86 @@ +# Polisplexity Dashboard Overview + +This document provides an overview of the structure and components included in the Polisplexity Digital Twin Dashboard. The dashboard is designed to monitor, analyze, and control the intelligent waste collection process using advanced data science, route optimization, and real-time social interaction monitoring. + +## πŸ“Š Dashboard Sections + +### 1. KPI Metrics +**Location:** `index.html` β†’ KPI Row + +Displays key performance indicators for the waste management system: +- **Collection Volume** +- **Route Completion** +- **Optimization Efficiency** +- **Citizen Engagement Rate** +- **Growth** +- **Operational Balance** + +These are real-time metrics generated from pre-op and post-op analytics. + +--- + +### 2. Charts and Time Series +**Location:** `partials/dashboard_charts.html` + +Visual analytics showing: +- **Collection Efficiency by Zone** +- **Optimization Impact on Costs and Routes** +- Progress bars and comparison widgets for different urban areas + +Connected to data from optimization engines (VROOM/ORS) and real route performance. + +--- + +### 3. Geographic Activity & Zone Metrics +**Location:** `partials/dashboard_map.html` + +A vector map with live markers indicating: +- Active or inactive waste collection zones +- Depot locations +- Operational anomalies + +Includes a table of materials collected across neighborhoods. + +--- + +### 4. Social Digital Twin Dashboard +**Location:** `partials/dashboard_engagement.html` + +Breaks down social interaction data from bots and apps: +- **Message Volume by Channel** (WhatsApp, Telegram, AR App, etc.) +- **Response Completion Rate per Network** +- **Interaction Duration and Prompt Depth** + +Draws from live logs, AI parsing, and feedback bots. + +--- + +## πŸ”§ Technologies Used + +- **Django** + Django Templates +- **ApexCharts** for visualization +- **jQuery Vector Map** for interactive mapping +- **Remix Icon** system for sidebar icons +- **Modular `partials/` system** for dashboard composition + +## πŸ“ File Structure + +- `index.html` – Main dashboard structure +- `partials/dashboard_kpis.html` – KPI row +- `partials/dashboard_charts.html` – Time series row +- `partials/dashboard_map.html` – Geographic zone row +- `partials/dashboard_engagement.html` – Social interaction row + +## πŸ”— Data Sources + +- Optimization logs (`vroom`, `ors`) +- Depot/zone JSON uploads +- Bot interaction databases (WhatsApp, Telegram, Facebook) +- A-Frame AR interaction points + +## 🧠 Twin Integration + +- **Physical Digital Twin**: Collection points, vehicle tracking, maps +- **Social Digital Twin**: Bots, user feedback, NLP classification + +` \ No newline at end of file diff --git a/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/channels_row.html b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/channels_row.html new file mode 100644 index 0000000..6059d3b --- /dev/null +++ b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/channels_row.html @@ -0,0 +1,193 @@ +
+ + +
+
+
+

Bot Interaction Volume by Channel

+ Export +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ChannelMessagesLoad
WhatsApp2,050 +
+
+
+
Telegram1,405 +
+
+
+
Facebook Messenger750 +
+
+
+
AR Interface540 +
+
+
+
Other8,965 +
+
+
+
+
+
+
+
+ + +
+
+
+

Bot Response Engagement by Network

+ Export +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NetworkResponse RateCompletion
Facebook2,250 +
+
+
+
Instagram1,501 +
+
+
+
Twitter750 +
+
+
+
LinkedIn540 +
+
+
+
Other13,851 +
+
+
+
+
+
+
+
+ + +
+
+
+

Bot Interaction Duration

+ Export +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Duration (Sec)SessionsUser Prompts
0–302,2504,250
31–601,5012,050
61–1207501,600
121–2405401,040
241–42056886
+
+
+
+
+ +
diff --git a/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/charts_row.html b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/charts_row.html new file mode 100644 index 0000000..f17c37f --- /dev/null +++ b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/charts_row.html @@ -0,0 +1,110 @@ +
+ + +
+
+
+

Collection Efficiency by Region

+ +
+ +
+
+ +
Centro HistΓ³rico
+
+ 72% +
+
+
+
+ +
Santa MarΓ­a la Ribera
+
+ 39% +
+
+
+
+ +
Iztapalapa Norte
+
+ 61% +
+
+
+
+
+
+
+ + +
+
+
+

Optimization Impact Report

+ +
+ +
+
+
+
+

Km Saved (This Week)

+

+ 114.3 km +

+
+
+

Operational Cost Saved

+

+ $6,523.25 +

+
+
+

Response Rate

+

+ 82.7% +

+
+
+

Twin Sync Accuracy

+

+ 91% +

+
+
+
+
+ +
+
+
+
+
+
+
+ +
diff --git a/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/kpi_row.html b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/kpi_row.html new file mode 100644 index 0000000..bdf7bbd --- /dev/null +++ b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/kpi_row.html @@ -0,0 +1,141 @@ +
+ + +
+
+
+
+
+
Monitored Collection Points
+

128

+

+ 5% + Since yesterday +

+
+
+ + + +
+
+
+
+
+ + +
+
+
+
+
+
Routes Optimized Today
+

24

+

+ 2 + Since yesterday +

+
+
+ + + +
+
+
+
+
+ + +
+
+
+
+
+
Predicted Waste Volume (kg)
+

13,280

+

+ 3.2% + vs. weekly average +

+
+
+ + + +
+
+
+
+
+ + +
+
+
+
+
+
Operational Deviation (%)
+

+4.87%

+

+ 1.2% + vs. target baseline +

+
+
+ + + +
+
+
+
+
+ + +
+
+
+
+
+
Citizen Interactions (24h)
+

310

+

+ 9.2% + vs. average day +

+
+
+ + + +
+
+
+
+
+ + +
+
+
+
+
+
Twin Confidence Score
+

87%

+

+ 6% + since last calibration +

+
+
+ + + +
+
+
+
+
+ +
diff --git a/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/location_row.html b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/location_row.html new file mode 100644 index 0000000..611d88b --- /dev/null +++ b/pxy_dashboard/templates/pxy_dashboard/partials/dashboard/location_row.html @@ -0,0 +1,107 @@ +
+ + +
+
+
+

Route Activity by Zone

+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+

Material Volume Breakdown

+ Export +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MaterialAvg. WeightPickupsTotal CollectedSource
Organic14.2 kg2143,452 kgAR App
Plastics7.9 kg1821,436 kgWhatsApp Bot
Paper6.1 kg98689 kgManual Entry
Glass9.4 kg47442 kgTelegram Bot
Metal4.5 kg36162 kgFacebook Pages
Textiles3.1 kg2268 kgAR App
+
+
+ View All +
+
+
+
+ +