filter

filter.clear

clear(): void

Remove every active filter and forget all tracked handles.

Returns: void

Example

const f1 = api.filter.nodes.range({ property: "age", min: 18 });
const f2 = api.filter.edges.match({ property: "relationship", oneOf: ["WORKS_AT"] });

// Reset the view
api.filter.clear();

console.log(f1.isActive()); // false
console.log(api.filter.list().length); // 0

After clear(), any retained FilterHandle references will report isActive() === false and become inert.