Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xAccessor as a function #551

Closed
nickofthyme opened this issue Feb 13, 2020 · 0 comments · Fixed by #574
Closed

xAccessor as a function #551

nickofthyme opened this issue Feb 13, 2020 · 0 comments · Fixed by #574
Labels
enhancement New feature or request :specs Chart specifications related issue :vislib Relating to vislib replacement

Comments

@nickofthyme
Copy link
Collaborator

Currently, all accessors are a string or number to be used as lookup keys on an array or object (aka the Datum)

const accessor = 'x';
const datum = {
  x: 'a',
};
const x = datum[accessor];

This proposal would introduce the idea of the xAccessor as being a function such as...

const accessor = (d: Datum) => d.x ?? '_all';
const datum = {
  x: 'a',
};
const x = accessor(datum);
@nickofthyme nickofthyme added enhancement New feature or request :specs Chart specifications related issue :vislib Relating to vislib replacement labels Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request :specs Chart specifications related issue :vislib Relating to vislib replacement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant