Interface CustomVisualizationProps Beta<DataOptions, StyleOptions, DataPoint, CustomOptions>
Defines props passed to a user-defined custom visualization component.
Example
import {
CustomVisualization,
CustomVisualizationProps,
CustomVisualizationDataPoint,
StyledColumn,
StyledMeasureColumn,
DataPointEntry,
GenericDataOptions,
} from '@sisense/sdk-ui';
interface MyDataOptions extends GenericDataOptions {
category: StyledColumn[];
value: StyledMeasureColumn[];
}
interface MyDataPoint extends CustomVisualizationDataPoint {
entries: {
category: DataPointEntry[];
value: DataPointEntry[];
};
}
type MyChartProps = CustomVisualizationProps<MyDataOptions, {}, MyDataPoint>;
const MyChart: CustomVisualization<MyChartProps> = ({ dataOptions, onDataPointClick }) => {
return <div>My Chart</div>;
};
Type parameters
| Parameter | Default | Description |
|---|---|---|
DataOptions | GenericDataOptions | The shape of data options for this custom visualization. |
StyleOptions | CustomVisualizationStyleOptions | The shape of style options for this custom visualization. |
DataPoint extends AbstractDataPointWithEntries | AbstractDataPointWithEntries | The shape of data points passed to event handlers. |
CustomOptions | Record< string, unknown > | The shape of arbitrary plugin-specific state (not data- or style-related). |
Properties
Callbacks
onDataPointClick
onDataPointClick?:
CustomVisualizationDataPointEventHandler<DataPoint>
Click handler callback for a data point
onDataPointContextMenu
onDataPointContextMenu?:
CustomVisualizationDataPointContextMenuHandler<DataPoint>
Context menu handler callback for a data point
onDataPointsSelected
onDataPointsSelected?:
CustomVisualizationDataPointsEventHandler<DataPoint>
Handler callback for selection of multiple data points
Other
customOptions Beta
customOptions?:
CustomOptions
Arbitrary plugin-specific runtime state that is not data- or style-related (for example the current page of a table or a selected tab). Persisted back to the Sisense instance when the widget lives inside a Dashboard component, so it survives page reloads.
dataOptions
dataOptions:
DataOptions
Data options defining what data to display
dataSource
dataSource?:
DataSource
Data source for the custom visualization
filters
filters?:
FilterRelations|Filter[]
Filters to apply to the data
highlights
highlights?:
Filter[]
Highlight filters for interactive highlighting
onChange Beta
onChange?: (
update) =>void
Emits a partial state update to be persisted through the dashboard persistence layer. Injected by the dashboard when the widget lives inside a Dashboard component; undefined in standalone use or read-only mode — always call it with optional chaining.
Example
onChange?.({ customOptions: { lastPage: 3 } });
Parameters
| Parameter | Type |
|---|---|
update | VisualizationStateUpdate< StyleOptions, CustomOptions > |
Returns
void
styleOptions
styleOptions?:
StyleOptions
Style options for customizing appearance