Instead of adding interactive popup on mouse over of plot point, switch to mouse over of rectangle around the timestamp (reduces file size by another third 29.7kb => 17.9)

This commit is contained in:
Peter Stockings
2023-12-09 14:03:09 +11:00
parent bc79224cee
commit 9d5d3b4507
2 changed files with 17 additions and 1 deletions

View File

@@ -23,7 +23,6 @@
{% set x = (position * vb_width)+margin %}
{% set y = (vb_height - value)+margin %}
<circle cx="{{ x | round(precision) }}" cy="{{ y | round(precision) }}" r="1" stroke="{{ color }}" fill="{{ color }}"></circle>
<circle cx="{{ x | round(precision) }}" cy="{{ y | round(precision) }}" r="5" class="plot_point cursor-pointer" data-message="{{ message }}" fill-opacity="0%"></circle>
{% endfor %}
{% endmacro %}
@@ -56,6 +55,20 @@
{{ plot_line(plot.points, plot.color) }}
</g>
{% endfor %}
{% for pos, message in plot_labels %}
<rect
x="{{ (pos * vb_width) - (stroke_width/2) + margin }}"
y="{{ 0 }}"
width="{{ stroke_width }}"
height="{{ vb_height + margin }}"
class="plot_point"
data-message="{{ message }}"
fill-opacity="0%"></rect>
{% endfor %}
{% for pos in relative_positions %}
{% endfor %}
</svg>
<div class="flex justify-center pt-2">
{% for plot in plots %}