{% macro visualize_score(pct) %} {% if pct is none %} {% elif pct > 80 %} {{ bootstrap_icon('circle-fill', 'text-success align-baseline me-1', 12) }} {{pct|round|int}}% {% elif pct > 60 %} {{ bootstrap_icon('circle-fill', 'text-warning align-baseline me-1', 12) }} {{pct|round|int}}% {% else %} {{ bootstrap_icon('circle-fill', 'text-danger align-baseline me-1', 12) }} {{pct|round|int}}% {% endif %} {% endmacro %} {% macro visualize_check_score(check_score) %} {% if check_score.data_type == 'bool' %} {% if check_score.score == 0 %} {{ bootstrap_icon('x-circle', 'text-danger') }} {% else %} {{ bootstrap_icon('check-circle', 'text-success') }} {% endif %} {% else %} {{ visualize_score(check_score.score) }} {% endif %} {% endmacro %} {% macro visualize_check_result(check_result) %} {% if check_result.metadata.data_type == 'bool' %} {% if check_result.result == 1 %} {{ bootstrap_icon('x-circle', 'text-danger') }} {% else %} {{ bootstrap_icon('check-circle', 'text-success') }} {% endif %} {% else %} {{ visualize_score((100 * (1 - check_result.result))|int) }} {% endif %} {% endmacro %} {% macro bootstrap_icon(name, extra_classes='', size=16) -%} {%- endmacro %} {% macro info_popover(popover_text, image='question-circle', extra_classes='', size=16, placement='right') %} {% endmacro %} {% macro pagination(paging, previous_link, next_link) %} {% if paging.number_of_pages > 1 %} {% else %}

Displaying {{ paging.first_item_index }} - {{ paging.last_item_index }} of {{ paging.total }}.

{% endif %} {% endmacro %} {% macro visualize_series(series) %} {{ visualize_series_name(series.name) }} ({{ series.source }}) {% endmacro %} {% macro visualize_series_name(series_name) %} {% set is_abbreviated, name = series_name|format_series_name %} {% if is_abbreviated %} {{ name }} {% else %} {{ name }} {% endif %} {% endmacro %} {% macro abbreviate_series_name(series_name) -%} {% set _, name = series_name|format_series_name -%} {{ name }} {%- endmacro %} {% macro alerter() %} {% with messages = get_flashed_messages(category_filter=["error"]) %} {%- for message in messages %} {% endfor %} {% endwith %} {% with messages = get_flashed_messages(category_filter=["message"]) %} {%- for message in messages %} {% endfor %} {% endwith %} {% with messages = get_flashed_messages(category_filter=["success"]) %} {%- for message in messages %} {% endfor %} {% endwith %} {% with messages = get_flashed_messages(category_filter=["warning"]) %} {%- for message in messages %} {% endfor %} {% endwith %} {% endmacro %} {% macro progress_bar(analysis_state, state_url, label='checks', class_name='state-progress', empty_is_pending=False) %} {% if not analysis_state.is_running() and analysis_state.failed > 0 %}
{{ caller() }} failed{% if analysis_state.total > 1 %} ({{ analysis_state.failed }}/{{ analysis_state.total }}){% endif %}.
{% endif %} {% if analysis_state.pending > 0 or analysis_state.is_running() or (empty_is_pending and not analysis_state.is_defined()) %}
{{ caller() }} in progress
Completed {{ analysis_state.completed }} of {{ analysis_state.total }} {{ label }}.
{% endif %} {% endmacro %} {% macro progress_bar_flow(analysis_state, state_url, cancel_url, flow_evaluation) %} {% if analysis_state.block_state.total > 0 and analysis_state.block_state.failed == analysis_state.block_state.total %}
Analysis failed completely.
{% elif analysis_state.block_state.is_completed() %} {% if analysis_state.block_state.failed > 0 %}
Analysis failed ({{ analysis_state.block_state.failed }}/{{ analysis_state.block_state.total }}). Showing partial results.
{% endif %} {% if analysis_state.block_state.is_canceled() %}
Analysis was canceled. Showing partial results.
{% endif %} {% else %} {% if analysis_state.flow_state.is_defined() and (analysis_state.flow_state.pending > 0 or analysis_state.flow_state.is_running() or (analysis_state.block_state.is_defined() and not analysis_state.block_state.is_completed())) %}
{% endif %} {% endif %} {% endmacro %} {% macro menu(title, items=[], active='') %} {% endmacro %} {% macro menu_back(url) %} {% endmacro %} {% macro visualize_kpi_score(score) %} {% if score > 80 %} {% set color="var(--bs-success)" %} {% elif score > 60 %} {% set color="var(--bs-warning)" %} {% else %} {% set color="var(--bs-danger)" %} {% endif %}
{{ score }}%
{% endmacro %} {% macro visualize_split_kpi_score(pct) %} {% if pct is none %}
-
{% elif pct > 80 %}
{{ bootstrap_icon('circle-fill', 'text-success align-baseline me-1', 12) }} {{pct|round|int}}%
{% elif pct > 60 %}
{{ bootstrap_icon('circle-fill', 'text-warning align-baseline me-1', 12) }} {{pct|round|int}}%
{% else %}
{{ bootstrap_icon('circle-fill', 'text-danger align-baseline me-1', 12) }} {{pct|round|int}}%
{% endif %} {% endmacro %} {% macro visualize_metadata_value(key, value) %} {% if value is not none and value != '' %} {% if key == 'dictionary' %} {% for value_item, label in value.mapping.items() %} {% endfor %}
{{ label }} {{ value_item }}
{% elif key in ['data type', 'interpolation type', 'process type'] %} {{ value.value }} {% else %} {{ value|numberformat }} {% endif %} {% else %} {{ visualize_score(none) }} {% endif %} {% endmacro %} {% macro edit_multivariate_metadata(metadata, process_types) %} {% for field_name, field_value in metadata.iter_names() %} {% endfor %}
Metadata Value
{% if field_name == 'process type' %} {% endif %}
{% endmacro %} {% macro display_event_frame_checks(checks_metadata) %}
Generated by: {% for metadata in checks_metadata|sort(attribute="name") %} {{ metadata.name }} {% if loop.nextitem is defined %} , {% endif %} {% endfor %} {% for metadata in checks_metadata|sort(attribute="name") %}

{{ metadata.name }}

{{ metadata.html_help_text|safe }}
{% endfor %}
{% endmacro %}