Appearance
Filters
Filters can be defined globally to filter nodes and edges out of the visualisation. They use a function selector that returns a boolean indicating whether the node or the edge should be visible (true) or filtered out (false). Filters are automatically applied to new nodes and edges or when their data is updated.
The following example only shows nodes having a data.properties.funding_total
property greater than 300 million.
js
// Create a filter on nodes.
const filter1 = ogma.transformations.addNodeFilter(node => {
return node.getData('properties.funding_total') > 300000000;
});
// disable the node filter.
filter1.disable()
// Destroy the filter.
filter1.destroy();