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

Consistent application of parameter expressions for axis (and other) properties #6962

Closed
jwoLondon opened this issue Oct 16, 2020 · 2 comments · Fixed by #7148
Closed

Consistent application of parameter expressions for axis (and other) properties #6962

jwoLondon opened this issue Oct 16, 2020 · 2 comments · Fixed by #7148
Assignees

Comments

@jwoLondon
Copy link
Contributor

jwoLondon commented Oct 16, 2020

Since 4.16, it has been possible to provide expressions for many properties, but not all of them. For example, for almost all general axis properties, an expression may be provided.

However some, such as offset and zIndex do not have ExprRef options in the schema. It would be good to be able to apply expressions to all these properties, not least so it does not require consultation with the API documentation to discover whether it is possible or not.

Note also that the axis offset is actually implemented, but not recognised in the schema or documentation. Not sure if this is because it is still at the testing stage, or it was overlooked when adding experimental expressions to the schema.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "params": [
    {
      "name": "axo",
      "value": 0,
      "bind": {"input": "range", "min": -10, "max": 10, "step": 1}
    }
  ],
  "data": {"values": [ {"a": 1},{"a": 2}]},
  "encoding": {
    "x": {
      "field": "a",
      "axis": {"offset": {"expr": "axo"}}
    },
     "y": {
      "field": "a",
      "axis": {"offset": {"expr": "axo"}}
    }
  
  },
  "mark": "circle"
}
@domoritz
Copy link
Member

Thanks for the issue. Yes, the feature is pretty new and we are working on ironing out the kinks over the next few releases. In general, there are some limitations in Vega for what can be a signal and we may also have overlooked certain types so that the schema isn't correct yet.

@kanitw
Copy link
Member

kanitw commented Jan 4, 2021

Offset should support expression like you mentioned, I'm fixing this in #7148.

Given the limitation in Vega, I don't think we can make all properties support expression.

I'll close this issue since the fixable part is now fixed.

@kanitw kanitw closed this as completed Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants