{#- ############################################################################
MACROS FOR RENDERING CHARTS AND TABLES.
These macros encapsulate common functionality when generating various charts
and tables within the Mentat GUI. There are macros responsible for rendering
HTML as well as for rendering JavaScript, all with code reusability in mind.
############################################################################ -#}
{#- ============================================================================
Content rendering snippets.
Following snippets contain working pieces of HTML or JavaScript and are not
intended to be used separatelly. They should be considered internal for the
purposes of this library.
============================================================================ -#}
{#-
Render HTML columns that will contain chart and its related dataset table.
string chart_id: Unique identifier of the chart. This will be used for
generating all other required unique identifiers.
bool scrollable_table: Make the viewport of the dataset table scrollable.
bool with_full: Include options for downloading full unabridged dataset.
-#}
{%- macro _snippet_columns(chart_id, scrollable_table = True, with_full = False) %}
{{ chsection[1] }}
{{ chsection[2] }}
{%- if chsection[0] in statistics or render_empty %}
{%- if 'timeline' in statistics %}
{{ render_chart_timeline_dict(
statistics,
statistics_var_name,
'{}_per'.format(id_prefix.replace('-', '_')),
chsection[0]
)
}}
{%- endif %}
{%- set _dummy = cfg_params.update({'csag_name': chsection[0]}) -%}
{{ render_dataset_pie_dict(
statistics,
statistics_var_name,
'{}_per'.format(id_prefix.replace('-', '_')),
chsection[0],
cfg_params
)
}}
{%- else %}
{%- call macros_site.render_alert('warning', False) %}
{{ _('No data to be displayed on this panel.') }}
{%- endcall %}
{%- endif %}
{%- if tmp.update({'cntr': tmp['cntr'] + 1}) %}{%- endif %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endmacro %}