Skip to content

[Feature] Filter function based graph categories #20912

@adrianlungu

Description

@adrianlungu

What problem does this feature solve?

This would help:

  1. 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.

  1. 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
    },
  },
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions