ObjectPropertyBag
Defined in: src/widgets/base.ts:76
A dynamic property bag that provides convenient access to an object's properties.
This class uses a JavaScript Proxy to allow accessing properties directly by name:
viewer.props.showAxes = true; // Instead of: viewer.setOptions({showAxes: true})
console.log(viewer.props.color);
The Proxy intercepts property access and routes it through the underlying property system, which handles type conversion and validation.
Note: Due to the dynamic Proxy nature, TypeScript cannot provide
compile-time type checking for property access. Use getProperties() to
discover available properties at runtime.
Example
// Access viewer properties
const scatter = view.scatterPlot();
scatter.props.xColumnName = 'age';
scatter.props.yColumnName = 'weight';
// Enumerate available properties
for (const prop of scatter.props.getProperties()) {
console.log(prop.name, prop.propertyType);
}
Constructors
Constructor
new ObjectPropertyBag(
source,x?):ObjectPropertyBag
Defined in: src/widgets/base.ts:80
Parameters
| Parameter | Type | Default value |
|---|---|---|
source | any | undefined |
x | any | null |
Returns
ObjectPropertyBag
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
source | any | The source object whose properties are being wrapped | src/widgets/base.ts:78 |
Methods
get()
get(
propertyName):object
Defined in: src/widgets/base.ts:129
Gets the value of the specified property