apache / apache/echarts

[Feature] Filter function based graph categories

Open
#20,912 0 comments 0 reactions 0 assignees View on GitHub
new-feature
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

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

2. 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:

```ts
const categories = [
{
name: 'Main',
filterFn: (node: any) => {
return node.isMain
},
},
{
name: 'Error',
filterFn: (node: any) => {
return node.isError ?? false
},
},
]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.