{# @description A chart built in Python with pyecharts: the space it draws into, and its options carried to the browser as JSON. #} {# @prop chart:text | description:"The pyecharts chart to draw. Pass it with a colon, :chart, because it is a Python value." | required #} {# @prop id:text | description:"The figure's id. The caption and the drawing surface are tied to it." | required #} {# @prop height:text | description:"A CSS height for the chart. Leave it and aspect-ratio out and the figure fills the element around it." #} {# @prop aspect-ratio:text | description:"The chart's shape, such as 16/9, instead of a height. Ignored when height is given." #} {# @prop name:text | description:"Accessible name, carried as the drawing surface's aria-label." #} {# @prop caption:text | description:"Text printed under the chart and read out with it." #} {# @prop description:text | description:"Hidden text alternative for what the chart shows, read after the caption." #} {% load mvp_charts %} {% comment %} `w-full` on both children because daisyUI centres a figure's children inside a card, which leaves a child with no width of its own at zero width. `calc()` makes a ratio like `16/9` one number. {% endcomment %}
{# Hidden from assistive technology: the surface already carries the figure's name. #}
{% if description %}

{{ description }}

{% endif %} {# Last: HTML allows a figcaption only as a figure's first or last child. #} {% if caption %}
{{ caption }}
{% endif %}