# Function replaceFilters

replaceFilters(dashboard, newFilters): DashboardProps

Creates a new dashboard instance with its filters replaced by a new set of filters.

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) whose filters are to be replaced.
newFilters FilterRelations | Filter[] An array of new filters or filter relations to set on the dashboard.

# Returns

DashboardProps

A new dashboard instance with the updated filters.

# Example

Replace all filters on a dashboard with a new set of filters.

const existingDashboard: DashboardProps = {...}
const newFilters: Filter[] = [{...}, {...}, ...];
const updatedDashboard = replaceFilters(existingDashboard, newFilters);