# Function modifyFilter
modifyFilter(
dashboard
,filterToModify
,newFilter
):DashboardProps
Creates a new dashboard instance with a specific filter modified.
This function searches for a filter with the same GUID as the provided filterToModify
and replaces it with newFilter
.
This function does not modify the original dashboard; instead, it returns a new dashboard with the updated filters.
# Parameters
Parameter | Type | Description |
---|---|---|
dashboard | DashboardProps | The original dashboard (DashboardProps ) containing the filter to modify. |
filterToModify | Filter | The existing filter to be modified. |
newFilter | Filter | The new filter to replace the existing one. |
# Returns
A new dashboard instance with the specified filter modified.
# Example
Modify a filter in a dashboard.
const existingDashboard: DashboardProps = {...};
const filterToModify: Filter = {...};
const newFilter: Filter = {...};
const updatedDashboard = modifyFilter(existingDashboard, filterToModify, newFilter);