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:
@@ -22,7 +22,7 @@
|
|||||||
{% for value, position, message in data_points %}
|
{% for value, position, message in data_points %}
|
||||||
{% set x = (position * vb_width)+margin %}
|
{% set x = (position * vb_width)+margin %}
|
||||||
{% set y = (vb_height - value)+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 %}
|
{% endfor %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<svg viewBox="0 0 {{ vb_width + 4 }} {{ vb_height + 4 }}" preserveAspectRatio="none">
|
<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%"/>
|
<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 %}
|
{% 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) }}
|
{{ plot_line(plot.points, plot.color) }}
|
||||||
</g>
|
</g>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user