What problem does this feature solve?
This would help:
- Allowing categories to not be bound by a single value from the node
If we want to define 2 or more legends that target different properties on the same graph, supporting a filter function instead of a specific predefined category field would allow us to select a specific field from the node for each category thus allowing more flexibility.
- Allowing categories to target composite values
Using a filter function, we could build categories that depend on 2 or more properties of the node instead of being limited to 1.
What does the proposed API look like?
Something like this should work, and can also be implemented in a way that it is backwards compatible with the current API:
const categories = [
{
name: 'Main',
filterFn: (node: any) => {
return node.isMain
},
},
{
name: 'Error',
filterFn: (node: any) => {
return node.isError ?? false
},
},
]
What problem does this feature solve?
This would help:
If we want to define 2 or more legends that target different properties on the same graph, supporting a filter function instead of a specific predefined
categoryfield would allow us to select a specific field from the node for each category thus allowing more flexibility.Using a filter function, we could build categories that depend on 2 or more properties of the node instead of being limited to 1.
What does the proposed API look like?
Something like this should work, and can also be implemented in a way that it is backwards compatible with the current API: