Skip to content

Commit

Permalink
fix: remove "and" from 'break-paths-show-path-domains'
Browse files Browse the repository at this point in the history
  • Loading branch information
kanitw committed May 17, 2024
1 parent fd8286d commit bea7425
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
]
},
"config": {
"mark": {"invalid": "break-paths-and-show-path-domains", "tooltip": true}
"mark": {"invalid": "break-paths-show-path-domains", "tooltip": true}
},
"vconcat": [
{
Expand Down Expand Up @@ -122,4 +122,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
]
},
"config": {
"mark": {"invalid": "break-paths-and-show-path-domains", "tooltip": true}
"mark": {"invalid": "break-paths-show-path-domains", "tooltip": true}
},
"vconcat": [{
"title": "Quantitative X",
Expand Down
4 changes: 2 additions & 2 deletions site/docs/invaliddata.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ Include all data points in the marks and scale domains. Each scale will use the

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

#### `"break-paths-and-show-path-domains"` (Default)
#### `"break-paths-show-path-domains"` (Default)

For historical reasons, Vega-Lite 5 currently uses `"break-paths-and-show-path-domains"` as the default invalid data mode (to avoid breaking changes). This is equivalent to `"break-path-keep-domains"` for path-based marks (line/area/trail) and `"filter"` for other marks.
For historical reasons, Vega-Lite 5 currently uses `"break-paths-show-path-domains"` as the default invalid data mode (to avoid breaking changes). This is equivalent to `"break-path-keep-domains"` for path-based marks (line/area/trail) and `"filter"` for other marks.

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

Expand Down
4 changes: 2 additions & 2 deletions src/compile/invalid/ScaleInvalidDataMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {getMarkPropOrConfig} from '../common';
import {normalizeInvalidDataMode} from './normalizeInvalidDataMode';

export type ScaleInvalidDataMode =
// remove 'break-paths-and-show-path-domains' from MarkInvalidDataMode
// remove 'break-paths-show-path-domains' from MarkInvalidDataMode
// because it is a macro for '"filter"' or `"break-path-keep-domains`
| Omit<MarkInvalidDataMode, 'break-paths-and-show-path-domains'>
| Omit<MarkInvalidDataMode, 'break-paths-show-path-domains'>

// Add always-valid because at scale level, categorical scales can handle any values and thus is always valid.
| 'always-valid';
Expand Down
4 changes: 2 additions & 2 deletions src/compile/invalid/normalizeInvalidDataMode.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {MarkInvalidDataMode} from '../../invalid';

type NormalizedMarkInvalidDataMode = Exclude<MarkInvalidDataMode, 'break-paths-and-show-path-domains'>;
type NormalizedMarkInvalidDataMode = Exclude<MarkInvalidDataMode, 'break-paths-show-path-domains'>;

export function normalizeInvalidDataMode(
mode: MarkInvalidDataMode | null | undefined,
{isPath}: {isPath: boolean}
): NormalizedMarkInvalidDataMode {
if (mode === undefined || mode === 'break-paths-and-show-path-domains') {
if (mode === undefined || mode === 'break-paths-show-path-domains') {
return isPath ? 'break-paths-show-domains' : 'filter';
} else if (mode === null) {
return 'show';
Expand Down
10 changes: 5 additions & 5 deletions src/invalid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export interface MarkInvalidMixins {
*
* - `"break-paths-show-domains"` —
* Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks.
* All *scale* domains will *include* these filtered data points.
* All *scale* domains will *include* these filtered data points (for both path and non-path marks).
*
* - `"show"` or `null` —
* Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid`
* or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).
*
* - `"break-paths-and-show-path-domains"` (default) —
* This is equivalent to `"break-path-keep-domains"` for path-based marks (line/area/trail)
* and `"filter"` for other marks.
* - `"break-paths-show-path-domains"` (default) —
* This is equivalent to `"break-paths-show-domains"` for path-based marks (line/area/trail)
* and `"filter"` for non-path marks.
*
* __Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`,
* all values for the scales will be considered "valid" since they can produce a reasonable output for the scales.
Expand All @@ -40,7 +40,7 @@ export type MarkInvalidDataMode =
| 'filter'
| 'break-paths-filter-domains'
| 'break-paths-show-domains'
| 'break-paths-and-show-path-domains'
| 'break-paths-show-path-domains'
| 'show';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/mark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export const VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX: {

export const defaultMarkConfig: MarkConfig<SignalRef> = {
color: '#4c78a8',
invalid: 'break-paths-and-show-path-domains',
invalid: 'break-paths-show-path-domains',
timeUnitBandSize: 1
};

Expand Down
6 changes: 3 additions & 3 deletions test/compile/invalid/ChannelInvalidDataMode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('compile / invalid / ChannelInvalidDataMode / getChannelInvalidDataMode
'break-paths-filter-domains',
'break-paths-show-domains',
'show',
'break-paths-and-show-path-domains'
'break-paths-show-path-domains'
];

describe.each([...PRIMITIVE_MARKS])('For all marks (%s)', mark => {
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('compile / invalid / ChannelInvalidDataMode / getChannelInvalidDataMode
it('should return the mode (%s)', () => {
expect(
getScaleInvalidDataMode({
markDef: {type: mark, invalid: 'break-paths-and-show-path-domains'},
markDef: {type: mark, invalid: 'break-paths-show-path-domains'},
scaleChannel: channel,
scaleType: 'linear',
isCountAggregate: false,
Expand All @@ -182,7 +182,7 @@ describe('compile / invalid / ChannelInvalidDataMode / getChannelInvalidDataMode
it('should return the mode (%s)', () => {
expect(
getScaleInvalidDataMode({
markDef: {type: mark, invalid: 'break-paths-and-show-path-domains'},
markDef: {type: mark, invalid: 'break-paths-show-path-domains'},
scaleChannel: channel,
scaleType: 'linear',
isCountAggregate: false,
Expand Down

0 comments on commit bea7425

Please sign in to comment.