Skip to content

Commit

Permalink
style: auto-formatting [CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions Bot committed May 18, 2024
1 parent 8db9f0b commit 396dd57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
11 changes: 3 additions & 8 deletions site/docs/invaliddata.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ permalink: /docs/invalid-data.html

This page discusses modes in Vega-Lite for handling invalid data (`null` and `NaN` in continuous scales).

The main configurations are [`mark.invalid`](#mark) and [`config.scale.invalid`](#scale).
In addition, you can use [other Vega-Lite features including conditional encodings, layering, or window transform to handle invalid and missing data](#other).
The main configurations are [`mark.invalid`](#mark) and [`config.scale.invalid`](#scale). In addition, you can use [other Vega-Lite features including conditional encodings, layering, or window transform to handle invalid and missing data](#other).

Note: Vega-Lite does _not_ consider `null` and `NaN` in categorical scales and text encodings as invalid data:

Expand Down Expand Up @@ -105,30 +104,26 @@ Compare this with a similar spec, but without `config.scale.invalid`:

<div class="vl-example" data-name="test_invalid_color_size_mark_filter_only"></div>


## Other solutions

{:#other}

Note that `mark.invalid` and `config.scale.invalid` are options for handling invalid data *without* changing data or marks.
Note that `mark.invalid` and `config.scale.invalid` are options for handling invalid data _without_ changing data or marks.

However, you may use other Vega-Lite features to encode invalid data.


### Example: Conditional Encoding

If you do not use color encoding, you may use conditional color encoding to use a specific color (e.g., gray) to encode invalid values.

<div class="vl-example" data-name="point_invalid_color"></div>


### Example: Layering

You may also use different marks (such as bars) to encode null data.

<div class="vl-example" data-name="layer_null_data"></div>


### Example: Using window transform to impute missing values


<div class="vl-example" data-name="window_impute_null"></div>
1 change: 0 additions & 1 deletion site/docs/transform/window.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ Here we use window transform to visualize how the average MPG for vehicles have

The window transform _can_ be used to compute an aggregate and attach it to all records in order to derive a percent of total, however, a simpler approach is to use the [join aggregate](joinaggregate.html) transform instead.


### Using window transform to impute missing values

<div class="vl-example" data-name="window_impute_null"></div>

0 comments on commit 396dd57

Please sign in to comment.