Layout - TimelineFinalizer
Layout.TimelineFinalizerDefine a UI planning related component, such as Calendar, Timeline or Gantt from a
Stream within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Inputs | extends Record = Record |
T | extends DictType = DictType |
Fields | extends Record = Record |
Layout
array
▸ array(name
, value
, def
, config?
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Define a
StringType input in a FormBuilder within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
F | extends (fields : TypeToFields ) => Variable <ArrayType > |
Parameters
Name | Type | Description |
---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the form label |
value | F | - |
def | (builder : FieldFinalizer <ReturnType ["type" ]["value" ], Inputs , >) => FieldFinalizer <ReturnType ["type" ]["value" ], Inputs , Record > | the definition of the form input |
config? | Object | - |
config.hidden? | boolean | - |
config.hidden_detail? | boolean | - |
config.readonly? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | - |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
boolean
▸ boolean(name
, def
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Create a
BooleanType column in the TimelineFinalizer within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
Parameters
Name | Type | Description |
---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column header |
def | Object | the definition of the column |
def.background? | string | (fields : TypeToFields ) => EastFunction | The cell background color Variable * |
def.color? | string | (fields : TypeToFields ) => EastFunction | The cell text color Variable * |
def.display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.readonly? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The column is read only. * |
def.target? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The input target value Variable * |
def.target_display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields : TypeToFields ) => EastFunction | The cell tooltip Variable * |
def.value | (fields : TypeToFields ) => Variable | The Variable to display. * |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
boundary
▸ boundary(def
):
TimelineFinalizer
Create a visible boundary in the
TimelineFinalizer within a LayoutBuilder.Parameters
Name | Type | Description |
---|---|---|
def | Date | (inputs : Inputs ) => EastFunction | A function that takes an East Function describing the a TimelineBoundaryType The following properties are defined for a TimelineBoundaryType: |
Returns
TimelineFinalizer
Example
// 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()
columns
▸ columns(def?
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string | number | symbol]: ColumnType } | { [K in string | number | symbol]: ColumnType }>
Create multiple value columns in the
TimelineFinalizer within a LayoutBuilder.Type parameters
Name | Type |
---|---|
S | extends Record <string , (fields : TypeToFields ) => Variable > |
Parameters
Name | Type | Description |
---|---|---|
def? | S | the definition of the column |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string | number | symbol]: ColumnType } | { [K in string | number | symbol]: ColumnType }>
Example
// 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()
date
▸ date(name
, def
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Create a
DateTimeType column in the TimelineFinalizer within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
Parameters
Name | Type | Description |
---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column header |
def | Object | the definition of the column |
def.background? | string | (fields : TypeToFields ) => EastFunction | The cell background color Variable * |
def.color? | string | (fields : TypeToFields ) => EastFunction | The cell text color Variable * |
def.display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.max? | Date | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The maximum Variable to allow as input. * |
def.min? | Date | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The minimum Variable to allow as input. * |
def.readonly? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The column is read only. * |
def.target? | Date | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The input target value Variable * |
def.target_display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields : TypeToFields ) => EastFunction | The cell tooltip Variable * |
def.value | (fields : TypeToFields ) => Variable | The Variable to display. * |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
dict
▸ dict(name
, value
, def
, config?
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Define a
StringType input in a FormBuilder within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
F | extends (fields : TypeToFields ) => Variable <DictType > |
Parameters
Name | Type | Description |
---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the form label |
value | F | - |
def | (builder : FieldFinalizer <ReturnType ["type" ]["value" ]["value" ], Inputs , >) => FieldFinalizer <ReturnType ["type" ]["value" ]["value" ], Inputs , Record > | the definition of the form input |
config? | Object | - |
config.hidden? | boolean | - |
config.hidden_detail? | boolean | - |
config.readonly? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | - |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
disableAdd
▸ disableAdd():
TimelineFinalizer
Disable row add for the
TimelineFinalizer within a LayoutBuilder.Returns
TimelineFinalizer
Remarks
only valid if the input stream is writable
Example
* // 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()
disableRemove
▸ disableRemove():
TimelineFinalizer
Disable row remove for the
TimelineFinalizer within a LayoutBuilder.Returns
TimelineFinalizer
Remarks
only valid if the input stream is writable
Example
// 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()
disableUndo
▸ disableUndo():
TimelineFinalizer
Disable row remove for the
TimelineFinalizer within a LayoutBuilder.Returns
TimelineFinalizer
Remarks
only valid if the input stream is writable
Example
// 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()
disableUpdate
▸ disableUpdate():
TimelineFinalizer
Disable row update for the
TimelineFinalizer within a LayoutBuilder.Returns
TimelineFinalizer
Remarks
only valid if the input stream is writable
Example
* // 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()
float
▸ float(name
, def
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Create a
FloatType column in the TimelineFinalizer within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
Parameters
Name | Type | Description |
---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column header |
def | Object | the definition of the column |
def.background? | string | (fields : TypeToFields ) => EastFunction | The cell background color Variable * |
def.color? | string | (fields : TypeToFields ) => EastFunction | The cell text color Variable * |
def.display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.max? | number | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The maximum Variable to allow as input. * |
def.min? | number | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The minimum Variable to allow as input. * |
def.readonly? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The column is read only. * |
def.target? | number | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The input target value Variable * |
def.target_display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields : TypeToFields ) => EastFunction | The cell tooltip Variable * |
def.value | (fields : TypeToFields ) => Variable | The Variable to display. * |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
input
▸ input(config
):
TimelineFinalizer
<Inputs
& { [K in string]: Variable }, T
, Fields
>
Add an additional named input
Stream to the Visual.Type parameters
Name | Type |
---|---|
Name | extends string |
I | extends EastType |
Parameters
Name | Type | Description |
---|---|---|
config | Object | the input stream and the resulting variable name |
config.name | Name extends "input" | keyof Inputs ? never : Name | The name of the input. * |
config.stream | Stream | The Stream to input. * |
Returns
TimelineFinalizer
<Inputs
& { [K in string]: Variable }, T
, Fields
>
a new
LayoutBuilderExample
* // 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()
integer
▸ integer(name
, def
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Create a
IntegerType column in the TimelineFinalizer within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
Parameters
Name | Type | Description |
---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column header |
def | Object | the definition of the column |
def.background? | string | (fields : TypeToFields ) => EastFunction | The cell background color Variable * |
def.color? | string | (fields : TypeToFields ) => EastFunction | The cell text color Variable * |
def.display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.max? | bigint | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The maximum Variable to allow as input. * |
def.min? | bigint | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The minimum Variable to allow as input. * |
def.readonly? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The column is read only. * |
def.target? | bigint | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The input target value Variable * |
def.target_display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields : TypeToFields ) => EastFunction | The cell tooltip Variable * |
def.value | (fields : TypeToFields ) => Variable | The Variable to display. * |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
set
▸ set(name
, def
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Create a
SetType column in the TimelineFinalizer within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
Parameters
Name | Type | Description |
---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column header |
def | Object | the definition of the column |
def.background? | string | (fields : TypeToFields ) => EastFunction | The cell background color Variable * |
def.color? | string | (fields : TypeToFields ) => EastFunction | The cell text color Variable * |
def.display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.range? | Set | Map <string , Set > | (fields : TypeToFields , inputs : Inputs ) => EastFunction <SetType > | EastFunction <DictType <StringType , SetType >> | The range Variable to allow as input. * |
def.readonly? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The column is read only. * |
def.target? | Set | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The input target value Variable * |
def.target_display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf <PrimitiveType | SetType> | (fields : TypeToFields ) => EastFunction <PrimitiveType | SetType> | The cell tooltip Variable * |
def.value | (fields : TypeToFields ) => Variable | The Variable to display. * |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
showKey
▸ showKey(label
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Define if the
Stream key should be visible in the TimelineFinalizer within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
Parameters
Name | Type |
---|---|
label | Name |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
string
▸ string(name
, def
):
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Create a
StringType column in the TimelineFinalizer within a LayoutBuilder.Type parameters
Name | Type |
---|---|
Name | extends string |
Parameters
Name | Type | Description |
---|---|---|
name | Name extends keyof Fields ? never : Name | the display name for the column header |
def | Object | the definition of the column |
def.background? | string | (fields : TypeToFields ) => EastFunction | The cell background color Variable * |
def.color? | string | (fields : TypeToFields ) => EastFunction | The cell text color Variable * |
def.display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.hidden? | boolean | The visibility of the field * |
def.hidden_detail? | boolean | The visibility of the field in a detail view * |
def.range? | Set | Map <string , Set > | (fields : TypeToFields , inputs : Inputs ) => EastFunction <SetType > | EastFunction <DictType <StringType , SetType >> | The range Variable to allow as input. * |
def.readonly? | boolean | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The column is read only. * |
def.target? | string | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The input target value Variable * |
def.target_display? | (fields : TypeToFields , inputs : Inputs ) => EastFunction | The string value Variable to display. * |
def.tooltip? | ValueTypeOf | (fields : TypeToFields ) => EastFunction | The cell tooltip Variable * |
def.value | (fields : TypeToFields ) => Variable | The Variable to display. * |
Returns
TimelineFinalizer
<Inputs
, T
, Fields
& { [K in string]: ColumnType }>
Example
// 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()
tasks
▸ tasks(def
):
TimelineFinalizer
Create a task in the
TimelineBuilder within a LayoutBuilder.Parameters
Name | Type | Description |
---|---|---|
def | (fields : TypeToFields , inputs : Inputs ) => EastFunction <TimelineTaskType | ArrayType | DictType > | A function that takes an East Function describing the a TimelineTaskType, or ArrayType or DictType containing one or more TimelineTaskTypes The following properties are defined for a TimelineTaskType: |
Returns
TimelineFinalizer
Example
// 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()