For svg graph move repeated fill & stroke definitions to parent element styles, reducing generated file from 17.3KB - 13.9KB

This commit is contained in:
Peter Stockings
2023-12-09 21:07:36 +11:00
parent 26f4a84d0b
commit 81d674d650

View File

@@ -22,7 +22,7 @@
{% for value, position, message in data_points %}
{% 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="1"></circle>
{% endfor %}
{% endmacro %}
@@ -51,7 +51,7 @@
<svg viewBox="0 0 {{ vb_width + 4 }} {{ vb_height + 4 }}" preserveAspectRatio="none">
<path d="{{ path_best_fit(best_fit_points, vb_height) }}" stroke="gray" stroke-dasharray="2,1" fill="none" stroke-opacity="40%"/>
{% for plot in plots %}
<g class="{{ plot.label }}">
<g class="{{ plot.label }}" style="fill: {{ plot.color }}; stroke: {{ plot.color }};">
{{ plot_line(plot.points, plot.color) }}
</g>
{% endfor %}