# Gosling 1.0.7 submission contract Build one complete Gosling 1.0.7 specification for the task by composing constructors. The host renders it in a fixed 900 × 620 CSS-pixel viewport with hg38 assembly metadata supplied by the host. Submit a complete JavaScript program with the `code` tool. Constructors are functions in scope; each validates its own input and returns a fragment. Every constructor is async: always await it. Build bottom-up: create leaf objects such as channels, data, and styles first, then compose them into larger objects such as tracks, and finish with the root constructor. The program returns the root object a constructor produced. The TypeScript signatures are reference only: write plain JavaScript, with no type annotations. Imports, files, and network access are disabled. A root object that no constructor produced is refused. Fragments are not validated as complete specifications; the root is validated when it is submitted. Bind the task rows by name with `data: { type: "json", name: "table", chromosomeField: "", genomicFields: ["", ...] }`, naming the rows' chromosome and genomic position fields, passed to the constructor that takes data. The host replaces each such reference with exactly the rows shown in the task before validation. Do not copy the rows into the specification: inline data is rejected. Tracks may filter or reuse the same rows. The program may also read the same rows, for example to compute domains: ```typescript declare function getData(): Promise>>; ``` The host accepts a submission only after JSON-Schema validation, native compilation, and a render without console, page, or network errors all succeed. A rejected constructor call or submission returns its 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. --- Constructor appendix: TypeScript signatures of the constructors in scope, generated from the Gosling 1.0.7 schema. They are reference only. ```typescript declare function create_aggregate(input: { value: "max" | "min" | "mean" | "bin" | "count" }): Promise; declare function create_assembly(input: { value: string | unknown[][] }): Promise; declare function create_axis_position(input: { value: "none" | "top" | "bottom" | "left" | "right" }): Promise; declare function create_bin_aggregate(input: { value: "mean" | "sum" }): Promise; interface X { aggregate?: string; axis?: string; domain?: Record; field?: string; grid?: boolean; legend?: boolean; linkingId?: string; range?: unknown[]; type?: string; } declare function create_x(input: X): Promise; declare function create_genomic_domain(input: { value: Record }): Promise; interface DomainInterval { interval: unknown[]; } declare function create_domain_interval(input: DomainInterval): Promise; interface DomainChrInterval { chromosome: string; interval: unknown[]; } declare function create_domain_chr_interval(input: DomainChrInterval): Promise; interface DomainChr { chromosome: string; } declare function create_domain_chr(input: DomainChr): Promise; declare function create_value_extent(input: { value: string[] | number[] }): Promise; interface Y { aggregate?: string; axis?: string; baseline?: string | number; domain?: ValueExtent | GenomicDomain; field?: string; flip?: boolean; grid?: boolean; legend?: boolean; linkingId?: string; range?: unknown[]; type?: "quantitative" | "nominal" | "genomic"; zeroBaseline?: boolean; } declare function create_y(input: Y): Promise; interface Row { clip?: boolean; domain?: unknown[]; field?: string; grid?: boolean; legend?: boolean; padding?: number; range?: unknown[]; type?: string; } declare function create_row(input: Row): Promise; interface Color { domain?: unknown[]; field?: string; legend?: boolean; range?: Range; scale?: "linear" | "log"; scaleOffset?: unknown[]; title?: string; type?: "quantitative" | "nominal"; } declare function create_color(input: Color): Promise; declare function create_range(input: { value: unknown[] | "viridis" | "grey" | "spectral" | "warm" | "cividis" | "bupu" | "rdbu" | "hot" | "pink" }): Promise; interface Size { domain?: unknown[]; field?: string; legend?: boolean; range?: unknown[]; type?: "quantitative" | "nominal"; } declare function create_size(input: Size): Promise; interface Stroke { domain?: unknown[]; field?: string; legend?: boolean; range?: Range; scaleOffset?: unknown[]; title?: string; type?: "quantitative" | "nominal"; } declare function create_stroke(input: Stroke): Promise; interface StrokeWidth { domain?: unknown[]; field?: string; range?: unknown[]; type?: "quantitative" | "nominal"; } declare function create_stroke_width(input: StrokeWidth): Promise; interface Opacity { domain?: unknown[]; field?: string; range?: unknown[]; type?: "quantitative" | "nominal"; } declare function create_opacity(input: Opacity): Promise; interface Text { domain?: unknown[]; field?: string; range?: unknown[]; type?: "quantitative" | "nominal"; } declare function create_text(input: Text): Promise; declare function create_channel_value(input: { value: number | string }): Promise; declare function create_data_deep(input: { value: { chromosomeField?: string; genomicFields?: unknown[]; genomicFieldsToConvert?: Record[]; sampleLength?: number; type: string; values: Record[] } | { chromosomeField?: string; chromosomePrefix?: string; genomicFields?: unknown[]; genomicFieldsToConvert?: Record[]; headerNames?: unknown[]; longToWideId?: string; sampleLength?: number; separator?: string; type: string; url: string } | { customFields?: unknown[]; indexUrl: string; sampleLength?: number; type: string; url: string } | { aggregation?: string; binSize?: number; column?: string; end?: string; start?: string; type: string; url: string; value?: string } | { aggregation?: string; binSize?: number; categories?: unknown[]; column?: string; end?: string; row?: string; start?: string; type: string; url: string; value?: string } | { exonIntervalFields?: unknown[]; genomicFields: Record[]; type: string; url: string; valueFields?: Record[] } | { binSize?: number; column?: string; row?: string; type: string; url: string; value?: string } | { extractJunction?: boolean; indexUrl: string; junctionMinCoverage?: number; loadMates?: boolean; maxInsertSize?: number; type: string; url: string } | { indexUrl: string; sampleLength?: number; type: string; url: string } | { attributesToFields?: Record[]; indexUrl: string; sampleLength?: number; type: string; url: string } | { type: string; name: string; chromosomeField: string; genomicFields: unknown[]; genomicFieldsToConvert?: Record[]; sampleLength?: number } }): Promise; declare function create_data_transform(input: { value: { field: string; not?: boolean; oneOf: unknown[]; type: string } | { field: string; inRange: unknown[]; not?: boolean; type: string } | { field: string; include: string; not?: boolean; type: string } | { fields: unknown[]; newField: string; separator: string; type: string } | { field: string; newField: string; replace: Record[]; type: string } | { base?: number | string; field: string; newField?: string; type: string } | { boundingBox: { endField: string; groupField?: string; isPaddingBP?: boolean; padding?: number; startField: string }; maxRows?: number; method: string; newField: string; type: string } | { fields: Record[]; flag: { field: string; value: number | string }; separator: string; type: string } | { endField: string; newField: string; startField: string; type: string } | { firstBp: { chrField: string; posField: string; strandField: string }; newField: string; secondBp: { chrField: string; posField: string; strandField: string }; type: string } | { endField: string; groupField?: string; newField?: string; startField: string; type: string } | { baseGenomicField: string; field: string; genomicField: string; genomicLengthField: string; type: string } }): Promise; declare function create_displacement_type(input: { value: "pile" | "spread" }): Promise; declare function create_field_type(input: { value: "genomic" | "nominal" | "quantitative" }): Promise; interface Displacement { padding?: number; type: string; } declare function create_displacement(input: Displacement): Promise; declare function create_orientation(input: { value: "horizontal" | "vertical" }): Promise; interface DummyTrackStyle { background?: string; outline?: string; textFontSize?: number; textFontWeight?: "bold" | "normal"; textStroke?: string; textStrokeWidth?: number; } declare function create_dummy_track_style(input: DummyTrackStyle): Promise; interface EventStyle { arrange?: "behind" | "front"; color?: string; opacity?: number; stroke?: string; strokeOpacity?: number; strokeWidth?: number; } declare function create_event_style(input: EventStyle): Promise; declare function create_layout(input: { value: "linear" | "circular" }): Promise; declare function create_logical_operation(input: { value: "less-than" | "lt" | "LT" | "greater-than" | "gt" | "GT" | "less-than-or-equal-to" | "ltet" | "LTET" | "greater-than-or-equal-to" | "gtet" | "GTET" }): Promise; declare function create_mark(input: { value: "point" | "line" | "area" | "bar" | "rect" | "text" | "withinLink" | "betweenLink" | "rule" | "triangleLeft" | "triangleRight" | "triangleBottom" | ... }): Promise; interface MouseEventsDeep { click?: boolean; enableMouseOverOnMultipleMarks?: boolean; groupMarksByField?: string; mouseOver?: boolean; rangeSelect?: boolean; } declare function create_mouse_events_deep(input: MouseEventsDeep): Promise; interface Style { align?: "left" | "right"; background?: string; backgroundOpacity?: number; brush?: { color?: string; opacity?: number; stroke?: string; strokeOpacity?: number; strokeWidth?: number }; curve?: "top" | "bottom" | "left" | "right"; dashed?: unknown[]; linePattern?: { size: number; type: "triangleLeft" | "triangleRight" }; } declare function create_style(input: Style): Promise