antvis / antvis/expr

Feature: array & objects are difficult to handle

Open
#33 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
26
Forks
1
PR merge metrics
No merged PRs in 30d

Description

When i write some demo for `expr`, i meet a problem:
If you don't use `register` to define your own functions and only use template syntax, it is difficult to handle `arrays` and `objects`.Here is an example:
```js
const spec = {
type: 'line',
height: 400,
width: 540,
legend: false,
y: 300,
encode: {
x: 'name',
y: 'value'
},
scale: {
y: {
independent: true
}
},
labels: [{
text: '{a.value}',
// here is the problem, how to filter this array 🤔
selector: '{a}',
}, ],
axis: {
y: {
position: 'right',
grid: null,
},
},
},
}
```
I want to filter only the data of a certain index in the `labels` `selector`, but it is difficult to handle using only template syntax.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.