Completely remove dependency on plotly, undecided as to whether I should refactor dashboard/people views so they render graphs statically rather then using htmx to fetch on load, probably a smarter move but too lazy atm

This commit is contained in:
Peter Stockings
2023-12-09 14:54:44 +11:00
parent e3435df8b5
commit 69e502ca01
2 changed files with 6 additions and 33 deletions

View File

@@ -134,17 +134,14 @@
<div class="overflow-x-auto rounded-lg">
<div class="align-middle inline-block min-w-full">
<div class="shadow overflow-hidden sm:rounded-lg">
<h4 class="text-l font-semibold text-blue-400 mb-2 text-center">{{ e['ExerciseName'] }}</h4>
{% if e['RepMaxes']|length > 1 %}
<div class="w-full mt-2 aspect-video" _="init js(me)
Plotly.newPlot(me, [{
x: {{ e['EstimatedOneRepMaxProgressions']['StartDates'] | replace_double_quote_strings_with_single_quote | safe }},
y: {{ e['EstimatedOneRepMaxProgressions']['Estimated1RMs'] | replace_double_quote_strings_with_single_quote | safe }},
text: {{ e['EstimatedOneRepMaxProgressions']['TopSets'] | replace_double_quote_strings_with_single_quote | safe }},
name: '{{ p['PersonName'] }} - {{ e['ExerciseName'] }}' , hovertemplate }], layout,
config)
end">
<div class="w-full mt-2 aspect-video">
<div class="hidden"
hx-get="{{ url_for('get_exercise_progress_for_user', person_id=p['PersonId'], exercise_id=e['ExerciseId'], min_date=min_date, max_date=max_date) }}"
hx-trigger="load" hx-target="this" hx-swap="outerHTML">
</div>
</div>
{% endif %}
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">