Scale padding / clamp / grace
native
Extra space beyond data extent or clamp out-of-range
Matrix status native. Verification types · strong. ChartKit option: encoding.y.scale.padding, encoding.y.scale.clamp.
scale.padding is a fraction of the span (a number, or {min, max}). scale.clamp draws a value outside an explicit domain at the domain edge. A set domain end is not padded.
Source: chartkit:packages/core/src/generated/schema.ts:977
ChartKit spec
Passed validate() during npm run matrix:refresh. The SVG is the server render.
{
"version": "1",
"type": "line",
"data": [
{
"quarter": "Q1",
"units": 40
},
{
"quarter": "Q2",
"units": 55
}
],
"encoding": {
"x": "quarter",
"y": {
"field": "units",
"scale": {
"padding": 0.08
}
}
},
"a11y": {
"alt": "Units rose in Q2."
},
"size": {
"width": 640,
"height": 260
}
}Other libraries
Option names are the paths recorded in the matrix. A grep-only cell names the identifier that matched, not a render test. Markdown copy: scale.padding.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | native | grep: grace | grep · weak | chart.js/dist/types/index.d.ts:3325 |
| Recharts | native | YAxis.padding | types · strong | recharts/types/cartesian/YAxis.d.ts:123 |
| Apache ECharts | native | yAxis.boundaryGap | types · strong | echarts/types/dist/shared.d.ts:2679 |
| Highcharts | native | yAxis.maxPadding, yAxis.minPadding | types · strong | highcharts/highcharts.d.ts:110291 |
| Plotly.js | unknown | — | conflict · unknown | — |
| Nivo | native | grep: clamp | grep · weak | @nivo/generators/dist/types/helpers.d.ts:1 |
| Victory | native | VictoryChart.domainPadding | types · strong | victory-core/lib/victory-util/common-props.d.ts:24 |
| visx | native | grep: clamp | grep · weak | @visx/drag/lib/util/clampNumber.d.ts:1 |
| ApexCharts | unknown | — | conflict · unknown | — |
| Tremor (npm) | unknown | — | conflict · unknown | — |
| Observable Plot | native | grep: clamp | grep · weak | @observablehq/plot/src/scales.d.ts:1 |
| Vega-Lite | native | grep: clamp | grep · weak | 609: "description" |
| AG Charts | native | grep: padding | grep · weak | ag-charts-types/dist/types/src/presets/sparkline/sparklineAxisOptions.d.ts:15 |
| amCharts 5 | native | grep: extraMax | grep · weak | @amcharts/amcharts5/.internal/charts/xy/axes/ValueAxis.d.ts:28 |
| Google Charts | unknown | — | conflict · unknown | — |
| uPlot | unknown | — | conflict · unknown | — |
| TradingView Lightweight Charts | native | grep: scaleMargins | grep · weak | 536:export interface AutoScaleMargins { |
| MUI X Charts | unknown | — | conflict · unknown | — |
| Mermaid (chart-ish diagrams only) | unknown | — | conflict · unknown | — |
| AntV G2 | native | grep: clamp | grep · weak | @antv/g2/lib/utils/number.d.ts:2 |