Skip to content

What is difference between domain "expr" and domainRaw "expr"? #9055

Closed Answered by lsh
jwoLondon asked this question in Q&A
Discussion options

You must be logged in to vote

A reason to use domainRaw is that it doesn't overwrite the inferred domain, and when domainRaw evaluates to null, the inferred domain is used. A minimal(ish) example is the following snippet:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A simple bar chart with embedded data.",
  "data": {
    "values": [
      {"a": "A", "b": 28},
      {"a": "B", "b": 55},
      {"a": "C", "b": 43},
      {"a": "D", "b": 91},
      {"a": "E", "b": 81},
      {"a": "F", "b": 53},
      {"a": "G", "b": 19},
      {"a": "H", "b": 87},
      {"a": "I", "b": 52}
    ]
  },
  "mark": {"type": "bar", "clip": true},
  "encoding": {
    "x": {"field": "a", "type": "nominal", "…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jwoLondon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants