refactor(sql_explorer): Replace Plotly with SVG rendering for plots
Replaces the Plotly-based graph generation in the SQL Explorer with direct SVG rendering within an HTML template, similar to the exercise progress sparklines. - Modifies `routes/sql_explorer.py` endpoints (`plot_query`, `plot_unsaved_query`) to fetch raw data instead of using pandas/Plotly. - Adds `utils.prepare_svg_plot_data` to process raw SQL results, determine plot type (scatter, line, bar, table), normalize data, and prepare it for SVG. - Creates `templates/partials/sql_explorer/svg_plot.html` to render the SVG plot with axes, ticks, labels, and basic tooltips. - Removes the `generate_plot` function's usage for SQL Explorer and the direct dependency on Plotly for this feature.
This commit is contained in:
@@ -10,6 +10,23 @@
|
||||
<div class="prose max-w-none">
|
||||
<p>Updates and changes to the site will be documented here, with the most recent changes listed first.</p>
|
||||
|
||||
<!-- New Entry for SQL Explorer SVG Plots -->
|
||||
<hr class="my-6">
|
||||
<h2 class="text-xl font-semibold mb-2">April 15, 2025</h2>
|
||||
<ul class="list-disc pl-5 space-y-1">
|
||||
<li>Replaced Plotly graph generation in SQL Explorer with direct SVG rendering:</li>
|
||||
<ul class="list-disc pl-5 space-y-1">
|
||||
<li>Updated `plot_query` and `plot_unsaved_query` endpoints in `routes/sql_explorer.py` to fetch raw
|
||||
data.</li>
|
||||
<li>Added `prepare_svg_plot_data` function in `utils.py` to process data and determine plot type
|
||||
(scatter, line, bar, or table fallback).</li>
|
||||
<li>Created `templates/partials/sql_explorer/svg_plot.html` template to render SVG plots with axes
|
||||
and basic tooltips.</li>
|
||||
<li>Removes the need for Plotly library for SQL Explorer plots, reducing dependencies and
|
||||
potentially improving load times.</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<!-- New Entry for Dismissible Exercise Graph -->
|
||||
<hr class="my-6">
|
||||
<h2 class="text-xl font-semibold mb-2">April 13, 2025</h2>
|
||||
|
||||
Reference in New Issue
Block a user