feat: add $schema to JSON specs #1037
Annotations
10 errors and 3 warnings
test/spec.test.js > Test specification: aeromagnetic-survey > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Aeromag…' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Aeromagnetic Survey",
"description": "A raster visualization of the 1955 [Great Britain aeromagnetic survey](https://www.bgs.ac.uk/datasets/gb-aeromagnetic-survey/), which measured the Earth’s magnetic field by plane. Each sample recorded the longitude and latitude alongside the strength of the [IGRF](https://www.ncei.noaa.gov/products/international-geomagnetic-reference-field) in [nanoteslas](https://en.wikipedia.org/wiki/Tesla_(unit)). This example demonstrates both raster interpolation and smoothing (blur) options.\n",
"credit": "Adapted from an [Observable Plot example](https://observablehq.com/@observablehq/plot-igfr90-raster)."
},
"data": {
"ca55": {
"type": "parquet",
"file": "data/ca55-south.parquet"
}
},
"params": {
"interp": "random-walk",
"blur": 0
},
"vconcat": [
{
"hconcat": [
{
"input": "menu",
"label": "Interpolation Method",
"options": [
"none",
"nearest",
"barycentric",
"random-walk"
],
"as": "$interp"
},
{
"hspace": "1em"
},
{
"input": "slider",
"label": "Blur",
"min": 0,
"max": 100,
"as": "$blur"
}
]
},
{
"vspace": "1em"
},
{
"plot": [
{
"mark": "raster",
"data": {
"from": "ca55"
},
"x": "LONGITUDE",
"y": "LATITUDE",
"fill": {
"max": "MAG_IGRF90"
},
"interpolate": "$interp",
"bandwidth": "$blur"
}
],
"colorScale": "diverging",
"colorDomain": "Fixed"
}
]
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: airline-travelers > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Airline…' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Airline Travelers",
"description": "A labeled line chart comparing airport travelers in 2019 and 2020.",
"credit": "Adapted from an [Observable Plot example](https://observablehq.com/@observablehq/plot-labeled-line-chart)."
},
"data": {
"travelers": {
"type": "parquet",
"file": "data/travelers.parquet"
},
"endpoint": {
"type": "table",
"query": "SELECT * FROM travelers ORDER BY date DESC LIMIT 1"
}
},
"plot": [
{
"mark": "ruleY",
"data": [
0
]
},
{
"mark": "lineY",
"data": {
"from": "travelers"
},
"x": "date",
"y": "previous",
"strokeOpacity": 0.35
},
{
"mark": "lineY",
"data": {
"from": "travelers"
},
"x": "date",
"y": "current"
},
{
"mark": "text",
"data": {
"from": "endpoint"
},
"x": "date",
"y": "previous",
"text": [
"2019"
],
"fillOpacity": 0.5,
"lineAnchor": "bottom",
"dy": -6
},
{
"mark": "text",
"data": {
"from": "endpoint"
},
"x": "date",
"y": "current",
"text": [
"2020"
],
"lineAnchor": "top",
"dy": 6
}
],
"yGrid": true,
"yLabel": "↑ Travelers per day",
"yTickFormat": "s"
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: athlete-birth-waffle > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Athlete…' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Athlete Birth Waffle",
"description": "Waffle chart counting Olympic athletes based on which half-decade they were born. The inputs enable adjustment of waffle mark design options.\n",
"credit": "Adapted from an [Observable Plot example](https://observablehq.com/@observablehq/plot-waffle-unit)."
},
"data": {
"athletes": {
"type": "parquet",
"file": "data/athletes.parquet"
}
},
"params": {
"unit": 10,
"round": false,
"gap": 1,
"radius": 0
},
"vconcat": [
{
"hconcat": [
{
"input": "menu",
"as": "$unit",
"options": [
1,
2,
5,
10,
25,
50,
100
],
"label": "Unit"
},
{
"input": "menu",
"as": "$round",
"options": [
true,
false
],
"label": "Round"
},
{
"input": "menu",
"as": "$gap",
"options": [
0,
1,
2,
3,
4,
5
],
"label": "Gap"
},
{
"input": "slider",
"as": "$radius",
"min": 0,
"max": 10,
"step": 0.1,
"label": "Radius"
}
]
},
{
"vspace": 10
},
{
"plot": [
{
"mark": "waffleY",
"data": {
"from": "athletes"
},
"unit": "$unit",
"round": "$round",
"gap": "$gap",
"rx": "$radius",
"x": {
"sql": "5 * floor(year(\"date_of_birth\") / 5)"
},
"y": {
"count": ""
}
}
],
"xLabel": null,
"xTickSize": 0,
"xTickFormat": "d"
}
]
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: athlete-height > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Athlete…' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Athlete Height Intervals",
"description": "Confidence intervals of Olympic athlete heights, in meters. Data are batched into groups of 10 samples per sport. Use the samples slider to see how the intervals update as the sample size increases (as in [online aggregation](https://en.wikipedia.org/wiki/Online_aggregation)). For each sport, the numbers on the right show the maximum number of athletes in the full dataset.\n"
},
"data": {
"athletesBatched": {
"type": "parquet",
"file": "data/athletes.parquet",
"select": [
"*",
"10 * CEIL(ROW_NUMBER() OVER (PARTITION BY sport) / 10) AS batch"
],
"where": "height IS NOT NULL"
}
},
"params": {
"ci": 0.95,
"query": {
"select": "single"
}
},
"hconcat": [
{
"vconcat": [
{
"hconcat": [
{
"input": "slider",
"select": "interval",
"as": "$query",
"column": "batch",
"from": "athletesBatched",
"step": 10,
"value": 20,
"label": "Max Samples"
},
{
"input": "slider",
"as": "$ci",
"min": 0.5,
"max": 0.999,
"step": 0.001,
"label": "Conf. Level"
}
]
},
{
"plot": [
{
"mark": "errorbarX",
"data": {
"from": "athletesBatched",
"filterBy": "$query"
},
"ci": "$ci",
"x": "height",
"y": "sport",
"stroke": "sex",
"strokeWidth": 1,
"marker": "tick",
"sort": {
"y": "-x"
}
},
{
"mark": "text",
"data": {
"from": "athletesBatched"
},
"frameAnchor": "right",
"fontSize": 8,
"fill": "#999",
"dx": 25,
"text": {
"count": ""
},
"y": "sport"
}
],
"name": "heights",
"xDomain": [
1.5,
2.1
],
"yDomain": "Fixed",
"yGrid": true,
"yLabel": null,
"marginTop": 5,
"marginLeft": 105,
"marginRight": 30,
"height": 420
},
{
"legend": "color",
"for": "heights"
}
]
}
]
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: athletes > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Olympic…' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Olympic Athletes",
"description": "An interactive dashboard of athlete statistics. The menus and searchbox filter the display and are automatically populated by backing data columns.\n"
},
"data": {
"athletes": {
"type": "parquet",
"file": "data/athletes.parquet"
}
},
"params": {
"category": {
"select": "intersect"
},
"query": {
"select": "intersect",
"include": [
"$category"
]
},
"hover": {
"select": "intersect",
"empty": true
}
},
"hconcat": [
{
"vconcat": [
{
"hconcat": [
{
"input": "menu",
"label": "Sport",
"as": "$category",
"from": "athletes",
"column": "sport"
},
{
"input": "menu",
"label": "Sex",
"as": "$category",
"from": "athletes",
"column": "sex"
},
{
"input": "search",
"label": "Name",
"filterBy": "$category",
"as": "$query",
"from": "athletes",
"column": "name",
"type": "contains"
}
]
},
{
"vspace": 10
},
{
"plot": [
{
"mark": "dot",
"data": {
"from": "athletes",
"filterBy": "$query"
},
"x": "weight",
"y": "height",
"fill": "sex",
"r": 2,
"opacity": 0.1
},
{
"mark": "regressionY",
"data": {
"from": "athletes",
"filterBy": "$query"
},
"x": "weight",
"y": "height",
"stroke": "sex"
},
{
"select": "intervalXY",
"as": "$query",
"brush": {
"fillOpacity": 0,
"stroke": "black"
}
},
{
"mark": "dot",
"data": {
"from": "athletes",
"filterBy": "$hover"
},
"x": "weight",
"y": "height",
"fill": "sex",
"stroke": "currentColor",
"strokeWidth": 1,
"r": 3
}
],
"xyDomain": "Fixed",
"colorDomain": "Fixed",
"margins": {
"left": 35,
"top": 20,
"right": 1
},
"width": 570,
"height": 350
},
{
"vspace": 5
},
{
"input": "table",
"from": "athletes",
"maxWidth": 570,
"height": 250,
"filterBy": "$query",
"as": "$hover",
"columns": [
"name",
"nationality",
"sex",
"height",
"weight",
"sport"
],
"width": {
"name": 180,
"nationality": 100,
"sex": 50,
"height": 50,
"weight": 50,
"sport": 100
}
}
]
}
]
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: axes > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Axes & …' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Axes & Gridlines",
"description": "Customized axis and gridline marks can be used in addition to standard scale attributes such as `xAxis`, `yGrid`, etc. Just add data!\n"
},
"plot": [
{
"mark": "gridY",
"strokeDasharray": "0.75 2",
"strokeOpacity": 1
},
{
"mark": "axisY",
"anchor": "left",
"tickSize": 0,
"dx": 38,
"dy": -4,
"lineAnchor": "bottom"
},
{
"mark": "axisY",
"anchor": "right",
"tickSize": 0,
"tickPadding": 5,
"label": "y-axis",
"labelAnchor": "center"
},
{
"mark": "axisX",
"label": "x-axis",
"labelAnchor": "center"
},
{
"mark": "gridX"
},
{
"mark": "ruleY",
"data": [
0
]
}
],
"xDomain": [
0,
100
],
"yDomain": [
0,
100
],
"xInsetLeft": 36,
"marginLeft": 0,
"marginRight": 35,
"width": 680
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: bias > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Bias Pa…' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Bias Parameter",
"description": "Dynamically adjust queried values by adding a Param value. The SQL expression is re-computed in the database upon updates.\n"
},
"data": {
"walk": {
"type": "parquet",
"file": "data/random-walk.parquet"
}
},
"params": {
"point": 0
},
"vconcat": [
{
"input": "slider",
"label": "Bias",
"as": "$point",
"min": 0,
"max": 1000,
"step": 1
},
{
"plot": [
{
"mark": "areaY",
"data": {
"from": "walk"
},
"x": "t",
"y": {
"sql": "v + $point"
},
"fill": "steelblue"
}
],
"width": 680,
"height": 200
}
]
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: contours > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Contour…' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Contour Plot",
"description": "Here `heatmap` and `contour` marks visualize the density of data points in a scatter plot of penguin measurments. Setting the `fill` color to `\"species\"` subdivides the data into three sets of densities.\n"
},
"data": {
"penguins": {
"type": "parquet",
"file": "data/penguins.parquet"
}
},
"params": {
"bandwidth": 40,
"thresholds": 10
},
"vconcat": [
{
"hconcat": [
{
"input": "slider",
"label": "Bandwidth (σ)",
"as": "$bandwidth",
"min": 1,
"max": 100
},
{
"input": "slider",
"label": "Thresholds",
"as": "$thresholds",
"min": 2,
"max": 20
}
]
},
{
"plot": [
{
"mark": "heatmap",
"data": {
"from": "penguins"
},
"x": "bill_length",
"y": "bill_depth",
"fill": "species",
"bandwidth": "$bandwidth"
},
{
"mark": "contour",
"data": {
"from": "penguins"
},
"x": "bill_length",
"y": "bill_depth",
"stroke": "species",
"bandwidth": "$bandwidth",
"thresholds": "$thresholds"
},
{
"mark": "dot",
"data": {
"from": "penguins"
},
"x": "bill_length",
"y": "bill_depth",
"fill": "currentColor",
"r": 1
}
],
"xAxis": "bottom",
"xLabelAnchor": "center",
"yAxis": "right",
"yLabelAnchor": "center",
"margins": {
"top": 5,
"bottom": 30,
"left": 5,
"right": 50
},
"width": 700,
"height": 480
}
]
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: crossfilter > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "data": {\n "flights": {\n …' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"data": {
"flights": {
"type": "parquet",
"file": "data/flights-200k.parquet"
}
},
"params": {
"brush": {
"select": "crossfilter"
}
},
"vconcat": [
{
"plot": [
{
"mark": "rectY",
"data": {
"from": "flights",
"filterBy": "$brush"
},
"x": {
"bin": "delay"
},
"y": {
"count": ""
},
"fill": "steelblue",
"insetLeft": 0.5,
"insetRight": 0.5
},
{
"select": "intervalX",
"as": "$brush"
}
],
"xDomain": "Fixed",
"xLabel": "Arrival Delay (min)",
"xLabelAnchor": "center",
"yTickFormat": "s",
"height": 200
},
{
"plot": [
{
"mark": "rectY",
"data": {
"from": "flights",
"filterBy": "$brush"
},
"x": {
"bin": "time"
},
"y": {
"count": ""
},
"fill": "steelblue",
"insetLeft": 0.5,
"insetRight": 0.5
},
{
"select": "intervalX",
"as": "$brush"
}
],
"xDomain": "Fixed",
"xLabel": "Departure Time (hour)",
"xLabelAnchor": "center",
"yTickFormat": "s",
"height": 200
}
]
}
❯ test/spec.test.js:35:20
|
test/spec.test.js > Test specification: density-groups > produces json output:
packages/spec/test/spec.test.js#L35
AssertionError: expected '{\n "meta": {\n "title": "Density…' to be '{\n "$schema": "https://idl.uw.edu/m…' // Object.is equality
- Expected
+ Received
{
- "$schema": "https://idl.uw.edu/mosaic/schema/v0.12.2.json",
"meta": {
"title": "Density Groups",
"description": "Density plots of penguin bill depths, grouped by species. The normalize parameter supports different forms of comparison, controlling if an individual density estimate is scaled by total point mass or normalized by the sum or max of the point mass. The stack and offset parameters control stacking of density areas.\n"
},
"data": {
"penguins": {
"type": "parquet",
"file": "data/penguins.parquet"
}
},
"params": {
"bandwidth": 20,
"normalize": "none",
"stack": false,
"offset": null
},
"vconcat": [
{
"hconcat": [
{
"input": "menu",
"label": "Normalize",
"as": "$normalize",
"options": [
"none",
"sum",
"max"
]
},
{
"input": "menu",
"label": "Stack",
"as": "$stack",
"options": [
false,
true
]
},
{
"input": "menu",
"label": "Offset",
"as": "$offset",
"options": [
{
"label": "none",
"value": null
},
{
"label": "normalize",
"value": "normalize"
},
{
"label": "center",
"value": "center"
}
]
}
]
},
{
"plot": [
{
"mark": "densityY",
"data": {
"from": "penguins"
},
"x": "bill_depth",
"fill": "species",
"fillOpacity": 0.4,
"bandwidth": "$bandwidth",
"normalize": "$normalize",
"stack": "$stack",
"offset": "$offset"
}
],
"marginLeft": 50,
"height": 200
}
]
}
❯ test/spec.test.js:35:20
|
Test in Python
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Test in Rust
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Test in Node
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|