Datasets:
mcp-web-experiments / interfaces /vega-lite /documents /code-complete-index-hints--p4-dev-01-basic-bar.md
mcp-web-experiments / interfaces /vega-lite /documents /code-complete-index-hints--p4-dev-01-basic-bar.md
|
Download interfaces/vega-lite/documents/code-complete-index-hints--p4-dev-01-basic-bar.md from flekschas/mcp-web-experiments: direct link, hf CLI and curl.
- Browser
- Download file 7.55 kB
-
https://huggingface.co/datasets/flekschas/mcp-web-experiments/resolve/main/interfaces/vega-lite/documents/code-complete-index-hints--p4-dev-01-basic-bar.md
- Command line
-
hf download hf://datasets/flekschas/mcp-web-experiments/interfaces/vega-lite/documents/code-complete-index-hints--p4-dev-01-basic-bar.md
-
curl -L -o code-complete-index-hints--p4-dev-01-basic-bar.md https://huggingface.co/datasets/flekschas/mcp-web-experiments/resolve/main/interfaces/vega-lite/documents/code-complete-index-hints--p4-dev-01-basic-bar.md
7.55 kB
| # Vega-Lite 6.4.3 submission contract | |
| Author one complete Vega-Lite 6.4.3 specification for the task. The chart is rendered in a fixed 900 × 620 CSS-pixel viewport. | |
| Submit a complete JavaScript program with the `code` tool. The program returns the complete specification as plain object literals; it does not print it or return a patch. The TypeScript declarations in the appendix are reference only: write plain JavaScript, with no type annotations. Imports, files, and network access are disabled. | |
| Bind the task rows by name with `data: { name: "table" }`. The host replaces each such reference with exactly the rows shown in the task before validation. Do not copy the rows into the specification: an inline row that repeats every field of a task row is rejected. | |
| The program may also read the same rows, for example to compute domains: | |
| ```typescript | |
| declare function getData(): Promise<Array<Record<string, unknown>>>; | |
| ``` | |
| The host accepts a submission only after JSON-Schema validation, Vega-Lite compilation, parsing, and a dataflow run all succeed. A rejected call returns its stage and error. Repair it by submitting another complete program. | |
| Each attempt is retained for evaluation. The latest submission, not the last accepted one, controls the final outcome: a later invalid submission makes the final outcome invalid even when an earlier accepted chart is retained for audit. Stop after acceptance. | |
| --- | |
| Schema appendix: | |
| ## axis.aria | |
| Object role: `axis`; authored property: `aria`. | |
| ## Shared aria contract a79a74e2e438 | |
| Shared by 2 byte-identical schema locations. | |
| Representative compact declaration: | |
| ## Axis.aria | |
| Schema pointer: `#/definitions/Axis/properties/aria` | |
| ```typescript | |
| type Axis_aria = boolean | ExprRef; | |
| ``` | |
| ## channel.aggregate | |
| Object role: `channel`; authored property: `aggregate`. | |
| ## Shared aggregate contract bbefebfb99c1 | |
| Shared by 20 byte-identical schema locations. | |
| Representative compact declaration: | |
| ## ConditionalParameter<StringFieldDef>.aggregate | |
| Schema pointer: `#/definitions/ConditionalParameter<StringFieldDef>/properties/aggregate` | |
| ```typescript | |
| type ConditionalParameter_StringFieldDef__aggregate = Aggregate; | |
| ``` | |
| Aggregation function for the field (e.g., `"mean"`, `"sum"`, `"median"`, `"min"`, `"max"`, `"count"`). | |
| __Default value:__ `undefined` (None) | |
| __See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation. | |
| ## composition.$schema | |
| Object role: `composition`; authored property: `$schema`. | |
| ## Shared $schema contract e72a79890b63 | |
| Shared by 6 byte-identical schema locations. | |
| Representative compact declaration: | |
| ## TopLevelConcatSpec.$schema | |
| Schema pointer: `#/definitions/TopLevelConcatSpec/properties/$schema` | |
| ```typescript | |
| type TopLevelConcatSpec_$schema = string; | |
| ``` | |
| URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema. | |
| ## encoding.angle | |
| Object role: `encoding`; authored property: `angle`. | |
| ## Shared angle contract 54544d82899c | |
| Shared by 2 byte-identical schema locations. | |
| Representative compact declaration: | |
| ## Encoding.angle | |
| Schema pointer: `#/definitions/Encoding/properties/angle` | |
| ```typescript | |
| type Encoding_angle = NumericMarkPropDef; | |
| ``` | |
| Rotation angle of point and text marks. | |
| ## mark.align | |
| Object role: `mark`; authored property: `align`. | |
| ## Shared align contract d3fa7ca91a11 | |
| Shared by 8 byte-identical schema locations. | |
| Representative compact declaration: | |
| ## AreaConfig.align | |
| Schema pointer: `#/definitions/AreaConfig/properties/align` | |
| ```typescript | |
| type AreaConfig_align = Align | ExprRef; | |
| ``` | |
| The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `"left"`, `"right"`, `"center"`. | |
| __Note:__ Expression reference is *not* supported for range marks. | |
| ## root.$schema | |
| Object role: `root`; authored property: `$schema`. | |
| ## scale.align | |
| Object role: `scale`; authored property: `align`. | |
| ## Scale.align | |
| Schema pointer: `#/definitions/Scale/properties/align` | |
| ```typescript | |
| type Scale_align = number | ExprRef; | |
| ``` | |
| The alignment of the steps within the scale range. | |
| This value must lie in the range `[0,1]`. A value of `0.5` indicates that the steps should be centered within the range. A value of `0` or `1` may be used to shift the bands to one side, say to position them adjacent to an axis. | |
| __Default value:__ `0.5` | |
| ## transform.aggregate | |
| Object role: `transform`; authored property: `aggregate`. | |
| ## AggregateTransform.aggregate | |
| Schema pointer: `#/definitions/AggregateTransform/properties/aggregate` | |
| ```typescript | |
| type AggregateTransform_aggregate = AggregatedFieldDef[]; | |
| ``` | |
| Array of objects that define fields to aggregate. | |
| ## unit.$schema | |
| Object role: `unit`; authored property: `$schema`. | |
| ## axis.bandPosition | |
| Object role: `axis`; authored property: `bandPosition`. | |
| ## Shared bandPosition contract 2dcb739946cc | |
| Shared by 2 byte-identical schema locations. | |
| Representative compact declaration: | |
| ## Axis.bandPosition | |
| Schema pointer: `#/definitions/Axis/properties/bandPosition` | |
| ```typescript | |
| type Axis_bandPosition = number | ExprRef; | |
| ``` | |
| ## channel.align | |
| Object role: `channel`; authored property: `align`. | |
| ## composition.align | |
| Object role: `composition`; authored property: `align`. | |
| ## encoding.color | |
| Object role: `encoding`; authored property: `color`. | |
| ## mark.angle | |
| Object role: `mark`; authored property: `angle`. | |
| ## Shared angle contract a07a96b32771 | |
| Shared by 8 byte-identical schema locations. | |
| Representative compact declaration: | |
| ## AreaConfig.angle | |
| Schema pointer: `#/definitions/AreaConfig/properties/angle` | |
| ```typescript | |
| type AreaConfig_angle = number | ExprRef; | |
| ``` | |
| ## root.align | |
| Object role: `root`; authored property: `align`. | |
| --- | |
| # Contracts that earlier submissions often got wrong | |
| Each block is the schema contract at a location where earlier submissions for other tasks were rejected. It restates the schema; it is not an example. | |
| Schema contract for Position2Def: | |
| type Position2Def = SecondaryFieldDef | DatumDef | PositionValueDef; | |
| type SecondaryFieldDef = { aggregate?: Aggregate; bandPosition?: number; bin?: null; field?: Field; timeUnit?: TimeUnit | BinnedTimeUnit | TimeUnitParams; title?: Text | null }; | |
| type DatumDef = { bandPosition?: number; datum?: PrimitiveValue | DateTime | ExprRef | RepeatRef; title?: Text | null; type?: Type }; | |
| type ValueDefNumberWidthHeightExprRef = { value: number | "width" | "height" | ExprRef }; | |
| Schema contract for FacetFieldDef: | |
| type FacetFieldDef = { aggregate?: Aggregate; bandPosition?: number; bin?: boolean | BinParams | null; field?: Field; header?: Header | null; sort?: SortArray | SortOrder | EncodingSortField | null; timeUnit?: TimeUnit | BinnedTimeUnit | TimeUnitParams; title?: Text | null; type?: StandardType }; | |
| Schema contract for TopLevelFacetSpec: | |
| type TopLevelFacetSpec = { $schema?: string; align?: LayoutAlign | RowCol<LayoutAlign>; autosize?: AutosizeType | AutoSizeParams; background?: Color | ExprRef; bounds?: "full" | "flush"; center?: boolean | RowCol<boolean>; columns?: number; config?: Config; data: Data | null; datasets?: Datasets; description?: string; facet: FacetFieldDef | FacetMapping; name?: string; padding?: Padding | ExprRef; params?: TopLevelParameter[]; resolve?: Resolve; spacing?: number | RowCol<number>; spec: LayerSpec | UnitSpecWithFrame; title?: Text | TitleParams; transform?: Transform[]; usermeta?: Dict }; |