Skip to content

Commit

Permalink
fix: correct axis schema to clarify which properties support expression
Browse files Browse the repository at this point in the history
fix #6986
  • Loading branch information
kanitw committed Jan 4, 2021
1 parent a645313 commit 90f2c8a
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 91 deletions.
110 changes: 20 additions & 90 deletions build/vega-lite-schema.json
Expand Up @@ -1065,15 +1065,8 @@
]
},
"domain": {
"anyOf": [
{
"description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`",
"type": "boolean"
},
"domainCap": {
"anyOf": [
Expand Down Expand Up @@ -1506,15 +1499,8 @@
]
},
"labels": {
"anyOf": [
{
"description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.",
"type": "boolean"
},
"maxExtent": {
"anyOf": [
Expand Down Expand Up @@ -1675,15 +1661,8 @@
]
},
"tickExtra": {
"anyOf": [
{
"description": "Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `\"bandPosition\": 1` and an axis `\"padding\"` value of `0`.",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `\"bandPosition\": 1` and an axis `\"padding\"` value of `0`.",
"type": "boolean"
},
"tickMinStep": {
"anyOf": [
Expand Down Expand Up @@ -1722,15 +1701,8 @@
]
},
"tickRound": {
"anyOf": [
{
"description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`",
"type": "boolean"
},
"tickSize": {
"anyOf": [
Expand Down Expand Up @@ -1763,15 +1735,8 @@
]
},
"ticks": {
"anyOf": [
{
"description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`",
"type": "boolean"
},
"title": {
"anyOf": [
Expand Down Expand Up @@ -2050,15 +2015,8 @@
"type": "boolean"
},
"domain": {
"anyOf": [
{
"description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`",
"type": "boolean"
},
"domainCap": {
"anyOf": [
Expand Down Expand Up @@ -2491,15 +2449,8 @@
]
},
"labels": {
"anyOf": [
{
"description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.",
"type": "boolean"
},
"maxExtent": {
"anyOf": [
Expand Down Expand Up @@ -2660,15 +2611,8 @@
]
},
"tickExtra": {
"anyOf": [
{
"description": "Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `\"bandPosition\": 1` and an axis `\"padding\"` value of `0`.",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `\"bandPosition\": 1` and an axis `\"padding\"` value of `0`.",
"type": "boolean"
},
"tickMinStep": {
"anyOf": [
Expand Down Expand Up @@ -2707,15 +2651,8 @@
]
},
"tickRound": {
"anyOf": [
{
"description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`",
"type": "boolean"
},
"tickSize": {
"anyOf": [
Expand Down Expand Up @@ -2748,15 +2685,8 @@
]
},
"ticks": {
"anyOf": [
{
"description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`",
"type": "boolean"
},
{
"$ref": "#/definitions/ExprRef"
}
]
"description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`",
"type": "boolean"
},
"title": {
"anyOf": [
Expand Down
37 changes: 36 additions & 1 deletion src/axis.ts
Expand Up @@ -39,14 +39,49 @@ interface AxisOverrideMixins<ES extends ExprRef | SignalRef> {
*/
tickMinStep?: number | ES;

// Override comments to be Vega-Lite specific
// ---------- Properties that do not support signal / expression ----------
/**
* A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.
*
* __Default value:__ `true`
*/
domain?: boolean;

/**
* A boolean flag indicating if grid lines should be included as part of the axis
*
* __Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.
*/
grid?: boolean;

/**
* A boolean flag indicating if labels should be included as part of the axis.
*
* __Default value:__ `true`.
*/
labels?: boolean;

/**
* Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `"bandPosition": 1` and an axis `"padding"` value of `0`.
*/
tickExtra?: boolean;

/**
* Boolean flag indicating if pixel position values should be rounded to the nearest integer.
*
* __Default value:__ `true`
*/
tickRound?: boolean;

/**
* Boolean value that determines whether the axis should include ticks.
*
* __Default value:__ `true`
*/
ticks?: boolean;

// Override comments to be Vega-Lite specific

/**
* Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.
*
Expand Down

0 comments on commit 90f2c8a

Please sign in to comment.