You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "mrwunderbar666 (via GitHub)" <gi...@apache.org> on 2025/05/24 21:02:33 UTC
[I] [Feature] Add "in" Operator to FilterTransform for Array Membership Filtering [echarts]
mrwunderbar666 opened a new issue, #20990:
URL: https://github.com/apache/echarts/issues/20990
### What problem does this feature solve?
Currently, the `FilterTransform` in Apache ECharts supports a rich set of conditional expressions including relational and logical operators (lt, gt, eq, reg, and, or, not, etc.). However, it does not support a mechanism to check whether a data value exists within a specified list—commonly known as an "in" operation.
Please add support for an `in` operator in `RelationalExpressionOption`, allowing developers to filter values based on membership in a list or array. This would greatly enhance the expressiveness and efficiency of data filtering within ECharts.
- Many filtering scenarios require selecting rows where a field matches one of several known values.
- Current alternatives require verbose or expressions, which are harder to write, maintain, and optimize.
- The in operator is standard in SQL and many query DSLs, and users naturally expect this functionality.
- Improves developer ergonomics and code clarity.
- Aligns with common querying patterns.
- Enhances performance for large datasets by allowing ECharts to optimize "in" checks internally.
### What does the proposed API look like?
```javascript
type RelationalExpressionOption = {
dimension: DimensionName | DimensionIndex;
parser?: 'time' | 'trim' | 'number';
in?: DataValue[]; // New operator for array membership
notIn?: DataValue[]; // Optional complement for exclusion
// existing operators...
};
// Usage example:
transform: {
type: 'filter',
config: {
in: ['Apple', 'Banana', 'Orange'],
dimension: 'fruit'
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Feature] Add "in" Operator to FilterTransform for Array Membership Filtering [echarts]
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #20990:
URL: https://github.com/apache/echarts/issues/20990#issuecomment-2910601638
a valuable feature indeed, and does not seem hard to implement 👍 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org