Skip to content

Feature: array & objects are difficult to handle #33

Description

@BQXBQX

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:

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions