dataface 0.2.1.dev241__py3-none-any.whl → 0.2.1.dev323__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dataface/DATAFACE_SYNTAX.md +19 -28
- dataface/agent_api/_init_templates/guide.yaml +1 -1
- dataface/agent_api/describe.py +0 -5
- dataface/agent_api/docs/yaml-reference.md +208 -175
- dataface/agent_api/query.py +1 -1
- dataface/ai/llm.py +99 -3
- dataface/ai/skills/dashboard-build/SKILL.md +4 -5
- dataface/ai/skills/dashboard-design/SKILL.md +1 -1
- dataface/core/compile/__init__.py +0 -8
- dataface/core/compile/compiler.py +51 -18
- dataface/core/compile/inherit_registry.yaml +0 -4
- dataface/core/compile/introspection.py +0 -6
- dataface/core/compile/jinja.py +5 -44
- dataface/core/compile/models/chart/authored/__init__.py +14 -8
- dataface/core/compile/models/chart/authored/_base.py +1 -1
- dataface/core/compile/models/chart/authored/_data_table.py +1 -3
- dataface/core/compile/models/chart/authored/_layer.py +120 -36
- dataface/core/compile/models/chart/authored/_type.py +0 -5
- dataface/core/compile/models/chart/authored/area.py +5 -0
- dataface/core/compile/models/chart/authored/bar.py +5 -0
- dataface/core/compile/models/chart/authored/line.py +5 -0
- dataface/core/compile/models/chart/authored/scatter.py +5 -0
- dataface/core/compile/models/chart/normalized/__init__.py +0 -4
- dataface/core/compile/models/chart/normalized/area.py +4 -0
- dataface/core/compile/models/chart/normalized/bar.py +4 -0
- dataface/core/compile/models/chart/normalized/line.py +4 -0
- dataface/core/compile/models/chart/normalized/scatter.py +4 -0
- dataface/core/compile/models/chart/resolved/__init__.py +16 -7
- dataface/core/compile/models/chart/resolved/_base.py +1 -10
- dataface/core/compile/models/chart/resolved/_layer.py +98 -12
- dataface/core/compile/models/chart/resolved/area.py +5 -0
- dataface/core/compile/models/chart/resolved/bar.py +5 -0
- dataface/core/compile/models/chart/resolved/callout.py +0 -9
- dataface/core/compile/models/chart/resolved/line.py +5 -0
- dataface/core/compile/models/chart/resolved/scatter.py +5 -0
- dataface/core/compile/models/face/normalized.py +1 -1
- dataface/core/compile/models/query/authored.py +18 -26
- dataface/core/compile/models/query/normalized.py +2 -64
- dataface/core/compile/models/refs.py +0 -2
- dataface/core/compile/models/style/authored/__init__.py +4 -17
- dataface/core/compile/models/style/authored/_base.py +30 -1
- dataface/core/compile/models/style/resolved/__init__.py +2 -3
- dataface/core/compile/models/style/resolved/_base.py +7 -0
- dataface/core/compile/models/style/resolved/_cascade.py +2 -0
- dataface/core/compile/models/style/resolved/_marks.py +38 -7
- dataface/core/compile/models/style/resolved/area.py +15 -4
- dataface/core/compile/models/style/theme/__init__.py +10 -0
- dataface/core/compile/models/style/theme/area.py +66 -15
- dataface/core/compile/models/style/theme/bar.py +8 -0
- dataface/core/compile/models/style/theme/legend.py +21 -0
- dataface/core/compile/models/style/theme/line.py +10 -0
- dataface/core/compile/models/style/theme/marks.py +27 -15
- dataface/core/compile/models/style/theme/scatter.py +10 -0
- dataface/core/compile/models/style/theme/spark_bar.py +2 -4
- dataface/core/compile/models/style/theme/style.py +5 -2
- dataface/core/compile/models/style/theme/table.py +2 -4
- dataface/core/compile/normalize_charts.py +286 -73
- dataface/core/compile/normalize_queries.py +195 -27
- dataface/core/compile/normalize_variables.py +42 -10
- dataface/core/compile/resolve/__init__.py +7 -2
- dataface/core/compile/resolve/_resolve.py +427 -265
- dataface/core/compile/schema_renderers/settings_form.py +171 -0
- dataface/core/compile/single_series_allocation.py +4 -5
- dataface/core/compile/style_cascade.py +4 -63
- dataface/core/compile/variables.py +174 -1
- dataface/core/defaults/themes/_base.yaml +23 -6
- dataface/core/defaults/themes/cream.yaml +5 -0
- dataface/core/defaults/themes/diagnostics-title-angle-extreme.yaml +1 -2
- dataface/core/defaults/themes/diagnostics-title-baseline-extreme.yaml +1 -2
- dataface/core/defaults/themes/diagnostics-title-baseline.yaml +1 -1
- dataface/core/defaults/themes/diagnostics-title-center.yaml +1 -2
- dataface/core/defaults/themes/diagnostics-title-color-extreme.yaml +1 -1
- dataface/core/defaults/themes/diagnostics-title-font-extreme.yaml +1 -1
- dataface/core/defaults/themes/diagnostics-title-left.yaml +1 -2
- dataface/core/defaults/themes/diagnostics-title-offset-extreme.yaml +1 -2
- dataface/core/defaults/themes/diagnostics-title-size-extreme.yaml +1 -1
- dataface/core/defaults/themes/diagnostics-title-weight-extreme.yaml +1 -1
- dataface/core/defaults/themes/neon.yaml +9 -0
- dataface/core/defaults/themes/plain.yaml +4 -0
- dataface/core/defaults/themes/stark.yaml +17 -5
- dataface/core/defaults/themes/vivid.yaml +3 -3
- dataface/core/dialects/sqlite.py +0 -10
- dataface/core/errors/__init__.py +2 -0
- dataface/core/errors/codes_compile.py +16 -0
- dataface/core/errors/execution.py +3 -2
- dataface/core/execute/adapters/adapter_registry.py +1 -1
- dataface/core/execute/adapters/duckdb_adapter.py +109 -128
- dataface/core/execute/adapters/sql_adapter.py +0 -16
- dataface/core/execute/adapters/sqlite_adapter.py +0 -16
- dataface/core/execute/executor.py +18 -1
- dataface/core/execute/source_resolver.py +3 -3
- dataface/core/inspect/__init__.py +2 -0
- dataface/core/inspect/renderer.py +17 -21
- dataface/core/registered_views/templates/inspector/column.yaml +1 -2
- dataface/core/registered_views/templates/inspector/table.yaml +1 -2
- dataface/core/render/chart/callout.py +1 -1
- dataface/core/render/chart/data_table_attachment.py +14 -18
- dataface/core/render/chart/emitters/__init__.py +0 -5
- dataface/core/render/chart/emitters/_layers.py +602 -0
- dataface/core/render/chart/emitters/_overlay.py +739 -0
- dataface/core/render/chart/emitters/area.py +52 -238
- dataface/core/render/chart/emitters/bar.py +67 -229
- dataface/core/render/chart/emitters/line.py +35 -159
- dataface/core/render/chart/emitters/scatter.py +32 -9
- dataface/core/render/chart/feature.py +29 -4
- dataface/core/render/chart/features/baseline.py +106 -74
- dataface/core/render/chart/features/click_interactivity.py +3 -1
- dataface/core/render/chart/features/endpoint_labels.py +8 -6
- dataface/core/render/chart/features/facet.py +3 -1
- dataface/core/render/chart/features/grouped_bar.py +8 -4
- dataface/core/render/chart/features/legend_toggle.py +1 -1
- dataface/core/render/chart/features/mirror_axis.py +1 -1
- dataface/core/render/chart/features/value_labels.py +13 -190
- dataface/core/render/chart/kpi.py +1 -1
- dataface/core/render/chart/rendering.py +4 -6
- dataface/core/render/chart/session.py +10 -8
- dataface/core/render/chart/spark.py +0 -1
- dataface/core/render/chart/spark_bar.py +1 -4
- dataface/core/render/chart/step_band.py +5 -1
- dataface/core/render/chart/table.py +18 -5
- dataface/core/render/chart/table_support.py +23 -7
- dataface/core/render/chart/translate.py +16 -1
- dataface/core/render/chart/vega_lite.py +86 -40
- dataface/core/render/chart/vl_field_maps.py +5 -0
- dataface/core/render/converters/chart.py +31 -27
- dataface/core/render/format_utils.py +43 -0
- dataface/core/render/layout_sizing.py +62 -30
- dataface/core/render/renderer.py +31 -2
- dataface/core/render/sizing.py +7 -14
- dataface/core/render/templates/controls/_styles.css +118 -39
- dataface/core/render/templates/page.css +4 -1
- dataface/core/render/templates/scripts/variables.js +296 -97
- dataface/core/render/templates/variable_controls/daterange.html +1 -1
- dataface/core/render/templates/variable_controls/select.html +11 -5
- dataface/core/render/variable_controls.py +28 -10
- dataface/core/render/warnings/bar_band_width_too_narrow.py +14 -4
- dataface/core/render/warnings/layered_chart_shared_y_axis_scale_mismatch.py +32 -28
- dataface/core/render/warnings/likely_currency_or_percent_missing_formatter.py +76 -84
- dataface/core/render/warnings/registry.py +2 -0
- dataface/core/render/warnings/value_labels_crowd_width.py +133 -0
- dataface/core/serve/server.py +153 -267
- dataface/data/highlighting/face/v1.json +0 -1
- dataface/integrations/markdown.py +11 -4
- {dataface-0.2.1.dev241.dist-info → dataface-0.2.1.dev323.dist-info}/METADATA +1 -1
- {dataface-0.2.1.dev241.dist-info → dataface-0.2.1.dev323.dist-info}/RECORD +148 -156
- dataface/core/compile/filter_injection.py +0 -350
- dataface/core/compile/models/chart/authored/layered.py +0 -96
- dataface/core/compile/models/chart/normalized/layered.py +0 -49
- dataface/core/compile/models/chart/resolved/layered.py +0 -47
- dataface/core/compile/models/style/authored/layered.py +0 -111
- dataface/core/compile/models/style/resolved/layered.py +0 -58
- dataface/core/defaults/themes/bi.yaml +0 -16
- dataface/core/defaults/themes/carbong100.yaml +0 -56
- dataface/core/defaults/themes/dark.yaml +0 -63
- dataface/core/defaults/themes/light.yaml +0 -30
- dataface/core/defaults/themes/looker.yaml +0 -17
- dataface/core/render/chart/emitters/layered.py +0 -673
- {dataface-0.2.1.dev241.dist-info → dataface-0.2.1.dev323.dist-info}/WHEEL +0 -0
- {dataface-0.2.1.dev241.dist-info → dataface-0.2.1.dev323.dist-info}/entry_points.txt +0 -0
- {dataface-0.2.1.dev241.dist-info → dataface-0.2.1.dev323.dist-info}/licenses/LICENSE +0 -0
dataface/DATAFACE_SYNTAX.md
CHANGED
|
@@ -196,7 +196,7 @@ queries: # Named queries
|
|
|
196
196
|
charts: # Named charts
|
|
197
197
|
rows: [ ... ] # Or cols:, grid:, tabs: (pick one)
|
|
198
198
|
|
|
199
|
-
theme:
|
|
199
|
+
theme: neon # Vega-Lite theme; inherited by nested faces
|
|
200
200
|
|
|
201
201
|
# Nesting / layout primitives (mostly for nested faces inside rows/cols)
|
|
202
202
|
id: my_face # Auto-generated from filename if omitted
|
|
@@ -237,7 +237,7 @@ Top-level fields (22 total):
|
|
|
237
237
|
| `style` | object | Board-style block (see [Board style](#board-style)) |
|
|
238
238
|
| `width` | string \| int | Width when nested (`"50%"` or pixels) |
|
|
239
239
|
| `height` | string \| int | Height when nested |
|
|
240
|
-
| `theme` | string | Vega-Lite theme name (e.g. `
|
|
240
|
+
| `theme` | string | Vega-Lite theme name (e.g. `editorial`, `stark`, `neon`) — inherited by nested faces |
|
|
241
241
|
|
|
242
242
|
`face:` as a top-level key is rejected. Put face properties (title, rows, queries, …) directly at the YAML root.
|
|
243
243
|
|
|
@@ -385,12 +385,6 @@ queries:
|
|
|
385
385
|
sql: SELECT region, target FROM targets
|
|
386
386
|
source: ./data/targets.csv # path (contains "/" or a data extension) = inline file; table name = stem
|
|
387
387
|
|
|
388
|
-
# dbt model — read columns directly from a compiled dbt model
|
|
389
|
-
customers_model:
|
|
390
|
-
type: dbt_model
|
|
391
|
-
model: fct_customers
|
|
392
|
-
columns: [customer_id, arr, region]
|
|
393
|
-
|
|
394
388
|
# MetricFlow / dbt Semantic Layer
|
|
395
389
|
revenue_by_region:
|
|
396
390
|
type: metricflow # Optional — also implied by `metrics:` presence
|
|
@@ -407,7 +401,7 @@ queries:
|
|
|
407
401
|
- [Bob, 87.1]
|
|
408
402
|
```
|
|
409
403
|
|
|
410
|
-
Query types (`type:` literals): `sql`, `http`, `
|
|
404
|
+
Query types (`type:` literals): `sql`, `http`, `metricflow`, `values`. `schema_resolver` is internal-only and not part of the authored surface.
|
|
411
405
|
|
|
412
406
|
Common fields (all query types):
|
|
413
407
|
|
|
@@ -547,9 +541,9 @@ Set `type:` to one of:
|
|
|
547
541
|
|
|
548
542
|
**Geographic** — `geoshape`, `map`, `point_map`, `bubble_map`.
|
|
549
543
|
|
|
550
|
-
**Marks** (direct Vega-Lite mark passthroughs
|
|
544
|
+
**Marks** (direct Vega-Lite mark passthroughs) — `circle`, `square`, `tick`, `rule`, `trail`, `rect`, `arc`, `image`.
|
|
551
545
|
|
|
552
|
-
**
|
|
546
|
+
**Overlays** — `bar`, `line`, `area`, and `scatter` accept a `layers:` field for mixed-mark or dual-axis charts (see [Combo charts](#combo-charts-barlinearea-with-layers) and [Composition](#composition)).
|
|
553
547
|
|
|
554
548
|
**Sparklines** — `spark_bar` (compact horizontal bars used in profiler cards).
|
|
555
549
|
|
|
@@ -587,9 +581,9 @@ All chart types accept the channels and style fields below — but each type rej
|
|
|
587
581
|
| `background` | string \| object | Background channel — color, `{value}`, `{field, scale/when}`, or map layer |
|
|
588
582
|
| `sort` | object | `{by, order}` — categorical sort. Horizontal bar charts default to value-descending order when omitted. |
|
|
589
583
|
| `link` | string | Click-through URL template for drill-down links |
|
|
590
|
-
| `layers` | list |
|
|
584
|
+
| `layers` | list | Overlay layers on cartesian charts (`bar`/`line`/`area`/`scatter`) — see [Combo charts](#combo-charts-barlinearea-with-layers) |
|
|
591
585
|
| `conditional_formatting` | object | Discrete style rules by column (see [Conditional formatting](#conditional-formatting)) |
|
|
592
|
-
| `data_table` | list | Attached mini-table beneath bar/line/area
|
|
586
|
+
| `data_table` | list | Attached mini-table beneath bar/line/area charts (including those with `layers:`) — see [Composition](#composition) |
|
|
593
587
|
| `height` | int \| float | Exact pixel height. Wins over `aspect_ratio` and theme defaults. Bypasses `min_height`/`max_height`. Not valid on `kpi`, `table`, `callout`, `spark_bar`. |
|
|
594
588
|
| `aspect_ratio` | float | Chart shape: `height = width / aspect_ratio`. Theme default is `1.5`. Not valid on `kpi`, `table`, `callout`, `spark_bar`. |
|
|
595
589
|
| `min_height` | float | Height floor for this chart only; overrides `style.charts.min_height`. Ignored when `height` is set. |
|
|
@@ -597,7 +591,7 @@ All chart types accept the channels and style fields below — but each type rej
|
|
|
597
591
|
|
|
598
592
|
`height` and `aspect_ratio` live at **chart root** — they are rejected under `style:`. `style:` is paint only (colors, fonts, marks).
|
|
599
593
|
|
|
600
|
-
KPI-only fields: `value`, `label`, `support`. KPI uses `label:` for the header text — `title:` is rejected on KPI charts. Chart-root `format:` / `formatter:` is rejected on all chart types
|
|
594
|
+
KPI-only fields: `value`, `label`, `support`. KPI uses `label:` for the header text — `title:` is rejected on KPI charts. Chart-root `format:` / `formatter:` is rejected on all chart types. Use the family slot instead:
|
|
601
595
|
|
|
602
596
|
| Family | Format slot |
|
|
603
597
|
|--------|-------------|
|
|
@@ -605,7 +599,6 @@ KPI-only fields: `value`, `label`, `support`. KPI uses `label:` for the header t
|
|
|
605
599
|
| `kpi` value | `style.value.format` |
|
|
606
600
|
| `kpi` support | `support.format` |
|
|
607
601
|
| `table` column | `style.columns.<col>.format` |
|
|
608
|
-
| `layered` | chart-root `format:` |
|
|
609
602
|
|
|
610
603
|
`glyph` and `tone` at chart root are also rejected on KPI — use `style.glyph.character`, `style.tone`, and `style.kpi.glyph.font.color` / `style.kpi.value.font.color` for overrides.
|
|
611
604
|
|
|
@@ -750,7 +743,7 @@ type: spark_bar
|
|
|
750
743
|
x: rank
|
|
751
744
|
y: count
|
|
752
745
|
|
|
753
|
-
# Pure marks (
|
|
746
|
+
# Pure marks (advanced use — not accepted as base chart types):
|
|
754
747
|
# circle, square, tick, rule, trail, rect, arc, image
|
|
755
748
|
|
|
756
749
|
# callout — message card with a style.tone: field (info | negative | warning | positive)
|
|
@@ -761,24 +754,22 @@ style:
|
|
|
761
754
|
|
|
762
755
|
```
|
|
763
756
|
|
|
764
|
-
###
|
|
757
|
+
### Combo charts (bar/line/area with layers)
|
|
765
758
|
|
|
766
759
|
```yaml
|
|
767
|
-
type:
|
|
768
|
-
x: month
|
|
760
|
+
type: bar
|
|
761
|
+
x: month
|
|
762
|
+
y: actual
|
|
769
763
|
layers:
|
|
770
|
-
- type:
|
|
771
|
-
y: actual
|
|
772
|
-
label: Actual
|
|
773
|
-
- type: line
|
|
764
|
+
- type: line # bar | line | area | scatter
|
|
774
765
|
y: target
|
|
775
766
|
label: Target
|
|
776
767
|
axis_y:
|
|
777
|
-
position: right
|
|
768
|
+
position: right # left | right
|
|
778
769
|
title: "Target"
|
|
779
770
|
```
|
|
780
771
|
|
|
781
|
-
|
|
772
|
+
The base chart (`type: bar`, `type: line`, or `type: area`) sets the primary mark, `x`, `y`, and `query`. Additional marks go in `layers:`. Each layer accepts: `type`, `y`, `label`, `color` (data channel, bare field name), `query` (overrides the base chart query for this layer), `x` (layer x-values extend the base x-scale), `axis_y`, and `style` (marks-only patch). Vega-Lite `encoding:` is not allowed inside a layer — use the typed channels.
|
|
782
773
|
|
|
783
774
|
### Conditional formatting
|
|
784
775
|
|
|
@@ -814,9 +805,9 @@ If `default: true` is set, it must be the last rule in the `when` list. Earlier
|
|
|
814
805
|
|
|
815
806
|
Dataface composes charts in three ways:
|
|
816
807
|
|
|
817
|
-
1. **`layers:` on
|
|
808
|
+
1. **`layers:` on a base chart** — multiple marks share one x-axis and frame. The base chart (`type: bar`, `type: line`, `type: area`, or `type: scatter`) owns the x-axis, frame, title, legend container, and `sort`. Each layer defaults to the base `query:` but may declare its own `query:` — layer x-values extend the base x-scale rather than clip it. See [Combo charts](#combo-charts-barlinearea-with-layers) above.
|
|
818
809
|
|
|
819
|
-
2. **`data_table:` attached to a chart** — a mini cross-tab strip rendered below the chart, columns aligned to the chart's x-axis ticks. Supported on `bar`, `line`, `area
|
|
810
|
+
2. **`data_table:` attached to a chart** — a mini cross-tab strip rendered below the chart, columns aligned to the chart's x-axis ticks. Supported on `bar`, `line`, and `area` charts (including those with `layers:`).
|
|
820
811
|
|
|
821
812
|
```yaml
|
|
822
813
|
charts:
|
|
@@ -847,7 +838,7 @@ Dataface composes charts in three ways:
|
|
|
847
838
|
|
|
848
839
|
Constraint: data_table requires a single chart-level `x:`. Layered charts with per-layer `x:` differing from the chart-level x are rejected.
|
|
849
840
|
|
|
850
|
-
3. **Layout composition** — the `rows`, `cols`, `grid`, `tabs` structure in [Layout](#layout). Layout composes charts into a face; chart-level composition belongs to `
|
|
841
|
+
3. **Layout composition** — the `rows`, `cols`, `grid`, `tabs` structure in [Layout](#layout). Layout composes charts into a face; chart-level composition belongs to `layers:` (overlays) and `data_table:`.
|
|
851
842
|
|
|
852
843
|
Non-goals (not part of the authored chart surface): Vega-Lite `encoding`, `mark`, `spec`, `config`, `transform`, `params`, `resolve`, `hconcat`, `vconcat`, `concat`, `repeat`. These keys are rejected at compile time. Use the typed channels (`x`, `y`, `color`, …) and `style:` instead; use the layout primitives for visual composition.
|
|
853
844
|
|
|
@@ -25,7 +25,7 @@ text: |
|
|
|
25
25
|
|
|
26
26
|
# ── Queries ───────────────────────────────────────────────────────────────────
|
|
27
27
|
# `type: values` embeds data directly — no database needed.
|
|
28
|
-
# Swap for a `type: sql` query (with a `sources:` entry)
|
|
28
|
+
# Swap for a `type: sql` query (with a `sources:` entry) once you're ready.
|
|
29
29
|
queries:
|
|
30
30
|
monthly_revenue:
|
|
31
31
|
type: values
|
dataface/agent_api/describe.py
CHANGED
|
@@ -12,7 +12,6 @@ from dataface.core.compile.models.chart.normalized import (
|
|
|
12
12
|
)
|
|
13
13
|
from dataface.core.compile.models.face.normalized import Layout
|
|
14
14
|
from dataface.core.compile.models.query.normalized import (
|
|
15
|
-
DbtModelQuery,
|
|
16
15
|
HttpQuery,
|
|
17
16
|
Query,
|
|
18
17
|
SqlQuery,
|
|
@@ -130,10 +129,6 @@ def _build_query_description(name: str, query: Query) -> QueryDescription:
|
|
|
130
129
|
return QueryDescription(
|
|
131
130
|
name=name, type="sql", summary=summary, source=query.source, sql=sql
|
|
132
131
|
)
|
|
133
|
-
case DbtModelQuery():
|
|
134
|
-
return QueryDescription(
|
|
135
|
-
name=name, type="dbt_model", summary=f"dbt model: {query.model}"
|
|
136
|
-
)
|
|
137
132
|
case HttpQuery():
|
|
138
133
|
return QueryDescription(
|
|
139
134
|
name=name, type="http", summary=f"HTTP request: {query.url}"
|