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

Boxplot set null quantitative to 0 #8327

Closed
yhoonkim opened this issue Jul 29, 2022 · 1 comment · Fixed by #8409
Closed

Boxplot set null quantitative to 0 #8327

yhoonkim opened this issue Jul 29, 2022 · 1 comment · Fixed by #8409

Comments

@yhoonkim
Copy link
Contributor

yhoonkim commented Jul 29, 2022

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "values": [
      {"C": "A", "X": 1, "Y": 0.7},
      {"C": "A", "X": 1.5, "Y": 0.7},
      {"C": "A", "X": null, "Y": 0.7},
      {"C": "B", "X": 1, "Y": 1.7},
      {"C": "B", "X": 1.5, "Y": 1.7},
      {"C": "B", "X": null, "Y": 1.7},
      {"C": "C", "X": 1, "Y": 2.7},
      {"C": "C", "X": 1.5, "Y": 2.7},
      {"C": "C", "X": null, "Y": 2.7}
    ]
  },
  "mark": "boxplot",
  "encoding": {
    "x": {"field": "X", "type": "quantitative"},
    "y": {"field": "Y", "type": "quantitative"}
  }
}

image

Suggestion:
The null box should be filtered out as when the box with null "Y" are filtered out:
image

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "values": [
      {"C": "A", "X": 1, "Y": 0.7},
      {"C": "A", "X": 1.5, "Y": 0.7},
      {"C": "A", "X": 2, "Y": null},
      {"C": "B", "X": 1, "Y": 1.7},
      {"C": "B", "X": 1.5, "Y": 1.7},
      {"C": "B", "X": 2, "Y": null},
      {"C": "C", "X": 1, "Y": 2.7},
      {"C": "C", "X": 1.5, "Y": 2.7},
      {"C": "C", "X": 2, "Y": null}
    ]
  },
  "mark": "boxplot",
  "encoding": {
    "x": {"field": "X", "type": "quantitative"},
    "y": {"field": "Y", "type": "quantitative"}
  }
}
@kanitw
Copy link
Member

kanitw commented Aug 8, 2022

Yeah we should make boxplot respect mark.invalid

  • If mark.invalid is null the current behavior is correct.
  • If mark.invalid is filter (default), we should filter. (But right now filter isn't respected at all.)

@kanitw kanitw added this to the 2022 Aug Polishes milestone Aug 8, 2022
yhoonkim added a commit that referenced this issue Sep 13, 2022
* add example

* Take markDef.invalid into boxplot's markdef.

* chore: update schema [CI]

* update doc

* refactor

* chore: update examples [CI]

Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
BradyJ27 pushed a commit to BradyJ27/vega-lite that referenced this issue Oct 19, 2023
* add example

* Take markDef.invalid into boxplot's markdef.

* chore: update schema [CI]

* update doc

* refactor

* chore: update examples [CI]

Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants