interface RVG · Factories
RvgValueFactory
interface RvgValueFactory
Factory for creating observable value containers that automatically propagate changes to dependent computations and visual elements.
Methods
bool
bool(value: boolean): BoolCreates a Bool value with the specified value.
value- The boolean value.
Returns A Bool instance.
integer
integer(): IntegerCreates an Integer value initialized to 0, e.g. a counter or a page index.
The value is not rounded: write whole numbers. Animate.integer animates it in whole steps.
Returns An Integer instance with value 0.
integer(value: number): IntegerCreates an Integer value with the specified whole number.
value- The whole number.
Returns An Integer instance.
item
item(value: any): ItemCreates an Item wrapping the specified object.
value- The object to wrap.
Returns An Item instance.
pin
pin(p: Point | VectorLike): PinCreates a pin by copying an existing point.
p- The point to copy.
Returns A new pin instance.
point
point(p: Point | VectorLike): PointCreates a point by copying an existing point.
p- The point to copy.
Returns A new point instance.
real
real(value: number): RealCreates a Real value initialized to the specified number.
value- The numeric value.
Returns A Real instance.
realArray
realArray(): Sequence<number>Creates an empty reactive array of numbers.
Returns A reactive sequence of numbers.
realArray(values: Iterable<number>): Sequence<number>Creates a reactive array of numbers, e.g. the values of a data set. One dependency for many
values: a Reactive.do on the array runs once per write, also when set replaces all
numbers at once.
The numbers are stored (no Real per entry); read them with at(i), write one with the
index or all with set. Animate.realArray animates all of them.
values- The numbers.
Returns A reactive sequence of numbers.
string
string(value: string): StringValueCreates a string value with the specified string.
value- The string value.
Returns A string instance.
