-
Notifications
You must be signed in to change notification settings - Fork 595
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
Support field
in condition
#1980
Changes from 10 commits
57d8176
e39ec50
323e4bb
5c873ef
9a953fa
fba528d
46fbafe
b82b8ab
902dbb9
584361b
49a9688
ddf2317
61a62d7
06cc8dc
28a18bc
012807d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import * as log from '../../log'; | ||
|
||
import {Axis} from '../../axis'; | ||
import {Channel, COLUMN, ROW, X, Y} from '../../channel'; | ||
import {Channel, COLUMN, ROW, SpatialScaleChannel, X, Y} from '../../channel'; | ||
import {Config} from '../../config'; | ||
import {DateTime, dateTimeExpr, isDateTime} from '../../datetime'; | ||
import {FieldDef, title as fieldDefTitle} from '../../fielddef'; | ||
|
@@ -20,7 +20,7 @@ export function format(specifiedAxis: Axis, channel: Channel, fieldDef: FieldDef | |
* Default rules for whether to show a grid should be shown for a channel. | ||
* If `grid` is unspecified, the default value is `true` for ordinal scales that are not binned | ||
*/ | ||
export function gridShow(model: UnitModel, channel: Channel) { | ||
export function gridShow(model: UnitModel, channel: SpatialScaleChannel) { | ||
const grid = model.axis(channel).grid; | ||
if (grid !== undefined) { | ||
return grid; | ||
|
@@ -29,12 +29,7 @@ export function gridShow(model: UnitModel, channel: Channel) { | |
return !model.hasDiscreteDomain(channel) && !model.fieldDef(channel).bin; | ||
} | ||
|
||
export function grid(model: UnitModel, channel: Channel, isGridAxis: boolean) { | ||
if (channel === ROW || channel === COLUMN) { | ||
// never apply grid for ROW and COLUMN since we manually create rule-group for them | ||
return false; | ||
} | ||
|
||
export function grid(model: UnitModel, channel: SpatialScaleChannel, isGridAxis: boolean) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For my edification, why do we no longer skip grid for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the new layout operator, we no longer use axes for row/column but use layout header instead. Here I basically forgot to remove the code. |
||
if (!isGridAxis) { | ||
return undefined; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a "single def" channel? Perhaps a comment to explain what this class of channels is and why it's needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
I'll add