import { ArrayToFieldNames, ArrayToFields, Stream, StructToFields, TypeToFieldNames, TypeToFields } from '../data'; import { Variable, SetType, BooleanType, EastFunction } from '../east'; import { ArrayType, DateTimeType, DictType, EastType, FloatType, IntegerType, PrimitiveType, StringType, StructType, ValueTypeOf, BlobType, Nullable, NumericType } from '../east/types'; import { Builder, Template } from '../template/Template'; import { TableVisual, VegaVisual, ColumnType, TabVisual, PanelVisual, FormVisual, InputType, HeaderVisual, HeaderItem, CalendarVisual, TimelineVisual, TableWriteConfiguration, LayoutToolbar, KeyFieldType, ValueColumnType, BlobUploadVisual, PagedLayoutVisual, FlatLayoutVisual, AccordionLayoutVisual, PivotVisual, GridVisual, PrimitiveFieldType, WritableCollectionConfiguration, VegaViewSpec, CartesianView, RadialView, SpecView, ChatVisual, ChatThreadVisual, TimelineTaskType, TimelineBoundaryType, CalendarEventType } from './Visual'; import { PatchSourceBuilder } from '../source/SourceBuilder'; import { ModuleBuilder } from '../template/ModuleBuilder'; import { ModulePath } from '../template/Module'; import { Aggregate, ArcMark, AreaMark, AxisEncoding, BarMark, Bin, BoxPlotMark, ColorEncoding, ContinuousColorEncoding, DiscreteColorEncoding, DiscreteTimeUnit, LineMark, Mark, Normalize, NumericEncoding, PointMark, RectMark, SortOrder, StringEncoding, TemporalEncoding, TickMark, ValueSort } from './Chart'; import { LLMAssistantBuilder, LLMAssistantTaskDescription } from '../llm'; import { MapBuilder, MapFinalizer } from './Geo'; /** @internal */ type PlannerFinalizer = CalendarFinalizer | TimelineFinalizer; /** @internal a panel child builder type */ export type PanelChildBuilder = MapFinalizer | PivotFinalizer | VegaVisualFinalizer | TableFinalizer | TabBuilder | PanelBuilder | FormFinalizer | PlannerFinalizer | UploadFinalizer; /** @internal a panel child - either data or container visuals */ export type PanelChild = { builder: PanelChildBuilder; percentage: number; }; /** @internal a panel child builder type */ export type GridChildBuilder = PivotFinalizer | VegaVisualFinalizer | TableFinalizer | TabBuilder | FormFinalizer | PlannerFinalizer | UploadFinalizer; /** @internal a panel child - either data or container visuals */ export type GridChild = { builder: GridChildBuilder; x: number; y: number; w: number; h: number; is_static: boolean; min_w?: number; max_w?: number; min_h?: number; max_h?: number; }; /** @internal a tab child builder */ export type TabChildBuilder = MapFinalizer | PivotFinalizer | VegaVisualFinalizer | TableFinalizer | FormFinalizer | PlannerFinalizer | UploadFinalizer; /** @internal a section child builder type */ export type PageChildBuilder = MapFinalizer | PivotFinalizer | VegaVisualFinalizer | TableFinalizer | TabBuilder | PanelBuilder | GridBuilder | FormFinalizer | PlannerFinalizer | UploadFinalizer; /** @internal a section child - either data or container visuals */ export type PageChild = { builder: PageChildBuilder; title: string; }; /** @internal a accordion child builder type */ export type AccordionChildBuilder = MapFinalizer | PivotFinalizer | VegaVisualFinalizer | TableFinalizer | TabBuilder | PanelBuilder | GridBuilder | FormFinalizer | PlannerFinalizer | UploadFinalizer; /** @internal a accordion child - either data or container visuals */ export type AccordionChild = { builder: PageChildBuilder; title: string; }; /** @internal the definition for a table or form field */ type ValueDefinition = Record, V extends EastType = PrimitiveType, F extends Record = Record> = V extends DateTimeType ? { /** The {@link Variable} to display. **/ value: (fields: F) => Variable; /** The string value {@link Variable} to display. **/ display?: (fields: F, inputs: Inputs) => EastFunction; /** The minimum {@link Variable} to allow as input. **/ min?: Date | ((fields: F, inputs: Inputs) => EastFunction); /** The maximum {@link Variable} to allow as input. **/ max?: Date | ((fields: F, inputs: Inputs) => EastFunction); /** The column is read only. **/ readonly?: boolean | ((fields: F, inputs: Inputs) => EastFunction); /** The input target value {@link Variable} **/ target?: Date | ((fields: F, inputs: Inputs) => EastFunction); /** The string value {@link Variable} to display. **/ target_display?: (fields: F, inputs: Inputs) => EastFunction; /** The cell background color {@link Variable} **/ background?: string | ((fields: F) => EastFunction); /** The cell text color {@link Variable} **/ color?: string | ((fields: F) => EastFunction); /** The cell tooltip {@link Variable} **/ tooltip?: ValueTypeOf | ((fields: F) => EastFunction); /** The visibility of the field **/ hidden?: boolean; /** The visibility of the field in a detail view **/ hidden_detail?: boolean; } : V extends FloatType ? { /** The {@link Variable} to display. **/ value: (fields: F) => Variable; /** The string value {@link Variable} to display. **/ display?: (fields: F, inputs: Inputs) => EastFunction; /** The minimum {@link Variable} to allow as input. **/ min?: number | ((fields: F, inputs: Inputs) => EastFunction); /** The maximum {@link Variable} to allow as input. **/ max?: number | ((fields: F, inputs: Inputs) => EastFunction); /** The column is read only. **/ readonly?: boolean | ((fields: F, inputs: Inputs) => EastFunction); /** The input target value {@link Variable} **/ target?: number | ((fields: F, inputs: Inputs) => EastFunction); /** The string value {@link Variable} to display. **/ target_display?: (fields: F, inputs: Inputs) => EastFunction; /** The cell background color {@link Variable} **/ background?: string | ((fields: F) => EastFunction); /** The cell text color {@link Variable} **/ color?: string | ((fields: F) => EastFunction); /** The cell tooltip {@link Variable} **/ tooltip?: ValueTypeOf | ((fields: F) => EastFunction); /** The visibility of the field **/ hidden?: boolean; /** The visibility of the field in a detail view **/ hidden_detail?: boolean; } : V extends IntegerType ? { /** The {@link Variable} to display. **/ value: (fields: F) => Variable; /** The string value {@link Variable} to display. **/ display?: (fields: F, inputs: Inputs) => EastFunction; /** The minimum {@link Variable} to allow as input. **/ min?: bigint | ((fields: F, inputs: Inputs) => EastFunction); /** The maximum {@link Variable} to allow as input. **/ max?: bigint | ((fields: F, inputs: Inputs) => EastFunction); /** The column is read only. **/ readonly?: boolean | ((fields: F, inputs: Inputs) => EastFunction); /** The input target value {@link Variable} **/ target?: bigint | ((fields: F, inputs: Inputs) => EastFunction); /** The string value {@link Variable} to display. **/ target_display?: (fields: F, inputs: Inputs) => EastFunction; /** The cell background color {@link Variable} **/ background?: string | ((fields: F) => EastFunction); /** The cell text color {@link Variable} **/ color?: string | ((fields: F) => EastFunction); /** The cell tooltip {@link Variable} **/ tooltip?: ValueTypeOf | ((fields: F) => EastFunction); /** The visibility of the field **/ hidden?: boolean; /** The visibility of the field in a detail view **/ hidden_detail?: boolean; } : V extends StringType ? { /** The {@link Variable} to display. **/ value: (fields: F) => Variable; /** The string value {@link Variable} to display. **/ display?: (fields: F, inputs: Inputs) => EastFunction; /** The range {@link Variable} to allow as input. **/ range?: Set | Map> | ((fields: F, inputs: Inputs) => EastFunction> | EastFunction>>); /** The column is read only. **/ readonly?: boolean | ((fields: F, inputs: Inputs) => EastFunction); /** The input target value {@link Variable} **/ target?: string | ((fields: F, inputs: Inputs) => EastFunction); /** The string value {@link Variable} to display. **/ target_display?: (fields: F, inputs: Inputs) => EastFunction; /** The cell background color {@link Variable} **/ background?: string | ((fields: F) => EastFunction); /** The cell text color {@link Variable} **/ color?: string | ((fields: F) => EastFunction); /** The cell tooltip {@link Variable} **/ tooltip?: ValueTypeOf | ((fields: F) => EastFunction); /** The visibility of the field **/ hidden?: boolean; /** The visibility of the field in a detail view **/ hidden_detail?: boolean; } : V extends SetType ? { /** The {@link Variable} to display. **/ value: (fields: F) => Variable; /** The string value {@link Variable} to display. **/ display?: (fields: F, inputs: Inputs) => EastFunction; /** The range {@link Variable} to allow as input. **/ range?: Set | Map> | ((fields: F, inputs: Inputs) => EastFunction> | EastFunction>>); /** The column is read only. **/ readonly?: boolean | ((fields: F, inputs: Inputs) => EastFunction); /** The input target value {@link Variable} **/ target?: Set | ((fields: F, inputs: Inputs) => EastFunction); /** The string value {@link Variable} to display. **/ target_display?: (fields: F, inputs: Inputs) => EastFunction; /** The cell background color {@link Variable} **/ background?: string | ((fields: F) => EastFunction); /** The cell text color {@link Variable} **/ color?: string | ((fields: F) => EastFunction); /** The cell tooltip {@link Variable} **/ tooltip?: ValueTypeOf | ((fields: F) => EastFunction); /** The visibility of the field **/ hidden?: boolean; /** The visibility of the field in a detail view **/ hidden_detail?: boolean; } : V extends BooleanType ? { /** The {@link Variable} to display. **/ value: (fields: F) => Variable; /** The string value {@link Variable} to display. **/ display?: (fields: F, inputs: Inputs) => EastFunction; /** The column is read only. **/ readonly?: boolean | ((fields: F, inputs: Inputs) => EastFunction); /** The input target value {@link Variable} **/ target?: boolean | ((fields: F, inputs: Inputs) => EastFunction); /** The string value {@link Variable} to display. **/ target_display?: (fields: F, inputs: Inputs) => EastFunction; /** The cell background color {@link Variable} **/ background?: string | ((fields: F) => EastFunction); /** The cell text color {@link Variable} **/ color?: string | ((fields: F) => EastFunction); /** The cell tooltip {@link Variable} **/ tooltip?: ValueTypeOf | ((fields: F) => EastFunction); /** The visibility of the field **/ hidden?: boolean; /** The visibility of the field in a detail view **/ hidden_detail?: boolean; } : { /** The {@link Variable} to display. **/ value: (fields: F) => Variable; /** The string value {@link Variable} to display. **/ display?: (fields: F, inputs: Inputs) => EastFunction; /** The column is read only. **/ readonly?: true; /** The cell background color {@link Variable} **/ background?: string | ((fields: F) => EastFunction); /** The cell text color {@link Variable} **/ color?: string | ((fields: F) => EastFunction); /** The cell tooltip {@link Variable} **/ tooltip?: ValueTypeOf | ((fields: F) => EastFunction); /** The visibility of the field **/ hidden?: boolean; /** The visibility of the field in a detail view **/ hidden_detail?: boolean; }; /** * Define a UI Table from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .float("Float", fields => fields.float) * ) * .toTemplate() * ``` */ export declare class TableBuilder { private name; private module; /** * Define a UI Table from a {@link Stream} within a {@link LayoutBuilder}. * * @param name the name for the {@link TableBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .float("Float", fields => fields.float) * ) * .toTemplate() * ``` */ constructor(name: string, module: ModulePath); /** * Define the {@link Stream} to build a {@link TableBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link DictType} or {@link ArrayType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .toTemplate() * ``` */ fromStream | ArrayType>(stream: Stream): T extends DictType ? DictStructTableFinalizer<{}, T, {}> : T extends ArrayType ? ArrayTableFinalizer<{}, T, {}> : T extends DictType ? PrimitiveTableFinalizer : never; /** * Define the {@link PatchSourceBuilder} to build an editable {@link TableBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link DictType} or {@link ArrayType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * const patch = new SourceBuilder("My Patch") * .patch(products_data.outputStream()) * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromPatch(patch) * .columns() * ) * .toTemplate() * ``` */ fromPatch>(patch: PatchSourceBuilder): DictStructTableFinalizer<{}, T, {}>; } /** * {@inheritDoc TableBuilder} * * @category Layout * */ export declare class DictStructTableFinalizer = Record, T extends DictType = DictType, Fields extends Record = Record> { name: string; protected module: ModulePath; protected stream: Stream; protected table_columns: Fields; protected inputs: Inputs; protected input_streams: Record; protected writable: TableWriteConfiguration; protected key_column: KeyFieldType; protected names: [string, string][]; /** @internal */ constructor(name: string, module: ModulePath, stream: Stream, table_columns: Fields, inputs: Inputs, input_streams: Record, writable: TableWriteConfiguration, key_column?: KeyFieldType, names?: [string, string][]); /** * Define if the {@link Stream} key should be visible in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param show an optional boolean that defines if the key is visible - defaults to `true` * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey("Key") * ) * .toTemplate() * ``` */ showKey(label: Name): DictStructTableFinalizer; /** * Disable row update for the {@link TableBuilder} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .disableUpdate() * ) * .toTemplate() * ``` */ disableUpdate(): DictStructTableFinalizer; /** * Disable row add for the {@link TableBuilder} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .disableAdd() * ) * .toTemplate() * ``` */ disableAdd(): DictStructTableFinalizer; /** * Disable row remove for the {@link TableBuilder} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .disableRemove() * ) * .toTemplate() * ``` */ disableRemove(): DictStructTableFinalizer; /** * Disable row remove for the {@link TableBuilder} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .disableRemove() * ) * .toTemplate() * ``` */ disableUndo(): DictStructTableFinalizer; /** * Add an additional named input {@link Stream} to the {@link Visual}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const value = Stream("Value", StringType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .input({ name: "value", stream: value }) * .string("String", { * value: fields => fields.string, * target: (_fields, inputs) => inputs.value * ) * ) * .toTemplate() * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): DictStructTableFinalizer; }, T, Fields>; /** @internal */ toVisual(): TableVisual; /** * Create a {@link DateTimeType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * ) * .toTemplate() * ``` */ date(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): DictStructTableFinalizer; date(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): DictStructTableFinalizer; /** * Create a {@link FloatType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * float: FloatType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .float("Float", fields => fields.float) * ) * .toTemplate() * ``` */ float(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): DictStructTableFinalizer; float(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): DictStructTableFinalizer; /** * Create a {@link IntegerType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * integer: IntegerType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .integer("Integer", fields => fields.integer) * ) * .toTemplate() * ``` */ integer(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): DictStructTableFinalizer; integer(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): DictStructTableFinalizer; /** * Create a {@link StringType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .string("String", fields => fields.string) * ) * .toTemplate() * ``` */ string(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): DictStructTableFinalizer; string(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): DictStructTableFinalizer; /** * Create a {@link BooleanType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * boolean: BooleanType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .boolean("Boolean", fields => fields.boolean) * ) * .toTemplate() * ``` */ boolean(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): DictStructTableFinalizer; boolean(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): DictStructTableFinalizer; /** * Create a {@link SetType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * set: SetType(StringType), * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .set("Set", fields => fields.set) * ) * .toTemplate() * ``` */ set(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): DictStructTableFinalizer; set(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): DictStructTableFinalizer; /** * Define a {@link ArrayType} input in a {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * array: ArrayType(StructType({ * string: StringType * })), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .array("Array", fields => fields.array, builder => * builder.string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ array) => Variable>>(name: Name extends keyof Fields ? never : Name, value: F, def: (builder: FieldFinalizer["type"]["value"], Inputs, {}>) => FieldFinalizer["type"]["value"], Inputs>, config?: { readonly?: boolean | ((fields: TypeToFields, inputs: Inputs) => EastFunction); hidden?: boolean; hidden_detail?: boolean; }): DictStructTableFinalizer; /** * Define a {@link DictType} input in a {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * string: StringType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Dict", fields => fields.dict, builder => * builder.string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ dict) => Variable>>(name: Name extends keyof Fields ? never : Name, value: F, def: (builder: FieldFinalizer["type"]["value"]["value"], Inputs, {}>) => FieldFinalizer["type"]["value"]["value"], Inputs>, config?: { readonly?: boolean | ((fields: TypeToFields, inputs: Inputs) => EastFunction); hidden?: boolean; hidden_detail?: boolean; }): DictStructTableFinalizer; /** * Create multiple value columns in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param cols the definition of the columns * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * integer: IntegerType, * boolean: BooleanType, * struct: Nullable(StructType({ * string: Nullable(StringType), * date: DateTimeType, * float: FloatType, * integer: Nullable(IntegerType), * boolean: Nullable(BooleanType), * array: Nullable(ArrayType(FloatType)), * struct: Nullable( * StructType({ * string: Nullable(StringType), * date: DateTimeType, * float: FloatType, * integer: Nullable(IntegerType), * boolean: Nullable(BooleanType), * })), * })), * }) * ) * ); * * // create a table with all columns * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .toTemplate() * * // create a table with some columns * const layout2 = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns({ * "Date": (fields) => fields.date, * "Integer": (fields) => fields.integer, * "Float": (fields) => fields.float, * "String": (fields) => fields.string, * "Boolean": (fields) => fields.boolean, * "Array": (fields) => fields.array, * "Struct": (fields) => fields.struct * }) * ) * .toTemplate() * ``` * */ columns) => Variable>>(def?: S): DictStructTableFinalizer; } /** * {@inheritDoc TableBuilder} * * @category Layout * */ export declare class ArrayTableFinalizer = Record, T extends ArrayType = ArrayType, Fields extends Record = Record> { name: string; protected module: ModulePath; protected stream: Stream; protected table_columns: Fields; protected inputs: Inputs; protected input_streams: Record; protected writable: TableWriteConfiguration; protected key_column: KeyFieldType; protected names: [string, string][]; /** @internal */ constructor(name: string, module: ModulePath, stream: Stream, table_columns: Fields, inputs: Inputs, input_streams: Record, writable: TableWriteConfiguration, key_column?: KeyFieldType, names?: [string, string][]); /** * Define if the {@link Stream} key should be visible in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param show an optional boolean that defines if the key is visible - defaults to `true` * * @category Layout * * @example * ```typescript * // use a ArrayType stream * const stream = Stream( * "My Stream", * ArrayType( * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey("Key") * ) * .toTemplate() * ``` */ showKey(label: Name): ArrayTableFinalizer; /** @internal */ toVisual(): TableVisual; /** * Create a {@link DateTimeType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a ArrayType stream * const stream = Stream( * "My Stream", * ArrayType( * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * ) * .toTemplate() * ``` */ date(name: Name extends keyof Fields ? never : Name, def: (fields: ArrayToFields) => Variable): ArrayTableFinalizer; /** * Create a {@link FloatType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a ArrayType stream * const stream = Stream( * "My Stream", * ArrayType( * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .float("Float", fields => fields.float) * ) * .toTemplate() * ``` */ float(name: Name extends keyof Fields ? never : Name, def: (fields: ArrayToFields) => Variable): ArrayTableFinalizer; /** * Create a {@link IntegerType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a ArrayType stream * const stream = Stream( * "My Stream", * ArrayType( * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .integer("Integer", fields => fields.integer) * ) * .toTemplate() * ``` */ integer(name: Name extends keyof Fields ? never : Name, def: (fields: ArrayToFields) => Variable): ArrayTableFinalizer; /** * Create a {@link StringType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a ArrayType stream * const stream = Stream( * "My Stream", * ArrayType( * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .string("String", fields => fields.string) * ) * .toTemplate() * ``` */ string(name: Name extends keyof Fields ? never : Name, def: (fields: ArrayToFields) => Variable): ArrayTableFinalizer; /** * Create a {@link BooleanType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a ArrayType stream * const stream = Stream( * "My Stream", * ArrayType( * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .boolean("Boolean", fields => fields.boolean) * ) * .toTemplate() * ``` */ boolean(name: Name extends keyof Fields ? never : Name, def: (fields: ArrayToFields) => Variable): ArrayTableFinalizer; /** * Create a {@link SetType} column in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the column * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a ArrayType stream * const stream = Stream( * "My Stream", * ArrayType( * StructType({ * string: StringType, * set: SetType(StringType), * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .set("Set", fields => fields.set) * ) * .toTemplate() * ``` */ set(name: Name extends keyof Fields ? never : Name, def: (fields: ArrayToFields) => Variable): ArrayTableFinalizer; /** * Create multiple value columns in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param cols the definition of the columns * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * ArrayType( * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * integer: IntegerType, * boolean: BooleanType, * struct: Nullable(StructType({ * string: Nullable(StringType), * date: DateTimeType, * float: FloatType, * integer: Nullable(IntegerType), * boolean: Nullable(BooleanType), * array: Nullable(ArrayType(FloatType)), * struct: Nullable( * StructType({ * string: Nullable(StringType), * date: DateTimeType, * float: FloatType, * integer: Nullable(IntegerType), * boolean: Nullable(BooleanType), * })), * })), * }) * ) * ); * * // create a table with all columns * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .toTemplate() * * // create a table with some columns * const layout2 = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns({ * "Date": (fields) => fields.date, * "Integer": (fields) => fields.integer, * "Float": (fields) => fields.float, * "String": (fields) => fields.string, * "Boolean": (fields) => fields.boolean, * "Array": (fields) => fields.array, * "Struct": (fields) => fields.struct * }) * ) * .toTemplate() * ``` * */ columns) => Variable>>(def?: S): ArrayTableFinalizer; } /** * {@inheritDoc TableBuilder} * * @category Layout * */ export declare class PrimitiveTableFinalizer = DictType, Fields extends Record = Record> { name: string; protected stream: Stream; protected writable: TableWriteConfiguration; protected key_column: KeyFieldType; protected value_column: ValueColumnType; /** @internal */ constructor(name: string, stream: Stream, writable: TableWriteConfiguration, key_column?: KeyFieldType, value_column?: ValueColumnType); /** * Define if the {@link Stream} key should be visible in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param show an optional boolean that defines if the key is visible - defaults to `true` * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * DateTimeType * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .showKey("Key") * ) * .toTemplate() * ``` */ showKey(label: Name): PrimitiveTableFinalizer; /** * Define if the {@link Stream} key should be visible in the {@link TableBuilder} within a {@link LayoutBuilder}. * * @param show an optional boolean that defines if the key is visible - defaults to `true` * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * DateTimeType * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .showKey(false) * ) * .toTemplate() * ``` */ showValue(label?: Name): PrimitiveTableFinalizer; /** @internal */ toVisual(): TableVisual; } /** * {@inheritDoc TableBuilder} * * @category Layout * */ export type TableFinalizer = PrimitiveTableFinalizer | DictStructTableFinalizer | ArrayTableFinalizer; /** * Define a UI Form from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * integer: IntegerType, * boolean: BooleanType, * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * .float("Float", fields => fields.float) * ) * .toTemplate() * ``` */ export declare class FormBuilder { private name; private module; /** * Define a UI Form from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * integer: IntegerType, * boolean: BooleanType, * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * .float("Float", fields => fields.float) * ) * .toTemplate() * ``` */ constructor(name: string, module: ModulePath); /** * Define the {@link Stream} to build a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link StructType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * integer: IntegerType, * boolean: BooleanType, * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .inputs() * ) * .toTemplate() * ``` */ fromStream(stream: Stream): FormFinalizer<{}, T, {}>; } /** * Define a fields within a Table Collection within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * string: StringType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder.string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ export declare class FieldFinalizer = Record, Fields extends Record = Record> { name: string; protected type: T; protected form_inputs: Fields; protected inputs: Inputs; protected input_streams: Record; protected names: [string, string][]; protected writable: WritableCollectionConfiguration; /** @internal */ constructor(name: string, type: T, form_inputs: Fields, inputs: Inputs, input_streams: Record, names?: [string, string][], writable?: WritableCollectionConfiguration); /** * Disable row insert for the {@link FieldFinalizer} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * date: DateTimeType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder * .date("Date", fields => fields.date) * .disableInsert() * ) * ) * .toTemplate() * ``` */ disableInsert(): FieldFinalizer; /** * Disable row delete for the {@link FieldFinalizer} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * date: DateTimeType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder * .date("Date", fields => fields.date) * .disableDelete() * ) * ) * .toTemplate() * ``` */ disableDelete(): FieldFinalizer; /** * Define a {@link DateTimeType} input in a {@link FieldFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the field label * @param def the definition of the field input * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * date: DateTimeType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder.date("Date", fields => fields.date) * ) * ) * .toTemplate() * ``` */ date(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FieldFinalizer; /** * Define a {@link FloatType} input in a {@link FieldFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the field label * @param def the definition of the field input * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * float: FloatType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder.float("Float", fields => fields.float) * ) * ) * .toTemplate() * ``` */ float(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FieldFinalizer; /** * Define a {@link IntegerType} input in a {@link FieldFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the field label * @param def the definition of the field input * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * integer: IntegerType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder.integer("Integer", fields => fields.integer) * ) * ) * .toTemplate() * ``` */ integer(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FieldFinalizer; /** * Define a {@link StringType} input in a {@link FieldFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the field label * @param def the definition of the field input * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * string: StringType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder.string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ string(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FieldFinalizer; /** * Define a {@link StringType} input in a {@link FieldFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the field label * @param def the definition of the field input * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * set: SetType(StringType) * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder.set("Set", fields => fields.set) * ) * ) * .toTemplate() * ``` */ set(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FieldFinalizer; /** * Define a {@link BooleanType} input in a {@link FieldFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the field label * @param def the definition of the field input * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * dict: DictType( * StringType, * StructType({ * boolean: BooleanType * }) * ), * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder.boolean("Boolean", fields => fields.boolean) * ) * ) * .toTemplate() * ``` */ boolean(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FieldFinalizer; } /** * {@inheritDoc FormBuilder} * * @category Layout * */ export declare class FormFinalizer = Record, T extends StructType = StructType, Fields extends Record = Record> { name: string; protected module: ModulePath; protected stream: Stream; protected form_inputs: Fields; protected inputs: Inputs; protected input_streams: Record; protected writable: TableWriteConfiguration; protected names: [string, string][]; /** @internal */ constructor(name: string, module: ModulePath, stream: Stream, form_inputs: Fields, inputs: Inputs, input_streams: Record, writable?: TableWriteConfiguration, names?: [string, string][]); /** @internal */ toVisual(): FormVisual; /** * Disable row update for the {@link TableBuilder} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .disableUpdate() * ) * .toTemplate() * ``` */ disableUpdate(): FormFinalizer; /** * Add an additional named input {@link Stream} to the {@link Visual}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const value = Stream("Value", StringType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .input({ name: "value", stream: value }) * .string("String", { * value: fields => fields.string, * target: (_fields, inputs) => inputs.value * ) * ) * .toTemplate() * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): FormFinalizer; }, T, Fields>; /** * Define a {@link DateTimeType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the form label * @param def the definition of the form input * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * date: DateTimeType, * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * ) * .toTemplate() * ``` */ date(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FormFinalizer; /** * Define a {@link FloatType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the form label * @param def the definition of the form input * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * float: FloatType, * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .float("Float", fields => fields.float) * ) * .toTemplate() * ``` */ float(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FormFinalizer; /** * Define a {@link IntegerType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the form label * @param def the definition of the form input * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * integer: IntegerType, * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .integer("Integer", fields => fields.integer) * ) * .toTemplate() * ``` */ integer(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FormFinalizer; /** * Define a {@link StringType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the form label * @param def the definition of the form input * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .string("String", fields => fields.string) * ) * .toTemplate() * ``` */ string(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FormFinalizer; /** * Define a {@link StringType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the form label * @param def the definition of the form input * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * set: SetType(StringType), * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .set("Set", fields => fields.set) * ) * .toTemplate() * ``` */ set(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FormFinalizer; /** * Define a {@link ArrayType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the field * @param def the definition of the field * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * StructType({ * array: ArrayType(StructType({ * string: StringType * })), * }) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .array("Array", fields => fields.array, builder => * builder.string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ array) => Variable>>(name: Name extends keyof Fields ? never : Name, value: F, def: (builder: FieldFinalizer["type"]["value"], Inputs, {}>) => FieldFinalizer["type"]["value"], Inputs>, config?: { readonly?: boolean | ((fields: StructToFields, inputs: Inputs) => EastFunction); hidden_detail?: boolean; }): FormFinalizer; /** * Define a {@link DictType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the field * @param def the definition of the field * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * StructType({ * dict: DictType( * StringType, * StructType({ * string: StringType * }) * ), * }) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .dict("Array", fields => fields.dict, builder => * builder.string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ dict) => Variable>>(name: Name extends keyof Fields ? never : Name, value: F, def: (builder: FieldFinalizer["type"]["value"]["value"], Inputs, {}>) => FieldFinalizer["type"]["value"]["value"], Inputs>, config?: { readonly?: boolean | ((fields: StructToFields, inputs: Inputs) => EastFunction); hidden_detail?: boolean; }): FormFinalizer; /** * Define a {@link BooleanType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the form label * @param def the definition of the form input * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * boolean: BooleanType, * }), * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .boolean("Boolean", fields => fields.boolean) * ) * .toTemplate() * ``` */ boolean(name: Name extends keyof Fields ? never : Name, def: Omit>, 'hidden'>): FormFinalizer; } /** * Define a UI Chart based on a Vega-Lite specification from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .line({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * )) * .toTemplate() * * ``` */ export declare class VegaBuilder { private name; private module; /** * Define a UI Chart based on a Vega-Lite specification from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .fromStream(stream) * .spec((fields) => ({ * $schema: "https://vega.github.io/schema/vega-lite/v5.json", * title: "My Chart", * mark: "point", * encoding: { * x: { field: fields.date, type: 'temporal', title: `Date Range` }, * y: { field: fields.integer, type: 'quantitative' }, * color: { field: fields.string, type: 'nominal' }, * tooltip: [ * { field: fields.date, aggregate: 'min', type: 'temporal' }, * { field: fields.integer, aggregate: 'max', type: 'quantitative' }, * { field: fields.float, type: 'quantitative' }, * ] * } * }) * )) * .toTemplate() * * // create an area chart in a layout * const layout2 = new LayoutBuilder("My Other Layout") * .vega("My Area Chart", builder => builder * .fromStream(stream) * .area({ * x: (fields) => fields.string, * y: (fields) => fields.float, * }) * ) * .toTemplate() * ``` */ constructor(name: string, module: ModulePath); /** * Define a UI Chart based on a single Vega-Lite specification from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .line({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * )) * .toTemplate() * * ``` */ view(f: (builder: VegaViewBuilder) => VegaUnitSpecFinalizer): VegaViewVisualFinalizer; /** * Define a UI Chart based on layered Vega-Lite specifications from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .layered(builder => builder * .layer( * builder => builder * .fromStream(stream) * .line({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * .layer( * builder => builder * .fromStream(stream) * .scatter({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * ) * )) * .toTemplate() * * ``` */ layered(f: (builder: VegaLayeredBuilder) => VegaLayeredBuilder): VegaLayeredBuilder; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaViewBuilder { protected name: string; private module; /** @internal */ constructor(name: string, module: ModulePath); fromStream | ArrayType>(stream: Stream): VegaViewSpecifier; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaViewSpecifier | ArrayType = DictType | ArrayType> { protected name: string; protected stream: Stream; /** @internal */ constructor(name: string, stream: Stream); /** * Define a unit Vega-Lite specification for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @remarks The data is automatically defined from the stream contents, so is to be excluded from the definition. * * @param def a function returning the Vega-Lite specification from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * * // create a layered vega specification in a layout * const layout = new LayoutBuilder("My Other Layout") * .vega("My Chart", builder => builder * builder.fromStream(stream) * .unitSpec((fields) => ({ * $schema: "https://vega.github.io/schema/vega-lite/v5.json", * title: "", * mark: "point", * encoding: { * x: { field: fields.date, type: 'temporal', title: `Date Range` }, * y: { field: fields.integer, type: 'quantitative' }, * color: { * field: fields.float, * type: 'quantitative', * }, * tooltip: [ * { field: fields.date, aggregate: 'min', type: 'temporal' }, * { field: fields.integer, aggregate: 'max', type: 'quantitative' }, * { field: fields.float, type: 'quantitative' }, * ] * } * }))) * ``` */ spec ? TypeToFieldNames : T extends ArrayType ? ArrayToFieldNames : never)>(def: (fields: F) => Omit): T extends DictType ? VegaSpecViewFinalizer, T> : T extends ArrayType ? VegaSpecViewFinalizer, T> : never; /** @internal */ private toFormatEncodings; /** * Define a [Heatmap](https://vega.github.io/vega-lite/examples/rect_heatmap_weather.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .heatmap({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.string) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.float) * .title("Color Title") * }) * ) * )) * .toTemplate() * * ``` */ heatmap(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Scatter](https://vega.github.io/vega-lite/examples/point_2d.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .heatmap({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * )) * .toTemplate() * * ``` */ scatter(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the size value {@link https://vega.github.io/vega-lite/docs/encoding.html#mark-prop} */ shape?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the size value {@link https://vega.github.io/vega-lite/docs/encoding.html#mark-prop} */ size?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Area](https://vega.github.io/vega-lite/examples/area.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .area({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * )) * .toTemplate() * * ``` */ area(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the second y value {@link https://vega.github.io/vega-lite/docs/encoding.html#position} */ y2?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Line](https://vega.github.io/vega-lite/examples/line.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .line({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * )) * .toTemplate() * * ``` */ line(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Bar](https://vega.github.io/vega-lite/examples/bar.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .bar({ * x: builder => builder * .value(fields => fields.float) * .title("X Title") * .aggregate('sum') * .sort('descending'), * y: builder => builder * .value(fields => fields.string) * .title("Y Title") * .sort('ascending'), * }) * ) * )) * .toTemplate() * * ``` */ bar(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Ranged Bar](https://vega.github.io/vega-lite/examples/bar_gantt.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .range({ * x: builder => builder * .value(fields => fields.float) * .title("X Title") * .aggregate('max') * .sort('descending'), * x: builder => builder * .value(fields => Add(fields.float, 1)) * .title("X Title") * .aggregate('max') * .sort('descending'), * y: builder => builder * .value(fields => fields.string) * .title("Y Title") * .sort('ascending'), * }) * ) * )) * .toTemplate() * ``` */ range(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the second x value {@link https://vega.github.io/vega-lite/docs/encoding.html#position} */ x2: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Strip](https://vega.github.io/vega-lite/examples/tick_strip.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .strip({ * x: builder => builder * .value(fields => fields.float) * .title("X Title") * .aggregate('sum') * .sort('descending'), * y: builder => builder * .value(fields => fields.string) * .title("Y Title") * .sort('ascending'), * }) * ) * )) * .toTemplate() * * ``` */ strip(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Column](https://vega.github.io/vega-lite/examples/bar.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .column({ * x: builder => builder * .value(fields => fields.string) * .title("X Title") * .sort('ascending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .aggregate('sum') * .sort('descending'), * }) * ) * )) * .toTemplate() * * ``` */ column(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Pie](https://vega.github.io/vega-lite/examples/arc_pie.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .pie({ * angle: builder => builder * .value(fields => fields.float) * .title("Angle Title") * .aggregate('sum') * .sort('descending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * .sort('ascending'), * }) * ) * )) * .toTemplate() * * ``` */ pie(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit; /** the definition and {@link EastFunction} for the [angle value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ angle: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaRadialViewFinalizer; /** * Define a [Boxplot](https://vega.github.io/vega-lite/examples/boxplot_minmax_2D_vertical.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .boxPlot({ * x: builder => builder * .value(fields => fields.string) * .title("X Title") * .sort('ascending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('descending'), * }) * ) * )) * .toTemplate() * * ``` */ boxPlot(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit, 'kind'>; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Boxplot](https://vega.github.io/vega-lite/examples/boxplot_minmax_2D_vertical.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .errorBand({ * x: builder => builder * .value(fields => fields.string) * .title("X Title") * .sort('ascending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('descending'), * }) * ) * )) * .toTemplate() * * ``` */ errorBand(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit, 'kind'>; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; /** * Define a [Boxplot](https://vega.github.io/vega-lite/examples/boxplot_minmax_2D_vertical.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .errorBar({ * x: builder => builder * .value(fields => fields.string) * .title("X Title") * .sort('ascending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('descending'), * }) * ) * )) * .toTemplate() * * ``` */ errorBar(def: { /** the definition of the chart [mark](https://vega.github.io/vega-lite/docs/mark.html) */ mark?: Omit, 'kind'>; /** the definition and {@link EastFunction} for the [x value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ x: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [y value](https://vega.github.io/vega-lite/docs/encoding.html#position) */ y: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [color value](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ color?: (builder: VegaColorEncodingSpecifier) => VegaColorEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill and stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [fill opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ fill_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke opacity](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_opacity?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke width](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop)*/ stroke_width?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [stroke dash](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) */ stroke_dash?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; /** the definition and {@link EastFunction} for the [detail](https://vega.github.io/vega-lite/docs/encoding.html#detail) */ detail?: (builder: VegaFieldEncodingBuilder) => VegaFieldEncodingFinalizer; }): VegaCartesianViewFinalizer; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaSpecViewFinalizer = Record, T extends DictType | ArrayType = DictType | ArrayType> { name: string; protected stream: Stream; protected spec: VegaViewSpec; protected fields: Fields; /** @internal */ constructor(name: string, stream: Stream, spec: VegaViewSpec, fields?: Fields); /** @internal */ toView(): SpecView; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export type VegaUnitSpecFinalizer = VegaSpecViewFinalizer | VegaCartesianViewFinalizer | VegaRadialViewFinalizer; /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaLayeredBuilder { name: string; private module; private views; /** @internal */ constructor(name: string, module: ModulePath, views: VegaUnitSpecFinalizer[]); /** * Add a UI Chart layer based on layered Vega-Lite specifications from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .layered(builder => builder * .view( * builder => builder * .fromStream(stream) * .line({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * .view( * builder => builder * .fromStream(stream) * .scatter({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * ) * )) * .toTemplate() * * ``` */ view(f: (builder: VegaViewBuilder) => VegaUnitSpecFinalizer): VegaLayeredBuilder; /** @internal */ toVisual(): VegaVisual; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaViewVisualFinalizer { name: string; private view; /** @internal */ constructor(name: string, view: VegaUnitSpecFinalizer); /** @internal */ toVisual(): VegaVisual; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export type VegaVisualFinalizer = VegaViewVisualFinalizer | VegaLayeredBuilder; /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaFieldEncodingBuilder | ArrayType = DictType | ArrayType, E extends PrimitiveType = PrimitiveType> { name: string; protected stream: Stream; /** @internal */ constructor(name: string, stream: Stream); /** * Define a vega field encoding for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Vega-Lite Chart", builder => builder * .view( * builder => builder * .fromStream(stream) * .heatmap({ * x: builder => builder * .value(fields => fields.date) * .title("X Title") * .sort('descending'), * y: builder => builder * .value(fields => fields.float) * .title("Y Title") * .sort('ascending'), * color: builder => builder * .value(fields => fields.string) * .title("Color Title") * }) * ) * )) * .toTemplate() * * ``` */ value ? TypeToFields : T extends ArrayType ? ArrayToFields : never), V extends E = E>(f: (fields: F) => EastFunction): V extends DateTimeType ? VegaDateTimeEncodingFinalizer : V extends IntegerType ? VegaIntegerEncodingFinalizer : V extends FloatType ? VegaFloatEncodingFinalizer : V extends StringType ? VegaStringEncodingFinalizer : never; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaDateTimeEncodingFinalizer { name: string; protected value: EastFunction; protected sortValue?: ValueSort | undefined; protected unitValue?: DiscreteTimeUnit | undefined; protected titleValue?: string | undefined; protected typeValue?: "nominal" | "ordinal" | "quantitative" | "temporal" | undefined; /** @internal */ constructor(name: string, value: EastFunction, sortValue?: ValueSort | undefined, unitValue?: DiscreteTimeUnit | undefined, titleValue?: string | undefined, typeValue?: "nominal" | "ordinal" | "quantitative" | "temporal" | undefined); title(def: string): VegaDateTimeEncodingFinalizer; timeUnit(def: DiscreteTimeUnit): VegaDateTimeEncodingFinalizer; sort(order: SortOrder): VegaDateTimeEncodingFinalizer; toEncoding(): TemporalEncoding; toExpression(): EastFunction; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaIntegerEncodingFinalizer { name: string; protected value: EastFunction; protected sortValue?: ValueSort | undefined; protected aggregateValue?: Aggregate | undefined; protected normalizeValue?: Normalize | null | undefined; protected binValue?: Bin | undefined; protected titleValue?: string | undefined; protected typeValue?: "nominal" | "ordinal" | "quantitative" | undefined; /** @internal */ constructor(name: string, value: EastFunction, sortValue?: ValueSort | undefined, aggregateValue?: Aggregate | undefined, normalizeValue?: Normalize | null | undefined, binValue?: Bin | undefined, titleValue?: string | undefined, typeValue?: "nominal" | "ordinal" | "quantitative" | undefined); title(def: string): VegaIntegerEncodingFinalizer; sort(order: SortOrder): VegaIntegerEncodingFinalizer; bin(bin: Bin): VegaIntegerEncodingFinalizer; aggregate(def: Aggregate): VegaIntegerEncodingFinalizer; normalize(def: Normalize | null): VegaIntegerEncodingFinalizer; type(type: 'nominal' | 'ordinal' | 'quantitative'): VegaIntegerEncodingFinalizer; toEncoding(): NumericEncoding; toExpression(): EastFunction; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaFloatEncodingFinalizer { name: string; protected value: EastFunction; protected sortValue?: ValueSort | undefined; protected aggregateValue?: Aggregate | undefined; protected normalizeValue?: Normalize | null | undefined; protected binValue?: Bin | undefined; protected titleValue?: string | undefined; protected typeValue?: "nominal" | "ordinal" | "quantitative" | undefined; /** @internal */ constructor(name: string, value: EastFunction, sortValue?: ValueSort | undefined, aggregateValue?: Aggregate | undefined, normalizeValue?: Normalize | null | undefined, binValue?: Bin | undefined, titleValue?: string | undefined, typeValue?: "nominal" | "ordinal" | "quantitative" | undefined); title(def: string): VegaFloatEncodingFinalizer; sort(order: SortOrder): VegaFloatEncodingFinalizer; bin(bin: Bin): VegaFloatEncodingFinalizer; aggregate(def: Aggregate): VegaFloatEncodingFinalizer; normalize(def: Normalize | null): VegaFloatEncodingFinalizer; type(type: 'nominal' | 'ordinal' | 'quantitative'): VegaFloatEncodingFinalizer; toEncoding(): NumericEncoding; toExpression(): EastFunction; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaStringEncodingFinalizer { name: string; protected value: EastFunction; protected sortValue?: ValueSort | undefined; protected titleValue?: string | undefined; protected typeValue?: "nominal" | "ordinal" | undefined; /** @internal */ constructor(name: string, value: EastFunction, sortValue?: ValueSort | undefined, titleValue?: string | undefined, typeValue?: "nominal" | "ordinal" | undefined); title(def: string): VegaStringEncodingFinalizer; sort(order: SortOrder): VegaStringEncodingFinalizer; type(type: 'nominal' | 'ordinal'): VegaStringEncodingFinalizer; toEncoding(): StringEncoding; toExpression(): EastFunction; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export type VegaFieldEncodingFinalizer = E extends DateTimeType ? VegaDateTimeEncodingFinalizer : E extends IntegerType ? VegaIntegerEncodingFinalizer : E extends FloatType ? VegaFloatEncodingFinalizer : E extends StringType ? VegaStringEncodingFinalizer : never; /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaColorEncodingSpecifier | ArrayType = DictType | ArrayType, E extends PrimitiveType = PrimitiveType> { name: string; protected stream: Stream; /** @internal */ constructor(name: string, stream: Stream); /** * Define an x series within a [Scatter](https://vega.github.io/vega-lite/examples/point_2d.html) chart for a {@link VegaBuilder} within a {@link LayoutBuilder}. * * @param def the Vega-Lite specification define from the {@link Stream} fields names. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * integer: StringType, * integer_two: StringType, * date: DateTimeType, * float: FloatType, * }) * ) * ); * * // create a vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .vega("My Chart", builder => builder * .fromStream(stream) * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * .x({ * value: (fields) => fields.integer_two, * title: "Other Integer" * }) * )) * .toTemplate() * ``` */ value ? TypeToFields : T extends ArrayType ? ArrayToFields : never), V extends E = E>(f: (fields: F) => EastFunction): V extends StringType ? VegaDiscreteColorEncodingFinalizer : V extends NumericType | DateTimeType ? VegaContinuousColorEncodingFinalizer : never; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaDiscreteColorEncodingFinalizer { name: string; protected value: EastFunction; protected titleValue?: string | undefined; protected scaleValue?: [value: string, color: string][] | undefined; protected typeValue?: "nominal" | "ordinal" | undefined; /** @internal */ constructor(name: string, value: EastFunction, titleValue?: string | undefined, scaleValue?: [value: string, color: string][] | undefined, typeValue?: "nominal" | "ordinal" | undefined); title(def: string): VegaDiscreteColorEncodingFinalizer; scale(def: [value: string, color: string][]): VegaDiscreteColorEncodingFinalizer; type(type: 'nominal' | 'ordinal'): VegaDiscreteColorEncodingFinalizer; toEncoding(): DiscreteColorEncoding; toExpression(): EastFunction; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaContinuousColorEncodingFinalizer { name: string; protected value: EastFunction; protected titleValue?: string | undefined; protected aggregateValue?: Aggregate | undefined; protected typeValue?: "nominal" | "ordinal" | "quantitative" | "temporal" | undefined; /** @internal */ constructor(name: string, value: EastFunction, titleValue?: string | undefined, aggregateValue?: Aggregate | undefined, typeValue?: "nominal" | "ordinal" | "quantitative" | "temporal" | undefined); title(def: string): VegaContinuousColorEncodingFinalizer; aggregate(def: Aggregate): VegaContinuousColorEncodingFinalizer; type(type: 'nominal' | 'ordinal' | 'quantitative' | 'temporal'): VegaContinuousColorEncodingFinalizer; toEncoding(): ContinuousColorEncoding; toExpression(): EastFunction; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export type VegaColorEncodingFinalizer = E extends StringType ? VegaDiscreteColorEncodingFinalizer : E extends NumericType | DateTimeType ? VegaContinuousColorEncodingFinalizer : never; /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaCartesianViewFinalizer | ArrayType = DictType | ArrayType> { protected mark: Mark; name: string; protected stream: Stream; protected encodings: { x?: AxisEncoding; x2?: AxisEncoding; y?: AxisEncoding; y2?: AxisEncoding; color?: ColorEncoding; size?: AxisEncoding; opacity?: AxisEncoding; fill_opacity?: AxisEncoding; stroke_opacity?: AxisEncoding; stroke_width?: AxisEncoding; stroke_dash?: AxisEncoding; shape?: AxisEncoding; detail?: AxisEncoding; }; protected selections: Record; /** @internal */ constructor(mark: Mark, name: string, stream: Stream, encodings: { x?: AxisEncoding; x2?: AxisEncoding; y?: AxisEncoding; y2?: AxisEncoding; color?: ColorEncoding; size?: AxisEncoding; opacity?: AxisEncoding; fill_opacity?: AxisEncoding; stroke_opacity?: AxisEncoding; stroke_width?: AxisEncoding; stroke_dash?: AxisEncoding; shape?: AxisEncoding; detail?: AxisEncoding; }, selections: Record); /** @internal */ toView(): CartesianView; } /** * {@inheritDoc VegaBuilder} * * @category Layout * */ export declare class VegaRadialViewFinalizer | ArrayType = DictType | ArrayType> { protected mark: ArcMark; name: string; protected stream: Stream; protected encodings: { angle: AxisEncoding; radius?: AxisEncoding; color?: ColorEncoding; opacity?: AxisEncoding; fill_opacity?: AxisEncoding; stroke_opacity?: AxisEncoding; stroke_width?: AxisEncoding; stroke_dash?: AxisEncoding; detail?: AxisEncoding; }; protected selections: Record; /** @internal */ constructor(mark: ArcMark, name: string, stream: Stream, encodings: { angle: AxisEncoding; radius?: AxisEncoding; color?: ColorEncoding; opacity?: AxisEncoding; fill_opacity?: AxisEncoding; stroke_opacity?: AxisEncoding; stroke_width?: AxisEncoding; stroke_dash?: AxisEncoding; detail?: AxisEncoding; }, selections: Record); /** @internal */ toView(): RadialView; } /** * Define a UI Calendar from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a calendar * const layout = new LayoutBuilder("My Layout") * .calendar("calendar", builder => * builder * .fromStream(stream.outputStream()) * .events((fields) => Struct({ * label: fields.label, * start: fields.start, * end: fields.end, * })) * ) * .toTemplate() * ``` */ export declare class CalendarBuilder { private name; private module; /** * Define a UI planning related component, such as Calendar, Timeline or Gantt from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a calendar * const layout = new LayoutBuilder("My Layout") * .planner("calendar", builder => * builder * .fromStream(stream.outputStream()) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * .toTemplate() * ``` */ constructor(name: string, module: ModulePath); /** * Define the {@link Stream} to build a {@link CalendarBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link DictType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a DictType stream * * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a calendar * const layout = new LayoutBuilder("My Layout") * .planner("calendar", builder => * builder * .fromStream(stream.outputStream()) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * .toTemplate() * ``` */ fromStream>(stream: Stream): CalendarFinalizer<{}, T>; } /** * {@inheritDoc CalendarBuilder} * * @category Layout * */ export declare class CalendarFinalizer = Record, T extends DictType = DictType> { name: string; protected module: ModulePath; protected stream: Stream; protected inputs: Inputs; protected input_streams: Record; protected event_functions: EastFunction | DictType>[]; /** @internal */ constructor(name: string, module: ModulePath, stream: Stream, inputs: Inputs, input_streams: Record, event_functions: EastFunction | DictType>[]); /** * Add an additional named input {@link Stream} to the {@link Visual}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const value = Stream("Value", StringType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .input({ name: "value", stream: value }) * .string("String", { * value: fields => fields.string, * target: (_fields, inputs) => inputs.value * ) * ) * .toTemplate() * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): CalendarFinalizer; }, T>; /** * Create an event in the {@link CalendarBuilder} within a {@link LayoutBuilder}. * * @param def A function that takes an East Function describing the a {@link CalendarEventType}, or {@link ArrayType} or {@link DictType} containing one or more {@link CalendarEventType}s * * The following properties are defined for a {@link CalendarEventType}: * @property date The date and time of the boundary {@link DateTimeType}. * @property stroke_color An optional string defining the color of the boundary's border or stroke {@link StringType}. * @property stroke_opacity An optional float defining the opacity of the boundary's stroke {@link FloatType}. * @property stroke_width An optional float defining the width of the boundary's stroke {@link FloatType}. * @property stroke_dash An optional structure defining the pattern of the boundary's stroke, consisting of 'stroke' and 'space' floats {@link StructType}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * events: ArrayType( * StructType({ * start: DateTimeType, * end: DateTimeType, * label: StringType, * }) * ) * event: StructType({ * start: DateTimeType, * end: DateTimeType, * label: StringType, * }) * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .calendar("calendar", builder => * builder * .fromStream(stream) * .calendar() * .events((fields, inputs) => fields.events) * .events((fields, inputs) => fields.event) * ) * .toTemplate() * ``` */ events(def: (fields: TypeToFields, inputs: Inputs) => EastFunction | DictType>): CalendarFinalizer; /** @internal */ toVisual(): CalendarVisual; } /** * Define a UI planning related component, such as Calendar, Timeline or Gantt from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType) * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .string("label", fields => fields.label) * ) * .toTemplate() * ``` */ export declare class TimelineBuilder { private name; private module; /** * Define a UI planning related component, such as Calendar, Timeline or Gantt from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a calendar * const layout = new LayoutBuilder("My Layout") * .planner("calendar", builder => * builder * .fromStream(stream.outputStream()) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * .toTemplate() * ``` */ constructor(name: string, module: ModulePath); /** * Define the {@link Stream} to build a {@link TimelineBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link DictType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a DictType stream * * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a calendar * const layout = new LayoutBuilder("My Layout") * .planner("calendar", builder => * builder * .fromStream(stream.outputStream()) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * .toTemplate() * ``` */ fromStream>(stream: Stream): TimelineFinalizer<{}, T, {}>; /** * Define the {@link Stream} to build a {@link TimelineBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link DictType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a DictType stream * * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * const patch = new SourceBuilder("My Patch") * .patch(stream.outputStream()) * * // create a calendar * const layout = new LayoutBuilder("My Layout") * .planner("calendar", builder => * builder * .fromPatch(patch) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * .toTemplate() * ``` */ fromPatch>(patch: PatchSourceBuilder): TimelineFinalizer<{}, T, {}>; } /** * {@inheritDoc TimelineBuilder} * * @category Layout * */ export declare class TimelineFinalizer = Record, T extends DictType = DictType, Fields extends Record = Record> { name: string; protected module: ModulePath; protected stream: Stream; private task_functions; protected table_columns: Fields; protected inputs: Inputs; protected input_streams: Record; protected writable: TableWriteConfiguration; protected key_column: KeyFieldType; protected names: [string, string][]; protected boundaries?: EastFunction[] | undefined; /** @internal */ constructor(name: string, module: ModulePath, stream: Stream, task_functions: EastFunction | DictType>[], table_columns: Fields, inputs: Inputs, input_streams: Record, writable: TableWriteConfiguration, key_column?: KeyFieldType, names?: [string, string][], boundaries?: EastFunction[] | undefined); /** * Define if the {@link Stream} key should be visible in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param show an optional boolean that defines if the key is visible - defaults to `true` * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * array: ArrayType( * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .planner("gantt", builder => * builder * .fromStream(stream.outputStream()) * .timeline({ * tasks: (fields) => fields.array, * }) * .showKey("Key") * ) * .toTemplate() * ``` */ showKey(label: Name): TimelineFinalizer; /** * Disable row update for the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * array: ArrayType( * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .planner("gantt", builder => * builder * .fromStream(stream.outputStream()) * .timeline({ * tasks: (fields) => fields.array, * }) * .disableUpdate() * ) * .toTemplate() * ``` */ disableUpdate(): TimelineFinalizer; /** * Disable row add for the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * array: ArrayType( * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .planner("gantt", builder => * builder * .fromStream(stream.outputStream()) * .timeline({ * tasks: (fields) => fields.array, * }) * .disableAdd() * ) * .toTemplate() * ``` */ disableAdd(): TimelineFinalizer; /** * Disable row remove for the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * array: ArrayType( * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .planner("gantt", builder => * builder * .fromStream(stream.outputStream()) * .timeline({ * tasks: (fields) => fields.array, * }) * .disableRemove() * ) * .toTemplate() * ``` */ disableRemove(): TimelineFinalizer; /** * Disable row remove for the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @remarks only valid if the input stream is writable * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * array: ArrayType( * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .planner("gantt", builder => * builder * .fromStream(stream.outputStream()) * .timeline({ * tasks: (fields) => fields.array, * }) * .disableUndo() * ) * .toTemplate() * ``` */ disableUndo(): TimelineFinalizer; /** * Add an additional named input {@link Stream} to the {@link Visual}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * array: ArrayType( * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * }) * ) * ); * * const value = Stream("Value", StringType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .planner("gantt", builder => * builder * .fromStream(stream.outputStream()) * .timeline({ * tasks: (fields) => fields.array, * }) * .input({ name: "value", stream: value }) * .string("label", { * value: fields => fields.string, * target: (_fields, inputs) => inputs.value * ) * ) * .toTemplate() * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): TimelineFinalizer; }, T, Fields>; /** @internal */ toVisual(): TimelineVisual; /** * Create a task in the {@link TimelineBuilder} within a {@link LayoutBuilder}. * * @param def A function that takes an East Function describing the a {@link TimelineTaskType}, or {@link ArrayType} or {@link DictType} containing one or more {@link TimelineTaskType}s * * The following properties are defined for a {@link TimelineTaskType}: * @property label The task's descriptive label {@link StringType}. * @property start The scheduled start date and time of the task {@link DateTimeType}. * @property end The scheduled end date and time of the task {@link DateTimeType}. * @property start_target An optional start date and time that the task aims to begin by {@link DateTimeType}. * @property end_target An optional end date and time that the task aims to be completed by {@link DateTimeType}. * @property color An optional string defining the color associated with the task for UI representation {@link StringType}. * @property opacity An optional float defining the opacity of the task's representation {@link FloatType}. * @property stroke_color An optional string defining the color of the task's border or stroke {@link StringType}. * @property stroke_opacity An optional float defining the opacity of the task's stroke {@link FloatType}. * @property stroke_width An optional float defining the width of the task's stroke {@link FloatType}. * @property stroke_dash An optional structure defining the pattern of the task's stroke, consisting of 'stroke' and 'space' floats {@link StructType}. * @property dependencies An optional set or array of strings, each representing the label of another task that this task depends on ({@link SetType} or {@link ArrayType}). * @property tooltips An optional array of tooltips, each {@link ArrayType} element representing the label and value as a {@link StructType}. * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType) * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .string("label", fields => fields.label) * ) * .toTemplate() * ``` */ tasks(def: (fields: TypeToFields, inputs: Inputs) => EastFunction | DictType>): TimelineFinalizer; /** * Create a visible boundary in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param def A function that takes an East Function describing the a {@link TimelineBoundaryType} * * The following properties are defined for a {@link TimelineBoundaryType}: * @property date The date and time of the boundary {@link DateTimeType}. * @property stroke_color An optional string defining the color of the boundary's border or stroke {@link StringType}. * @property stroke_opacity An optional float defining the opacity of the boundary's stroke {@link FloatType}. * @property stroke_width An optional float defining the width of the boundary's stroke {@link FloatType}. * @property stroke_dash An optional structure defining the pattern of the boundary's stroke, consisting of 'stroke' and 'space' floats {@link StructType}. * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType) * }) * ) * ); * * const date = Stream( * "My Date", * DateTimeType * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => builder * .fromStream(stream.outputStream()) * .input({ name: "Date", stream: date }) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .boundary((inputs) => Struct({ * date: AddDuration(inputs["Date"], 2, 'week'), * stroke_color: "red", * stroke_opacity: 0.5, * stroke_width: 4, * stroke_dash: { stroke: 3, space: 6 }, * })) * .string("label", fields => fields.label) * ) * .toTemplate() * ``` */ boundary(def: Date | ((inputs: Inputs) => EastFunction)): TimelineFinalizer; /** * Create a {@link DateTimeType} column in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the column header * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .date("start", fields => fields.date1) * ) * .toTemplate() * ``` */ date(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): TimelineFinalizer; date(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): TimelineFinalizer; /** * Create a {@link FloatType} column in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the column header * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * float: FloatType * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .float("completion", fields => fields.float) * ) * .toTemplate() * ``` */ float(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): TimelineFinalizer; float(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): TimelineFinalizer; /** * Create a {@link IntegerType} column in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the column header * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * integer: IntegerType * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .integer("Integer", fields => fields.integer) * ) * .toTemplate() * ``` */ integer(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): TimelineFinalizer; integer(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): TimelineFinalizer; /** * Create a {@link StringType} column in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the column header * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .string("label", fields => fields.string) * ) * .toTemplate() * ``` */ string(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): TimelineFinalizer; string(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): TimelineFinalizer; /** * Create a {@link BooleanType} column in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the column header * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * boolean: BooleanType * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .boolean("status", fields => fields.boolean) * ) * .toTemplate() * ``` */ boolean(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): TimelineFinalizer; boolean(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): TimelineFinalizer; /** * Create a {@link SetType} column in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the column header * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .set("dependencies", fields => fields.dependencies) * ) * .toTemplate() * ``` */ set(name: Name extends keyof Fields ? never : Name, def: ValueDefinition>): TimelineFinalizer; set(name: Name extends keyof Fields ? never : Name, def: (fields: TypeToFields) => Variable): TimelineFinalizer; /** * Define a {@link StringType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the form label * @param def the definition of the form input * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * array: ArrayType( * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .array("Array", fields => fields.array, builder => * builder.string("Label", fields => fields.label) * ) * ) * .toTemplate() * ``` */ array) => Variable>>(name: Name extends keyof Fields ? never : Name, value: F, def: (builder: FieldFinalizer["type"]["value"], Inputs, {}>) => FieldFinalizer["type"]["value"], Inputs>, config?: { readonly?: boolean | ((fields: TypeToFields, inputs: Inputs) => EastFunction); hidden?: boolean; hidden_detail?: boolean; }): TimelineFinalizer; /** * Define a {@link StringType} input in a {@link FormBuilder} within a {@link LayoutBuilder}. * * @param name the display name for the form label * @param def the definition of the form input * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * dict: DictType( * StringType, * StructType({ * string: StringType * }) * ), * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .dict("Dict", fields => fields.dict, builder => * builder.string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ dict) => Variable>>(name: Name extends keyof Fields ? never : Name, value: F, def: (builder: FieldFinalizer["type"]["value"]["value"], Inputs, {}>) => FieldFinalizer["type"]["value"]["value"], Inputs>, config?: { readonly?: boolean | ((fields: TypeToFields, inputs: Inputs) => EastFunction); hidden?: boolean; hidden_detail?: boolean; }): TimelineFinalizer; /** * Create multiple value columns in the {@link TimelineFinalizer} within a {@link LayoutBuilder}. * * @param name the display name for the column header * @param def the definition of the column * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType), * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => * builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .columns() * ) * .toTemplate() * ``` * */ columns) => Variable>>(def?: S): TimelineFinalizer; } /** * Define a UI Tabbed container from a {@link Stream} within a {@link LayoutBuilder}, to display one of multiple other visuals. * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * date: DateTimeType, * }), * true * ); * * // create a tab in a layout containing a form and a table * const layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * ) * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * ) * ) * .toTemplate() * ``` */ export declare class TabBuilder { private module; private visuals; /** @internal */ constructor(module: ModulePath); constructor(module: ModulePath, visuals: TabChildBuilder[]); /** @internal */ private get name(); /** * Add a {@link TableBuilder} to a {@link TabBuilder} within a {@link LayoutBuilder}. * * @param name the name for the {@link TableBuilder} * @param def the {@link TableBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * .toTemplate() * ``` */ table(name: string, def: (panel: TableBuilder) => TableFinalizer): TabBuilder; /** * Add a {@link MapBuilder} to a {@link TabBuilder} within a {@link LayoutBuilder}. * * @param name the name for the {@link TableBuilder} * @param def the {@link TableBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream("My Stream", [], GeoType); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .map("My Map", builder => builder * .fromStream(stream) * .layer( * "States", * { * geometry: (value) => MapFeatureCollection( * FilterFeatureCollection( * ToFeatureCollection(value), * (feature) => Equal( * Get(GetField(feature, 'properties'), Const('locality_type')), * Const('State') * ) * ), * feature => Struct({ * ...Spread(feature), * style: Struct({ * label: Get(GetField(feature, 'properties'), Const('locality')), * stroke_color: Const("#000000"), * stroke_weight: Const(0.5), * stroke_opacity: Const(0.7), * fill_color: Const("orange"), * fill_opacity: Const(1), * }), * tooltips: NewArray( * GeoTooltip, * [ * Struct({ label: Const("Locality"), value: Get(GetField(feature, 'properties'), Const('locality')) }), * Struct({ label: Const("Type"), value: Get(GetField(feature, 'properties'), Const('locality_type')) }), * ] * ) * }) * ), * visible: true * } * ) * ) * ) * .toTemplate() * ``` */ map(name: string, def: (panel: MapBuilder) => MapFinalizer): TabBuilder; /** * Add a {@link VegaBuilder} to a {@link TabBuilder} within a {@link LayoutBuilder}. * * @param name the name for the {@link VegaBuilder} * @param def the {@link VegaBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a vega to a tab * const layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .vega("My Scatter", builder => builder * .fromStream(stream) * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * ) * ) * .toTemplate() * ``` */ vega(name: string, def: (panel: VegaBuilder) => VegaVisualFinalizer): TabBuilder; /** * Add a {@link TimelineBuilder} to a {@link TabBuilder} within a {@link LayoutBuilder}. * * @param name the name for the {@link VegaBuilder} * @param def the {@link VegaBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a vega to a tab * const layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .vega("My Scatter", builder => builder * .fromStream(stream) * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * ) * ) * .toTemplate() * ``` */ timeline(name: string, def: (panel: TimelineBuilder) => TimelineFinalizer): TabBuilder; /** * Add a {@link CalendarBuilder} to a {@link TabBuilder} within a {@link LayoutBuilder}. * * @param name the name for the {@link VegaBuilder} * @param def the {@link VegaBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a vega to a tab * const layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .vega("My Scatter", builder => builder * .fromStream(stream) * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * ) * ) * .toTemplate() * ``` */ calendar(name: string, def: (panel: CalendarBuilder) => CalendarFinalizer): TabBuilder; /** * Add a {@link FormBuilder} to a {@link TabBuilder} within a {@link LayoutBuilder}. * * @param name the name for the {@link FormBuilder} * @param def the {@link FormBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * ) * ) * .toTemplate() * ``` */ form(name: string, def: (panel: FormBuilder) => FormFinalizer): TabBuilder; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link UploadBuilder}. * * @param def the {@link UploadBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a BlobType stream * const stream = Stream( * "My Stream", * BlobType, * true * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .upload("My Upload", builder => builder * .fromStream(stream) * .inputs() * ) * ) * .toTemplate() * ``` */ upload(name: string, def: (panel: UploadBuilder) => UploadFinalizer): TabBuilder; /** * Add the contents of a {@link LayoutBuilder} to a {@link TabBuilder} within a {@link LayoutBuilder}. * * @param def the {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a layout containing a form * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * .float( * "Float", * { * value: fields => fields.float, * min: fields => fields.min_float, * max: fields => fields.max_float, * } * ) * ) * .toTemplate() * * // add the other layout into a tab * const other_layout = new LayoutBuilder("My Layout") * .tab(builder => builder * .layout(layout) * ) * .toTemplate() * ``` */ layout(def: FlatLayoutFinalizer): TabBuilder; /** @internal */ toVisual(): TabVisual; } /** * Define a UI Flex container from a {@link Stream} within a {@link LayoutBuilder}, to display multiple other visuals in a nested flex layout. * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * integer: IntegerType, * boolean: BooleanType, * }), * ); * * // create a tab in a layout containing a form and a table * const layout = new LayoutBuilder("My Layout") * .panel('column', builder => builder * .form(50, "My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * .float("Float", fields => fields.float) * ) * .table(50, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * .float("Float", fields => fields.float) * ) * ) * .toTemplate() * ``` */ export declare class PanelBuilder { private module; private orientation; private visuals; /** @internal */ constructor(module: ModulePath, orientation: 'row' | 'column'); constructor(module: ModulePath, orientation: 'row' | 'column', visuals: PanelChild[]); /** @internal */ private get name(); /** @internal */ private get percentage(); /** * Add a {@link TableBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link TableBuilder} * @param name the name for the {@link TableBuilder} * @param def the {@link TableBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .table(100, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * .toTemplate() * ``` */ table(percentage: number, name: string, def: (panel: TableBuilder) => TableFinalizer): PanelBuilder; /** * Add a {@link TableBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link TableBuilder} * @param name the name for the {@link TableBuilder} * @param def the {@link TableBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream("My Stream", [], GeoType); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .map(100, "My Map", builder => builder * .fromStream(stream) * .layer( * "States", * { * geometry: (value) => MapFeatureCollection( * FilterFeatureCollection( * ToFeatureCollection(value), * (feature) => Equal( * Get(GetField(feature, 'properties'), Const('locality_type')), * Const('State') * ) * ), * feature => Struct({ * ...Spread(feature), * style: Struct({ * label: Get(GetField(feature, 'properties'), Const('locality')), * stroke_color: Const("#000000"), * stroke_weight: Const(0.5), * stroke_opacity: Const(0.7), * fill_color: Const("orange"), * fill_opacity: Const(1), * }), * tooltips: NewArray( * GeoTooltip, * [ * Struct({ label: Const("Locality"), value: Get(GetField(feature, 'properties'), Const('locality')) }), * Struct({ label: Const("Type"), value: Get(GetField(feature, 'properties'), Const('locality_type')) }), * ] * ) * }) * ), * visible: true * } * ) * ) * ) * .toTemplate() * ``` */ map(percentage: number, name: string, def: (panel: MapBuilder) => MapFinalizer): PanelBuilder; /** * Add a {@link VegaBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link VegaBuilder} * @param name the name for the {@link VegaBuilder} * @param def the {@link VegaBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a vega to a tab * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .vega(100, "My Scatter", builder => builder * .fromStream(stream) * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * ) * ) * .toTemplate() * ``` */ vega(percentage: number, name: string, def: (panel: VegaBuilder) => VegaVisualFinalizer): PanelBuilder; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link CalendarBuilder}. * * @param def the {@link CalendarBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .planner(100, "calendar", builder => builder * .fromStream(stream.outputStream()) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * ) * .toTemplate() * ``` */ calendar(percentage: number, name: string, def: (panel: CalendarBuilder) => CalendarFinalizer): PanelBuilder; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TimelineBuilder}. * * @param def the {@link TimelineBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .planner(100, "calendar", builder => builder * .fromStream(stream.outputStream()) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * ) * .toTemplate() * ``` */ timeline(percentage: number, name: string, def: (panel: TimelineBuilder) => TimelineFinalizer): PanelBuilder; /** * Add a {@link FormBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link FormBuilder} * @param name the name for the {@link FormBuilder} * @param def the {@link FormBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * }) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .form(100, "My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ form(percentage: number, name: string, def: (panel: FormBuilder) => FormFinalizer): PanelBuilder; /** * Add a nested {@link PanelBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link PanelBuilder} * @param name the name for the {@link PanelBuilder} * @param def the {@link PanelBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('column', builder => builder * .panel(100, 'row', builder => builder * .table(100, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * ) * .toTemplate() * ``` */ panel(percentage: number, orientation: 'row' | 'column', def: (panel: PanelBuilder) => PanelBuilder): PanelBuilder; /** * Add a {@link TabBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link TabBuilder} * @param name the name for the {@link TabBuilder} * @param def the {@link TabBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('column', builder => builder * .tab(100, 'row', builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * .toTemplate() * ``` */ tab(percentage: number, def: (panel: TabBuilder) => TabBuilder): PanelBuilder; /** * Add a {@link UploadBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link UploadBuilder} * @param name the name for the {@link UploadBuilder} * @param def the {@link UploadBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('column', builder => builder * .upload(100, "My Upload", builder => builder * .fromStream(stream) * .inputs() * ) * ) * .toTemplate() * ``` */ upload(percentage: number, name: string, def: (panel: UploadBuilder) => UploadFinalizer): PanelBuilder; /** * Add a {@link UploadBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link UploadBuilder} * @param name the name for the {@link UploadBuilder} * @param def the {@link UploadBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('column', builder => builder * .upload(100, "My Upload", builder => builder * .fromStream(stream) * .inputs() * ) * ) * .toTemplate() * ``` */ pivot(percentage: number, name: string, def: (panel: PivotBuilder) => PivotFinalizer): PanelBuilder; /** * Add a {@link LayoutBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link LayoutBuilder} * @param name the name for the {@link LayoutBuilder} * @param def the {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a layout containing a form * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * .toTemplate() * * // create a layout with a panel, containing the layout * const layout = new LayoutBuilder("My Layout") * .panel('column', builder => builder * .layout(100, layout) * ) * .toTemplate() * ``` */ layout(percentage: number, def: FlatLayoutFinalizer): PanelBuilder; /** @internal */ toVisual(): PanelVisual; } /** * The configuration of a grid item. * * @param percentage the percentage of the parent for the {@link VegaBuilder} * @param name the name for the {@link VegaBuilder} * @param def the {@link VegaBuilder} * * @category Layout * */ export type GridItem = { x: number; y: number; w: number; h: number; is_static: true; } | { x: number; y: number; w: number; h: number; is_static: false; min_w?: number; max_w?: number; min_h?: number; max_h?: number; }; /** * Define a UI Grid container from a {@link Stream} within a {@link LayoutBuilder}, to display multiple other visuals in a editable layout. * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * integer: IntegerType, * boolean: BooleanType, * }), * ); * * // create a tab in a layout containing a form and a table * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .form("My Form", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * .float("Float", fields => fields.float) * ) * .table("My Table", { w: 3, h: 2, x: 0, y: 3, is_static: false }, builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * .float("Float", fields => fields.float) * ) * ) * .toTemplate() * ``` */ export declare class GridBuilder { private module; private visuals; /** @internal */ constructor(module: ModulePath); constructor(module: ModulePath, visuals: GridChild[]); /** @internal */ private get name(); /** * Add a {@link TableBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link TableBuilder} * @param name the name for the {@link TableBuilder} * @param def the {@link TableBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .table("My Table", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * .toTemplate() * ``` */ table(name: string, grid: GridItem, def: (panel: TableBuilder) => TableFinalizer): GridBuilder; /** * Add a {@link VegaBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link VegaBuilder} * @param name the name for the {@link VegaBuilder} * @param def the {@link VegaBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a vega to a tab * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .vega("My Scatter", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * ) * ) * .toTemplate() * ``` */ vega(name: string, grid: GridItem, def: (panel: VegaBuilder) => VegaVisualFinalizer): GridBuilder; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link CalendarBuilder}. * * @param def the {@link CalendarBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .planner("calendar", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream.outputStream()) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * ) * .toTemplate() * ``` */ calendar(name: string, grid: GridItem, def: (panel: CalendarBuilder) => CalendarFinalizer): GridBuilder; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TimelineBuilder}. * * @param def the {@link TimelineBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .timeline("timeline", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream.outputStream()) * .task({ * : (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * ) * .toTemplate() * ``` */ timeline(name: string, grid: GridItem, def: (panel: TimelineBuilder) => TimelineFinalizer): GridBuilder; /** * Add a {@link FormBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link FormBuilder} * @param name the name for the {@link FormBuilder} * @param def the {@link FormBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * }) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .form("My Form", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ form(name: string, grid: GridItem, def: (panel: FormBuilder) => FormFinalizer): GridBuilder; /** * Add a {@link TabBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link TabBuilder} * @param name the name for the {@link TabBuilder} * @param def the {@link TabBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .tab('row', { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * .toTemplate() * ``` */ tab(grid: GridItem, def: (panel: TabBuilder) => TabBuilder): GridBuilder; /** * Add a {@link UploadBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link UploadBuilder} * @param name the name for the {@link UploadBuilder} * @param def the {@link UploadBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .upload("My Upload", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .inputs() * ) * ) * .toTemplate() * ``` */ upload(name: string, grid: GridItem, def: (panel: UploadBuilder) => UploadFinalizer): GridBuilder; /** * Add a {@link UploadBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link UploadBuilder} * @param name the name for the {@link UploadBuilder} * @param def the {@link UploadBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .grid('column', builder => builder * .upload("My Upload", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .inputs() * ) * ) * .toTemplate() * ``` */ pivot(name: string, grid: GridItem, def: (panel: PivotBuilder) => PivotFinalizer): GridBuilder; /** * Add a {@link LayoutBuilder} to a {@link PanelBuilder} within a {@link LayoutBuilder}. * * @param percentage the percentage of the parent for the {@link LayoutBuilder} * @param name the name for the {@link LayoutBuilder} * @param def the {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a layout containing a form * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * .toTemplate() * * // create a layout with a panel, containing the layout * const layout = new LayoutBuilder("My Layout") * .grid({ w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .layout(100, layout) * ) * .toTemplate() * ``` */ layout(grid: GridItem, def: FlatLayoutFinalizer): GridBuilder; /** @internal */ toVisual(): GridVisual; } /** * Define a UI Header container from one or more {@link Stream}'s within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // a stream containing a number * const number = Stream("My Number Stream", FloatType) * * // a stream containing a string * const string = Stream("My String Stream", StringType) * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * ) * .header(builder => builder * .value("A percentage", number, (value) => StringJoin`${value}%`) * .value("A string", string) * * ) * .toTemplate() * ``` */ export declare class HeaderBuilder { private module; private items; /** @internal */ constructor(module: ModulePath, items?: HeaderItem[]); item(name: string, f: (def: HeaderItemBuilder) => HeaderItemFinalizer): HeaderBuilder; /** @internal */ toVisual(): HeaderVisual; } /** * Define a UI Header container from one or more {@link Stream}'s within a {@link LayoutBuilder}. * * @category Layout */ export declare class ChatBuilder { private module; private threads; /** @internal */ constructor(module: ModulePath, threads?: ChatThreadVisual[]); thread(prompt: Stream>, f: (def: ChatThreadBuilder) => ChatThreadFinalizer): ChatBuilder; /** @internal */ toVisual(): ChatVisual; } /** * Define a UI Header container from one or more {@link Stream}'s within a {@link LayoutBuilder}. * * @category Layout * */ export declare class ChatThreadBuilder { private prompt; /** @internal */ constructor(prompt: Stream>); /** * Define the {@link Stream} to build a {@link TableBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link DictType} or {@link ArrayType} {@link Stream} to build the table from */ fromAssistant(assistant: LLMAssistantBuilder): ChatThreadFinalizer; } /** * Define a UI Header container from one or more {@link Stream}'s within a {@link LayoutBuilder}. * */ export declare class ChatThreadFinalizer { private name; private prompt; private task; /** @internal */ constructor(name: string, prompt: Stream>, task: LLMAssistantTaskDescription); /** @internal */ toChatThread(): ChatThreadVisual; } /** * Define a UI Header container from one or more {@link Stream}'s within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // a stream containing a number * const number = Stream("My Number Stream", FloatType) * * // a stream containing a string * const string = Stream("My String Stream", StringType) * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * ) * .header(builder => builder * .value("A percentage", number, (value) => StringJoin`${value}%`) * .value("A string", string) * * ) * .toTemplate() * ``` */ export declare class HeaderItemBuilder { private module; private name; /** @internal */ constructor(module: ModulePath, name: string); /** * Define the {@link Stream} to build a {@link TableBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link DictType} or {@link ArrayType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .toTemplate() * ``` */ fromStream(stream: Stream): T extends FloatType | IntegerType ? HeaderItemSpecifierNumeric : HeaderItemSpecifier; } /** * Define a UI Header container from one or more {@link Stream}'s within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const float = Stream("String", FloatType); * const date = Stream("Date", DateTimeType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(string) * .input({ name: "date", stream: date }) * .value({ * value: (value, inputs) => AddDuration(inputs.date, value, 'hour'), * color: () => Const('blue'), * tooltip: (value, inputs) => StringJoin`The date is ${AddDuration(inputs.date, value, 'hour')}`, * }) * ) * ) * .toTemplate() * ``` */ export declare class HeaderItemSpecifier = Record> { private module; private name; private stream; private inputs; private input_streams; /** @internal */ constructor(module: ModulePath, name: string, stream: Stream, inputs: Inputs, input_streams: Record); /** * Add an additional named input {@link Stream} to the {@link Visual}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const float = Stream("String", FloatType); * const date = Stream("Date", DateTimeType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(string) * .input({ name: "date", stream: date }) * .value({ * value: (value, inputs) => AddDuration(inputs.date, value, 'hour'), * color: () => Const('blue'), * tooltip: (value, inputs) => StringJoin`The date is ${AddDuration(inputs.date, value, 'hour')}`, * }) * ) * ) * .toTemplate() * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): HeaderItemSpecifier; }>; /** * Add value to a {@link HeaderBuilder} within a {@link LayoutBuilder}. * * @param name the name for the item * @param def the definition of the value * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const float = Stream("String", FloatType); * const date = Stream("Date", DateTimeType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(float) * .input({ name: "date", stream: date }) * .value({ * value: (value, inputs) => AddDuration(inputs.date, value, 'hour'), * color: () => Const('blue'), * tooltip: (value, inputs) => StringJoin`The date is ${AddDuration(inputs.date, value, 'hour')}`, * }) * ) * .item("My Function Header", builder => builder * .fromStream(float) * .input({ name: "date", stream: date }) * .value((value, inputs) => AddDuration(inputs.date, value, 'hour')) * ) * ) * .toTemplate() * ``` */ value(def: { /** The {@link EastFunction} to display. **/ value: (stream: Variable, inputs: Inputs) => EastFunction; /** The text color {@link EastFunction} **/ color?: (stream: Variable, inputs: Inputs) => EastFunction; /** The tooltip {@link EastFunction} value **/ tooltip?: (stream: Variable, inputs: Inputs) => EastFunction; }): HeaderItemFinalizer; value(def: (stream: Variable, inputs: Inputs) => EastFunction): HeaderItemFinalizer; /** * Add KPI visual to a {@link HeaderBuilder} within a {@link LayoutBuilder}. * * @param name the name for the item * @param def the definition of the kpi * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const struct = Stream("Struct", StructType({ * value: FloatType, * target: IntegerType * })); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(struct) * .kpi({ * goal: 'less', * value: (value) => GetField(value, 'value'), * target: (value) => GetField(value, 'target'), * }) * ) * ) * .toTemplate() * ``` */ kpi(def: { /** The {@link EastFunction} to display. **/ value: (stream: Variable, inputs: Inputs) => EastFunction; /** The input target value {@link EastFunction} **/ target: (stream: Variable, inputs: Inputs) => EastFunction; /** The {@link EastFunction} describing the comparison between the value and target (where < 0 == value < target, 0 == value == target, > 0 == value > target) */ comparison?: (stream: Variable, inputs: Inputs) => EastFunction; /** The tooltip {@link EastFunction} value **/ tooltip?: (stream: Variable, inputs: Inputs) => EastFunction; /** Should the value be equal to (default), greater than or less than the target **/ goal: 'greater' | 'less' | 'equal'; }): HeaderItemFinalizer; /** * Add progress indicator to a {@link HeaderBuilder} within a {@link LayoutBuilder}. * * @param name the name for the item * @param def the definition of the kpi * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const struct = Stream("Struct", StructType({ * value: FloatType, * target: IntegerType * })); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(struct) * .progress({ * value: (value) => GetField(value, 'value'), * min: () => Const(0), * max: (value) => GetField(value, 'target'), * display: (value) => StringJoin`${Multiply(Divide(GetField(value, 'value'), GetField(value, 'target')), 100)}%`, * }) * ) * ) * .toTemplate() * ``` */ progress(def: { /** The {@link EastFunction} for the progress value. **/ value: (stream: Variable, inputs: Inputs) => EastFunction; /** The {@link EastFunction} for rendered progress value. **/ display?: (stream: Variable, inputs: Inputs) => EastFunction; /** The {@link EastFunction} for the minimum possible value (default 0) **/ min?: (stream: Variable, inputs: Inputs) => EastFunction; /** The {@link EastFunction} for the minimum possible value (default 100) **/ max?: (stream: Variable, inputs: Inputs) => EastFunction; /** The tooltip {@link EastFunction} value **/ tooltip?: (stream: Variable, inputs: Inputs) => EastFunction; }): HeaderItemFinalizer; } /** * Define a UI Header container from one or more {@link Stream}'s within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const float = Stream("String", FloatType); * const date = Stream("Date", DateTimeType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(string) * .input({ name: "date", stream: date }) * .value({ * value: (value, inputs) => AddDuration(inputs.date, value, 'hour'), * color: () => Const('blue'), * tooltip: (value, inputs) => StringJoin`The date is ${AddDuration(inputs.date, value, 'hour')}`, * }) * ) * ) * .toTemplate() * ``` */ export declare class HeaderItemSpecifierNumeric = Record> { private module; private name; private stream; private inputs; private input_streams; /** @internal */ constructor(module: ModulePath, name: string, stream: Stream, inputs: Inputs, input_streams: Record); /** * Add an additional named input {@link Stream} to the {@link Visual}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const float = Stream("String", FloatType); * const date = Stream("Date", DateTimeType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(string) * .input({ name: "date", stream: date }) * .value({ * value: (value, inputs) => AddDuration(inputs.date, value, 'hour'), * color: () => Const('blue'), * tooltip: (value, inputs) => StringJoin`The date is ${AddDuration(inputs.date, value, 'hour')}`, * }) * ) * ) * .toTemplate() * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): HeaderItemSpecifierNumeric; }>; /** * Add value to a {@link HeaderBuilder} within a {@link LayoutBuilder}. * * @param name the name for the item * @param def the definition of the value * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const float = Stream("String", FloatType); * const date = Stream("Date", DateTimeType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(float) * .input({ name: "date", stream: date }) * .value({ * value: (value, inputs) => AddDuration(inputs.date, value, 'hour'), * color: () => Const('blue'), * tooltip: (value, inputs) => StringJoin`The date is ${AddDuration(inputs.date, value, 'hour')}`, * }) * ) * .item("My Function Header", builder => builder * .fromStream(float) * .input({ name: "date", stream: date }) * .value((value, inputs) => AddDuration(inputs.date, value, 'hour')) * ) * ) * .toTemplate() * ``` */ value(def: { /** The {@link EastFunction} to display. **/ value: (stream: Variable, inputs: Inputs) => EastFunction; /** The text color {@link EastFunction} **/ color?: (stream: Variable, inputs: Inputs) => EastFunction; /** The tooltip {@link EastFunction} value **/ tooltip?: (stream: Variable, inputs: Inputs) => EastFunction; }): HeaderItemFinalizer; value(def: (stream: Variable, inputs: Inputs) => EastFunction): HeaderItemFinalizer; /** * Add Slider visual to a {@link HeaderBuilder} within a {@link LayoutBuilder}. * * @param name the name for the item * @param def the definition of the kpi * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * IntegerType * ); * const struct = Stream("Struct", StructType({ * min: IntegerType, * max: IntegerType * })); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(stream) * .input({ name: "struct", stream: struct }) * .slider({ * min: (inputs) => GetField(inputs.struct, 'min'), * max: (inputs) => GetField(inputs.struct, 'max'), * }) * ) * ) * .toTemplate() * ``` */ slider(def: { /** The minimum allowed slider value {@link EastFunction} **/ min: (inputs: Inputs) => EastFunction; /** The maximum allowed slider value {@link EastFunction} **/ max: (inputs: Inputs) => EastFunction; /** The maximum allowed slider value {@link EastFunction} **/ target?: (inputs: Inputs) => EastFunction; /** The slider step size {@link EastFunction} **/ step?: (inputs: Inputs) => EastFunction; /** The {@link EastFunction} describing the displayed value */ display?: (stream: Variable, inputs: Inputs) => EastFunction; /** The tooltip {@link EastFunction} value **/ tooltip?: (stream: Variable, inputs: Inputs) => EastFunction; }): HeaderItemFinalizer; /** * Add KPI visual to a {@link HeaderBuilder} within a {@link LayoutBuilder}. * * @param name the name for the item * @param def the definition of the kpi * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const struct = Stream("Struct", StructType({ * value: FloatType, * target: IntegerType * })); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(struct) * .kpi({ * goal: 'less', * value: (value) => GetField(value, 'value'), * target: (value) => GetField(value, 'target'), * }) * ) * ) * .toTemplate() * ``` */ kpi(def: { /** The {@link EastFunction} to display. **/ value: (stream: Variable, inputs: Inputs) => EastFunction; /** The input target value {@link EastFunction} **/ target: (stream: Variable, inputs: Inputs) => EastFunction; /** The {@link EastFunction} describing the comparison between the value and target (where < 0 == value < target, 0 == value == target, > 0 == value > target) */ comparison?: (stream: Variable, inputs: Inputs) => EastFunction; /** The tooltip {@link EastFunction} value **/ tooltip?: (stream: Variable, inputs: Inputs) => EastFunction; /** Should the value be equal to (default), greater than or less than the target **/ goal: 'greater' | 'less' | 'equal'; }): HeaderItemFinalizer; /** * Add progress indicator to a {@link HeaderBuilder} within a {@link LayoutBuilder}. * * @param name the name for the item * @param def the definition of the kpi * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * const struct = Stream("Struct", StructType({ * value: FloatType, * target: IntegerType * })); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .columns() * ) * .header(builder => builder * .item("My Header", builder => builder * .fromStream(struct) * .progress({ * value: (value) => GetField(value, 'value'), * min: () => Const(0), * max: (value) => GetField(value, 'target'), * display: (value) => StringJoin`${Multiply(Divide(GetField(value, 'value'), GetField(value, 'target')), 100)}%`, * }) * ) * ) * .toTemplate() * ``` */ progress(def: { /** The {@link EastFunction} for the progress value. **/ value: (stream: Variable, inputs: Inputs) => EastFunction; /** The {@link EastFunction} for rendered progress value. **/ display?: (stream: Variable, inputs: Inputs) => EastFunction; /** The {@link EastFunction} for the minimum possible value (default 0) **/ min?: (stream: Variable, inputs: Inputs) => EastFunction; /** The {@link EastFunction} for the minimum possible value (default 100) **/ max?: (stream: Variable, inputs: Inputs) => EastFunction; /** The tooltip {@link EastFunction} value **/ tooltip?: (stream: Variable, inputs: Inputs) => EastFunction; }): HeaderItemFinalizer; } /** * Define a UI Header container from one or more {@link Stream}'s within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // a stream containing a number * const number = Stream("My Number Stream", FloatType) * * // a stream containing a string * const string = Stream("My String Stream", StringType) * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * ) * .header(builder => builder * .value("A percentage", number, (value) => StringJoin`${value}%`) * .value("A string", string) * * ) * .toTemplate() * ``` */ export declare class HeaderItemFinalizer { private item; /** @internal */ constructor(item: HeaderItem); /** @internal */ toItem(): HeaderItem; } /** * Define a UI file upload from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks A Upload requires a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a BlobType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .upload("My Upload", builder => builder * .fromStream(stream) * ) * .toTemplate() * ``` */ export declare class UploadBuilder { private name; private module; /** * Define a UI Upload from a {@link Stream} within a {@link LayoutBuilder}. * * @remarks A Upload is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .upload("My Upload", builder => builder * .fromStream(stream) * ) * .toTemplate() * ``` */ constructor(name: string, module: ModulePath); /** * Define the {@link Stream} to build a {@link UploadBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link StructType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a BlobType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .upload("My Upload", builder => builder * .fromStream(stream) * .inputs() * ) * .toTemplate() * ``` */ fromStream(stream: Stream): UploadFinalizer; } /** * @internal */ export declare class UploadFinalizer { name: string; protected stream: Stream; /** @internal */ constructor(name: string, stream: Stream); /** @internal */ toVisual(): BlobUploadVisual; } /** * Define a UI Pivot Table & Chart from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * date: DateTimeType, * }) * ) * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .pivot("My Pivot", builder => builder * .fromStream(stream) * ) * .toTemplate() * ``` */ export declare class PivotBuilder { private name; private module; /** * Define a UI Pivot Table & Chart from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * date: DateTimeType, * }) * ) * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .pivot("My Pivot", builder => builder * .fromStream(stream) * ) * .toTemplate() * ``` */ constructor(name: string, module: ModulePath); /** * Define the {@link Stream} to build a {@link PivotBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link StructType} {@link Stream} to build the table from * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * date: DateTimeType, * }) * ) * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .pivot("My Pivot", builder => builder * .fromStream(stream) * ) * .toTemplate() * ``` */ fromStream(...streams: Stream | ArrayType>[]): PivotFinalizer; } /** * @internal */ export declare class PivotFinalizer { name: string; protected streams: Stream | ArrayType>[]; /** @internal */ constructor(name: string, streams: Stream | ArrayType>[]); /** @internal */ toVisual(): PivotVisual; } /** @internal a visual builder */ type FlatLayoutBuilderType = MapFinalizer | PivotFinalizer | VegaVisualFinalizer | TableFinalizer | TabBuilder | PanelBuilder | GridBuilder | FormFinalizer | PlannerFinalizer | UploadFinalizer; /** * {@inheritDoc LayoutBuilder} * * @category Layout * */ export declare class FlatLayoutBuilder { private name; private module; /** @internal */ constructor(name: string, module: ModulePath); /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TableBuilder}. * * @param def the {@link TableBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .toTemplate() * ``` */ table(name: string, def: (panel: TableBuilder) => TableFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link MapBuilder}. * * @param def the {@link MapBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream("My Stream", [], GeoType); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .map("My Map", builder => builder * .fromStream(stream) * .layer( * "States", * { * geometry: (value) => MapFeatureCollection( * FilterFeatureCollection( * ToFeatureCollection(value), * (feature) => Equal( * Get(GetField(feature, 'properties'), Const('locality_type')), * Const('State') * ) * ), * feature => Struct({ * ...Spread(feature), * style: Struct({ * label: Get(GetField(feature, 'properties'), Const('locality')), * stroke_color: Const("#000000"), * stroke_weight: Const(0.5), * stroke_opacity: Const(0.7), * fill_color: Const("orange"), * fill_opacity: Const(1), * }), * tooltips: NewArray( * GeoTooltip, * [ * Struct({ label: Const("Locality"), value: Get(GetField(feature, 'properties'), Const('locality')) }), * Struct({ label: Const("Type"), value: Get(GetField(feature, 'properties'), Const('locality_type')) }), * ] * ) * }) * ), * visible: true * } * ) * ) * .toTemplate() * ``` */ map(name: string, def: (panel: MapBuilder) => MapFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link VegaBuilder}. * * @param def the {@link VegaBuilder} to embed. * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a vega to a tab * const layout = new LayoutBuilder("My Layout") * .vega("My Scatter", builder => builder * .fromStream(stream) * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * ) * .toTemplate() * ``` */ vega(name: string, def: (panel: VegaBuilder) => VegaVisualFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link FormBuilder}. * * @param def the {@link FormBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * }) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .form(100, "My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ form(name: string, def: (panel: FormBuilder) => FormFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link CalendarBuilder}. * * @param def the {@link CalendarBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .calendar("calendar", builder => builder * .fromStream(stream.outputStream()) * .event({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * .toTemplate() * ``` */ calendar(name: string, def: (panel: CalendarBuilder) => CalendarFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TimelineBuilder}. * * @param def the {@link TimelineBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType) * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .string("label", fields => fields.label) * ) * .toTemplate() * ``` */ timeline(name: string, def: (panel: TimelineBuilder) => TimelineFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link PanelBuilder}. * * @param def the {@link PanelBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .table(100, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * .toTemplate() * ``` */ panel(orientation: 'row' | 'column', def: (panel: PanelBuilder) => PanelBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link GridBuilder}. * * @param def the {@link PanelBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .table("My Table", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * .toTemplate() * ``` */ grid(def: (panel: GridBuilder) => GridBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TabBuilder}. * * @param def the {@link TabBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('column', builder => builder * .tab(100, 'row', builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * .toTemplate() * ``` */ tab(def: (panel: TabBuilder) => TabBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link UploadBuilder}. * * @param def the {@link UploadBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a BlobType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .upload("My Upload", builder => builder * .fromStream(stream) * .inputs() * ) * .toTemplate() * ``` */ upload(name: string, def: (panel: UploadBuilder) => UploadFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link PivotBuilder}. * * @param def the {@link PivotBuilder} to embed. * * @category Layout * * @example * ```typescript * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * date: DateTimeType, * }) * ) * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .pivot("My Pivot", builder => builder * .fromStream(stream) * ) * .toTemplate() * ``` */ pivot(name: string, def: (panel: PivotBuilder) => PivotFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from the contents of a {@link LayoutBuilder}. * * @param def the {@link LayoutBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a layout containing a form * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * .toTemplate() * * // create a layout with a panel, containing the layout * const layout = new LayoutBuilder("My Layout") * .layout(layout) * .toTemplate() * ``` */ layout

(def: FlatLayoutFinalizer

): FlatLayoutFinalizer

; } /** * {@inheritDoc LayoutBuilder} * * @category Layout * */ export declare class FlatLayoutFinalizer extends Builder { visual: T; header_visual?: HeaderBuilder | undefined; chat_visual?: ChatBuilder | undefined; toolbar?: LayoutToolbar | undefined; /** @internal */ constructor(name: string, module: ModulePath, visual: T, header_visual?: HeaderBuilder | undefined, chat_visual?: ChatBuilder | undefined, toolbar?: LayoutToolbar | undefined); /** * Define if the {@link Stream} targets button and menu will visible within a {@link LayoutBuilder}. * * @param show toolbar button will be displayed if true * @param toolbar the configuration of the toolbar * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .targetsToolbar(true, { label: "Recommendations", show_targets: true }) * .toTemplate() * ``` */ targetsToolbar(show: false): FlatLayoutFinalizer; targetsToolbar(show: true, options?: { show_targets?: boolean; label: string; }): FlatLayoutFinalizer; /** * Define if the {@link Task} button and menu will visible within a {@link LayoutBuilder}. * * @param show toolbar button will be displayed if true * @param toolbar the configuration of the toolbar * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .tasksToolbar(true, { label: "Tasks", show_idle: false }) * .toTemplate() * ``` */ tasksToolbar(show: false): FlatLayoutFinalizer; tasksToolbar(show: true, options?: { show_idle?: boolean; label: string; }): FlatLayoutFinalizer; /** * Define if the {@link Task} button and menu will visible within a {@link LayoutBuilder}. * * @param show toolbar button will be displayed if true * @param toolbar the configuration of the toolbar * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .downloadsToolbar(true, { * label: "Tasks", * streams: { * "My STream": stream * } * }) * .toTemplate() * ``` */ downloadsToolbar(show: false): FlatLayoutFinalizer; downloadsToolbar(show: true, options: { streams: Record; label?: string; }): FlatLayoutFinalizer; /** * Define if the {@link Task} button and menu will visible within a {@link LayoutBuilder}. * * @param show toolbar button will be displayed if true * @param toolbar the configuration of the toolbar * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .errorsToolbar(true, { label: "Problems" }) * .toTemplate() * ``` */ errorsToolbar(show: false): FlatLayoutFinalizer; errorsToolbar(show: true, options?: { label?: string; }): FlatLayoutFinalizer; /** * Add a {@link HeaderBuilder} to display in the Layout. * * @param def the {@link HeaderBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * min_float: FloatType, * max_float: FloatType, * integer: IntegerType, * boolean: BooleanType, * }) * ) * ); * * // a stream containing a number * const number = Stream("My Number Stream", FloatType) * * // a stream containing a string * const string = Stream("My String Stream", StringType) * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * ) * .header(builder => builder * .item("A number", number) * .item("A string", string) * * ) * .toTemplate() * ``` */ header(def: (panel: HeaderBuilder) => HeaderBuilder): FlatLayoutFinalizer; /** * Add a {@link HeaderBuilder} to display in the Layout. * * @param def the {@link HeaderBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * min_float: FloatType, * max_float: FloatType, * integer: IntegerType, * boolean: BooleanType, * }) * ) * ); * * // a stream containing a number * const number = Stream("My Number Stream", FloatType) * * // a stream containing a string * const string = Stream("My String Stream", StringType) * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * ) * .header(builder => builder * .item("A number", number) * .item("A string", string) * * ) * .toTemplate() * ``` */ chat(def: (panel: ChatBuilder) => ChatBuilder): FlatLayoutFinalizer; /** * Convert the built layout into an {@link Template}, for usage in an EDK project. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .table(50, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * .toTemplate() * ``` */ toTemplate(): Template; /** @internal */ toVisual(): FlatLayoutVisual; } /** * {@inheritDoc LayoutBuilder} * * @category Layout * */ export declare class PagedLayoutBuilder extends Builder { visuals: FlatLayoutFinalizer[]; /** @internal */ constructor(name: string, module: ModulePath, visuals: FlatLayoutFinalizer[]); /** * Add a new Page from a {@link LayoutBuilder} to display in the UI from a {@link TabBuilder}. * * @param def the {@link TabBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .page("Page One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .page("Page Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * .toTemplate() * ``` */ page(name: string, def: (panel: FlatLayoutBuilder) => FlatLayoutFinalizer): PagedLayoutBuilder; /** * Convert the built layout into an {@link Template}, for usage in an EDK project. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .table(50, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * .toTemplate() * ``` */ toTemplate(): Template; /** @internal */ toVisual(): PagedLayoutVisual; } /** @internal */ type AccordionLayoutBuilderType = FlatLayoutFinalizer | PagedLayoutBuilder; /** * Add an {@link AccordionItemBuilder} within an {@link AccordionItemBuilder} to display in the UI. * * @param def the {@link AccordionItemBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .item("Item Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * .toTemplate() * ``` */ export declare class AccordionItemBuilder { name: string; private module; /** @internal */ constructor(name: string, module: ModulePath); /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TableBuilder}. * * @param def the {@link TableBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * )bnZSTYWECX * ) * ) * .toTemplate() * ``` */ table(name: string, def: (panel: TableBuilder) => TableFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TableBuilder}. * * @param def the {@link TableBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream("My Stream", [], GeoType); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .map("My Map", builder => builder * .fromStream(stream) * .layer( * "States", * { * geometry: (value) => MapFeatureCollection( * FilterFeatureCollection( * ToFeatureCollection(value), * (feature) => Equal( * Get(GetField(feature, 'properties'), Const('locality_type')), * Const('State') * ) * ), * feature => Struct({ * ...Spread(feature), * style: Struct({ * label: Get(GetField(feature, 'properties'), Const('locality')), * stroke_color: Const("#000000"), * stroke_weight: Const(0.5), * stroke_opacity: Const(0.7), * fill_color: Const("orange"), * fill_opacity: Const(1), * }), * tooltips: NewArray( * GeoTooltip, * [ * Struct({ label: Const("Locality"), value: Get(GetField(feature, 'properties'), Const('locality')) }), * Struct({ label: Const("Type"), value: Get(GetField(feature, 'properties'), Const('locality_type')) }), * ] * ) * }) * ), * visible: true * } * ) * ) * ) * ) * ) * .toTemplate() * ``` */ map(name: string, def: (panel: MapBuilder) => MapFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link VegaBuilder}. * * @param def the {@link VegaBuilder} to embed. * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * ) * ) * ) * .toTemplate() * ``` */ vega(name: string, def: (panel: VegaBuilder) => VegaVisualFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link FormBuilder}. * * @param def the {@link FormBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .form(100, "My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * ) * ) * .toTemplate() * ``` */ form(name: string, def: (panel: FormBuilder) => FormFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TimelineBuilder}. * * @param def the {@link TimelineBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType) * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .string("label", fields => fields.label) * ) * .toTemplate() * ``` */ timeline(name: string, def: (panel: TimelineBuilder) => TimelineFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link CalendarBuilder}. * * @param def the {@link CalendarBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * ) * ) * .toTemplate() * ``` */ calendar(name: string, def: (panel: CalendarBuilder) => CalendarFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link PanelBuilder}. * * @param def the {@link PanelBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .panel('row', builder => builder * .table(100, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * ) * ) * ) * .toTemplate() * ``` */ panel(orientation: 'row' | 'column', def: (panel: PanelBuilder) => PanelBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link GridBuilder}. * * @param def the {@link PanelBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .grid(builder => builder * .table("My Table", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * ) * ) * ) * .toTemplate() * ``` */ grid(def: (grid: GridBuilder) => GridBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TabBuilder}. * * @param def the {@link TabBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .tab(100, 'row', builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * ) * .toTemplate() * ``` */ tab(def: (panel: TabBuilder) => TabBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link UploadBuilder}. * * @param def the {@link UploadBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .upload("My Upload", builder => builder * .fromStream(stream) * .inputs() * ) * ) * ) * ) * .toTemplate() * ``` */ upload(name: string, def: (panel: UploadBuilder) => UploadFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link PivotBuilder}. * * @param def the {@link PivotBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .pivot("My Pivot", builder => builder * .fromStream(stream) * ) * ) * ) * ) * .toTemplate() * ``` */ pivot(name: string, def: (panel: PivotBuilder) => PivotFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from the contents of a {@link LayoutBuilder}. * * @param def the {@link LayoutBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a layout containing a form * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * .toTemplate() * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .layout(layout) * ) * ) * ) * .toTemplate() * ``` */ layout(def: FlatLayoutFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TabBuilder}. * * @param def the {@link TabBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .page("Page One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .page("Page Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * ) * .toTemplate() * ``` */ page(name: string, def: (panel: FlatLayoutBuilder) => FlatLayoutFinalizer): PagedLayoutBuilder; } /** * Add an {@link AccordionGroupBuilder} within a {@link AccordionBuilder} to display in the UI. * * @param def the {@link AccordionGroupBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .item("Item Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * .toTemplate() * ``` */ export declare class AccordionGroupBuilder { name: string; private module; visuals: AccordionLayoutBuilderType[]; /** @internal */ constructor(name: string, module: ModulePath, visuals: AccordionLayoutBuilderType[]); /** * Add an {@link AccordionItemBuilder} within an {@link AccordionGroupBuilder} to display in the UI. * * @param def the {@link AccordionItemBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .item("Item Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * .toTemplate() * ``` */ item(name: string, def: (panel: AccordionItemBuilder) => AccordionLayoutBuilderType): AccordionGroupBuilder; } /** * Add an {@link AccordionBuilder} to display in the UI. * * @param def the {@link AccordionBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .item("Item Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * .toTemplate() * ``` */ export declare class AccordionBuilder extends Builder { groups: AccordionGroupBuilder[]; private numbered; /** @internal */ constructor(name: string, module: ModulePath, groups: AccordionGroupBuilder[], numbered?: boolean); /** * Add an {@link AccordionGroupBuilder} within an {@link AccordionBuilder} to display in the UI. * * @param def the {@link AccordionGroupBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .item("Item Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * .toTemplate() * ``` */ group(name: string, def: (panel: AccordionGroupBuilder) => AccordionGroupBuilder): AccordionBuilder; /** * Disable the numbering displayed in an Accordion in the UI. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .item("Item Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * .disableNumbering() * .toTemplate() * ``` */ disableNumbering(): AccordionBuilder; /** * Convert the built layout into an {@link Template}, for usage in an EDK project. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .table(50, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * .toTemplate() * ``` */ toTemplate(): Template; /** @internal */ toVisual(): AccordionLayoutVisual; } /** * A {@link LayoutBuilder} to display in the UI from a {@link TableBuilder}. * * @param def the {@link TableBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * float: FloatType, * integer: IntegerType, * boolean: BooleanType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .integer("Integer", fields => fields.integer) * .boolean("Boolean", fields => fields.boolean) * .float("Float", fields => fields.float) * ) * .toTemplate() * ``` */ export declare class LayoutBuilder { private name; private module; /** @internal */ constructor(name: string, module?: ModuleBuilder | ModulePath); /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TableBuilder}. * * @param def the {@link TableBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .toTemplate() * ``` */ table(name: string, def: (panel: TableBuilder) => TableFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TableBuilder}. * * @param def the {@link TableBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream("My Stream", [], GeoType); * * // add a table to a tab * const layout = new LayoutBuilder("My Layout") * .map("My Map", builder => builder * .fromStream(stream) * .layer( * "States", * { * geometry: (value) => MapFeatureCollection( * FilterFeatureCollection( * ToFeatureCollection(value), * (feature) => Equal( * Get(GetField(feature, 'properties'), Const('locality_type')), * Const('State') * ) * ), * feature => Struct({ * ...Spread(feature), * style: Struct({ * label: Get(GetField(feature, 'properties'), Const('locality')), * stroke_color: Const("#000000"), * stroke_weight: Const(0.5), * stroke_opacity: Const(0.7), * fill_color: Const("orange"), * fill_opacity: Const(1), * }), * tooltips: NewArray( * GeoTooltip, * [ * Struct({ label: Const("Locality"), value: Get(GetField(feature, 'properties'), Const('locality')) }), * Struct({ label: Const("Type"), value: Get(GetField(feature, 'properties'), Const('locality_type')) }), * ] * ) * }) * ), * visible: true * } * ) * * .toTemplate() * ``` */ map(name: string, def: (panel: MapBuilder) => MapFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link VegaBuilder}. * * @param def the {@link VegaBuilder} to embed. * * @remarks See [Vega-Lite](https://vega.github.io/vega-lite/) for more information about specifications. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a vega to a tab * const layout = new LayoutBuilder("My Layout") * .vega("My Scatter", builder => builder * .fromStream(stream) * .scatter({ * x: (fields) => fields.date, * y: (fields) => fields.integer, * color: (fields) => fields.string, * size: (fields) => fields.float, * }) * ) * .toTemplate() * ``` */ vega(name: string, def: (panel: VegaBuilder) => VegaVisualFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link FormBuilder}. * * @param def the {@link FormBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * StructType({ * string: StringType, * date: DateTimeType, * }) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .form(100, "My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .toTemplate() * ``` */ form(name: string, def: (panel: FormBuilder) => FormFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TimelineBuilder}. * * @param def the {@link TimelineBuilder} to embed. * * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * id: StringType, * label: StringType, * start: DateTimeType, * end: DateTimeType, * dependencies: SetType(StringType) * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .timeline("timeline", builder => builder * .fromStream(stream.outputStream()) * .tasks((fields) => Struct({ * id: fields.id, * label: fields.label, * start: fields.start, * end: fields.end, * dependencies: fields.dependencies * })) * .string("label", fields => fields.label) * ) * .toTemplate() * ``` */ timeline(name: string, def: (panel: TimelineBuilder) => TimelineFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link CalendarBuilder}. * * @param def the {@link CalendarBuilder} to embed. * * @remarks A Form is editable when defined from a writable {@link Stream}, such as produced by a {@link SourceBuilder} * * @category Layout * * @example * ```typescript * // use a StructType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * label: StringType, * start: DateTimeType, * end: DateTimeType, * }) * ) * ); * * // create a form in a layout * const layout = new LayoutBuilder("My Layout") * .planner("calendar", builder => builder * .fromStream(stream.outputStream()) * .calendar({ * label: (fields) => fields.label, * start: (fields) => fields.start, * end: (fields) => fields.end, * }) * ) * .toTemplate() * ``` */ calendar(name: string, def: (panel: CalendarBuilder) => CalendarFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link PanelBuilder}. * * @param def the {@link PanelBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('row', builder => builder * .table(100, "My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * .toTemplate() * ``` */ panel(orientation: 'row' | 'column', def: (panel: PanelBuilder) => PanelBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link PanelBuilder}. * * @param def the {@link PanelBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .grid(builder => builder * .table("My Table", { w: 3, h: 2, x: 0, y: 0, is_static: false }, builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * ) * .toTemplate() * ``` */ grid(def: (panel: GridBuilder) => GridBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TabBuilder}. * * @param def the {@link TabBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // add a form to a tab * const layout = new LayoutBuilder("My Layout") * .panel('column', builder => builder * .tab(100, 'row', builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * .showKey(false) * ) * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * .toTemplate() * ``` */ tab(def: (panel: TabBuilder) => TabBuilder): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link UploadBuilder}. * * @param def the {@link UploadBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a BlobType stream * const stream = Stream( * "My Stream", * BlobType, * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .upload("My Upload", builder => builder * .fromStream(stream) * .inputs() * ) * .toTemplate() * ``` */ upload(name: string, def: (panel: UploadBuilder) => UploadFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link PivotBuilder}. * * @param def the {@link PivotBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * date: DateTimeType, * }) * ) * ); * * // create a upload in a layout * const layout = new LayoutBuilder("My Layout") * .pivot("My Pivot", builder => builder * .fromStream(stream) * ) * .toTemplate() * ``` */ pivot(name: string, def: (panel: PivotBuilder) => PivotFinalizer): FlatLayoutFinalizer; /** * Create a {@link LayoutBuilder} to display in the UI from the contents of a {@link LayoutBuilder}. * * @param def the {@link LayoutBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a layout containing a form * const layout = new LayoutBuilder("My Layout") * .form("My Form", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * .toTemplate() * * // create a layout with a panel, containing the layout * const layout = new LayoutBuilder("My Layout") * .layout(layout) * .toTemplate() * ``` */ layout

(def: FlatLayoutFinalizer

): FlatLayoutFinalizer

; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link TabBuilder}. * * @param def the {@link TabBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .page("Page One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .page("Page Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * .toTemplate() * ``` */ page(name: string, def: (panel: FlatLayoutBuilder) => FlatLayoutFinalizer): PagedLayoutBuilder; /** * Create a {@link LayoutBuilder} to display in the UI from a {@link AccordionBuilder}. * * @param def the {@link AccordionBuilder} to embed. * * @category Layout * * @example * ```typescript * // use a DictType stream * const stream = Stream( * "My Stream", * DictType( * StringType, * StructType({ * string: StringType, * date: DateTimeType, * }) * ) * ); * * // create a table in a layout * const layout = new LayoutBuilder("My Layout") * .accordion(builder => builder * .group("Group One", builder => * .item("Item One", builder => builder * .table("My Table", builder => builder * .fromStream(stream) * .date("Date", fields => fields.date) * .string("String", fields => fields.string) * ) * ) * .item("Item Two", builder => builder * .table("My Other Table", builder => builder * .fromStream(stream) * .columns() * ) * ) * ) * ) * .toTemplate() * ``` */ accordion(def: (panel: AccordionBuilder) => AccordionBuilder): AccordionBuilder; } export {};