onEditorUpdate

onEditorUpdate

When Vizzly autogenerates a view in the editor, you may wish to make changes to the view before it is rendered. For example, you might wish to add a filter to the view, or set certain style properties.

The definition of the onEditorUpdate function is;

type onEditorUpdate = (
  // The most recent set of properties for the view.
  newAttributes: Attributes,
 
  // A data structure containing the available fields
  // for the view to use.
  dataSet: DataSet,
 
  // Is the update triggered by an initial, auto-generated view, or
  // from an edit in the editor panel.
  reason: 'initial' | 'edit'
) => Partial<Attributes>;

From this function, you can return a partial set of attributes that you want to be applied to the view if they are valid.