htmx datafusion graphs via echarts2

This commit is contained in:
Priec
2026-07-16 00:47:13 +02:00
parent fac1ada024
commit f2e8db471c
4 changed files with 589 additions and 187 deletions

View File

@@ -1,7 +1,8 @@
# Analytics graphs
A small Rust web server that forwards SQL queries to `AnalyticsService.ExecuteAnalyticsQuery`
and displays the streamed result with ECharts.
A small Rust web server that logs in through `AuthService.Login`, forwards SQL
queries to `AnalyticsService.ExecuteAnalyticsQuery`, and displays the streamed
result with HTMX and ECharts.
## Run
@@ -11,7 +12,8 @@ Start the main komp_ac gRPC server, then run:
cargo run
```
Open <http://127.0.0.1:3000>. The default gRPC endpoint is
Open <http://127.0.0.1:3000/login> to log in, then use the analytics page at
<http://127.0.0.1:3000>. The access token is kept in an HTTP-only cookie. The default gRPC endpoint is
`http://[::1]:50051`. Both addresses can be changed:
```sh
@@ -24,5 +26,12 @@ The first SQL result column is used for category labels. Bar and line charts use
all remaining columns as numeric series, pie uses the second column, and scatter
uses the first two columns. Table view displays every returned value.
ECharts is loaded from jsDelivr, so the browser needs network access when opening
the page.
The profile selector is populated automatically through
`TableDefinition.GetProfileTree`. Choosing a profile fetches its live public
analytics catalog. The sidebar shows tables, columns, types, and links and can
create starter queries. Its **LLM schema context** section generates a complete
text summary that can be copied into an LLM prompt to request a valid analytics
SQL query.
HTMX and ECharts are loaded from jsDelivr, so the browser needs network access
when opening the page.