{#- Macros shared by the report and the main page of Tabalyst Insights. -#} {% macro logo() -%} {%- endmacro %} {% macro icons() -%} {%- endmacro %} {% macro tool_search(id, label) -%} {%- endmacro %} {% macro tool_seg(id, label, options) -%}
{% for mode, text, n in options %}{% endfor %}
{%- endmacro %} {% macro table_head(label, kind='text', align=false, pill=false, filter=true) -%}
{{ label }}{% if filter %}{% endif %}
{%- endmacro %} {% macro column_name(column, dataset_id='') -%}{{ column.position }}{% if column_links.get((dataset_id, column.id)) %}{{ column.name or '(unnamed)' }} {% else %}{{ column.name or '(unnamed)' }}{% endif %}{%- endmacro %} {% macro percent_cell(value, count, color='var(--attn)', attention=false) -%} {% if value %}{{ value }}%{{ count | count }}{% else %}–{% endif %} {%- endmacro %} {% macro acc(kind) -%}{{ acc_words[kind] }}{%- endmacro %} {% macro status(word, cls, title) -%}{{ word }}{%- endmacro %} {% macro distinct_cell(column) -%} {% set d = column.distinct %}{% if d.kind == 'exact' %}{{ d.value | count }}{% if d.source == 'second_pass' %}2nd pass{% endif %}{% elif d.kind == 'at_least' %}≥ {{ d.value | count }}{% if d.estimate is not none %}≈ {{ d.estimate | round | int | count }} est.{% endif %}{% else %}limited{% endif %} {%- endmacro %} {% macro value_examples(column, prefix='col', px='') -%} {% set ev = column.summary.values %}{% for value in ev.examples %}{{ value }}{% endfor %}{% if column.exposure in ['mask', 'hide'] %}{% elif column.distinct_count is none or column.distinct_count > ev.examples|length %}{% endif %} {%- endmacro %} {% macro dataset_header(ds, eyebrow) -%}

{{ eyebrow }}

{{ source_stem }}{{ source_suffix }}

  • {{ report.source.format | upper }}
  • {% if report.source.format in ('json', 'jsonl') %}
  • Dataset {{ ds.id }}
  • {{ ds.summary.row_count | count }} records
  • {{ ds.summary.column_count | count }} fields
  • {% else %}
  • {{ ds.summary.row_count | count }} rows
  • {{ ds.summary.column_count | count }} columns
  • {% endif %}
  • {{ report.source.size_bytes | size }}
  • {% if report.source.encoding %}
  • {{ report.source.encoding }}
  • {% endif %}{% if report.source.csv %}
  • Delimiter {{ report.source.csv.delimiter }}
  • {% endif %}
Analysis complete · {{ report.report.processing_seconds | seconds }} s
{%- endmacro %} {% macro columns_panel(ds, px, number) -%}

{{ number }} / Structure

Columns({{ ds.summary.column_count }})

Inferred type and classification per column. Issues: confirmed issues and candidate anomalies found by the scan; remarks such as missing values are under Observations.

{{ tool_search(px ~ 'columns-table', 'columns') }}{{ tool_seg(px ~ 'columns-table', 'Show columns', [('all','All',ds.summary.column_count),('issue','Quality issues',ds.quality_issue_column_count),('obs','With observations',ds.observation_column_count)]) }}{{ ds.summary.column_count }} of {{ ds.summary.column_count }} columns
{{ table_head('Column','list') }}{{ table_head('Missing','num',true) }}{{ table_head('Distinct','num',true) }}{{ table_head('Inferred type','list',false,true) }}{{ table_head('Type','list',false,true) }}{{ table_head('Error','num',true) }}{{ table_head('Issues','num',true) }}{{ table_head('Examples',filter=false) }}{% for column in ds.columns %}{{ column_name(column, ds.id) }}{{ percent_cell(column.missing_percent,column.missing_count) }}{{ distinct_cell(column) }}{{ percent_cell(column.type_error_percent,column.type_error_count or 0,'var(--attn)',column.type_error_count != 0) }}{% set nq = column.quality | rejectattr('observation.status','equalto','informational') | list | length %}{% set nr = column.quality | length - nq %}{{ value_examples(column, px=px) }}{% endfor %}
{{ column.inferred_type }}{{ column.type_label }}{% if nq %}{{ nq | count }}{% else %}0{% endif %}{% if nr %}+{{ nr | count }} remarks{% endif %}

Distinct values are exact unless marked: ≥ at least (a scan limit stopped the count), ≈ estimated from a sample with its error.

{%- endmacro %}