Updating

Updating a Dashboard

Initializing the Vizzly API

Ensure you have loaded the Vizzly package by following the prerequisite steps in our initializing guide. You will then be able to instantiate the Vizzly API using the following code

const api = new Vizzly.API(<< Identity function >>);

Note that << Identity function >> is your identity function itself, not the returned value from it. Feel free to reuse the same identity function that you use to render the Vizzly dashboard. For more information about the identity function, see the identity docs

To update an existing dashboard, use the updateDashboard method with the dashboard's Id and the desired changes encapsulated in an options object.

Using the Method

// The ID of the dashboard to be updated
const dashboardId: string = "dsh_...";
 
// The changes to apply to the dashboard
const updateOptions: UpdateDashboardOptions = {
  // ...your update parameters here
};
 
// Updating the dashboard and processing the result
await api.updateDashboard(dashboardId, updateOptions);

Parameters for updatingDashboard

  • dashboardId: The unique identifier for the dashboard you intend to update.
  • updateOptions: A set of key-value pairs representing the properties to be updated on the dashboard.

Here's the TypeScript type definition:

updateDashboard(dashboardId: string, updateOptions: UpdateDashboardOptions)
 
type UpdateDashboardOptions = { metadata?: VizzlyDashboard['metadata'] };