squiggle/packages/components/src/vega-specs/spec-distributions.json

185 lines
3.4 KiB
JSON
Raw Normal View History

2022-02-27 04:41:30 +00:00
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "A basic area chart example",
2022-02-27 04:41:30 +00:00
"width": 500,
"height": 100,
2022-02-27 04:41:30 +00:00
"padding": 5,
"data": [
{
"name": "con"
},
{
"name": "dis"
}
],
2022-02-27 04:41:30 +00:00
"signals": [
{
"name": "xscale",
"description": "The transform of the x scale",
"value": false,
2022-02-27 04:41:30 +00:00
"bind": {
"input": "checkbox",
"name": "log x scale"
2022-03-23 00:38:01 +00:00
}
2022-02-27 04:41:30 +00:00
},
{
"name": "yscale",
"description": "The transform of the y scale",
"value": false,
2022-02-27 04:41:30 +00:00
"bind": {
"input": "checkbox",
"name": "log y scale"
2022-03-23 00:38:01 +00:00
}
2022-02-27 04:41:30 +00:00
}
],
2022-03-23 00:38:01 +00:00
"scales": [
{
"name": "xscale",
"type": "pow",
"exponent": {
"signal": "xscale ? 0.1 : 1"
},
2022-03-23 00:38:01 +00:00
"range": "width",
"zero": false,
"nice": false,
"domain": {
"fields": [
{
"data": "con",
"field": "x"
},
{
"data": "dis",
"field": "x"
}
2022-02-27 04:41:30 +00:00
]
}
2022-03-23 00:38:01 +00:00
},
{
"name": "yscale",
"type": "pow",
"exponent": {
"signal": "yscale ? 0.1 : 1"
},
2022-03-23 00:38:01 +00:00
"range": "height",
"nice": true,
"zero": true,
"domain": {
"fields": [
{
"data": "con",
"field": "y"
},
{
"data": "dis",
"field": "y"
}
2022-02-27 04:41:30 +00:00
]
2022-03-23 00:38:01 +00:00
}
2022-02-27 04:41:30 +00:00
}
],
"axes": [
{
"orient": "bottom",
"scale": "xscale",
2022-04-07 11:56:17 +00:00
"labelColor": "#727d93",
"tickColor": "#fff",
"tickOpacity": 0.0,
"domainColor": "#fff",
"domainOpacity": 0.0,
"format": "~s",
2022-04-07 11:56:17 +00:00
"tickCount": 10
}
],
2022-02-27 04:41:30 +00:00
"marks": [
{
"type": "area",
"from": {
"data": "con"
},
2022-02-27 04:41:30 +00:00
"encode": {
"update": {
"x": {
"scale": "xscale",
"field": "x"
},
"y": {
"scale": "yscale",
"field": "y"
},
"y2": {
"scale": "yscale",
"value": 0
},
2022-02-27 04:41:30 +00:00
"fill": {
"signal": "{gradient: 'linear', x1: 1, y1: 1, x2: 0, y2: 1, stops: [ {offset: 0.0, color: '#4C78A8'}] }"
2022-03-23 00:38:01 +00:00
},
"interpolate": {
"value": "monotone"
},
"fillOpacity": {
"value": 1
}
2022-02-27 04:41:30 +00:00
}
}
},
{
"type": "rect",
"from": {
"data": "dis"
},
2022-02-27 04:41:30 +00:00
"encode": {
"enter": {
"y2": {
"scale": "yscale",
"value": 0
},
"width": {
"value": 1
}
2022-02-27 04:41:30 +00:00
},
"update": {
"x": {
"scale": "xscale",
"field": "x"
},
"y": {
"scale": "yscale",
"field": "y"
}
2022-02-27 04:41:30 +00:00
}
}
},
{
"type": "symbol",
"from": {
"data": "dis"
},
2022-02-27 04:41:30 +00:00
"encode": {
"enter": {
"shape": {
"value": "circle"
},
"size": [{ "value": 30 }],
"tooltip": {
"signal": "datum.y"
}
2022-02-27 04:41:30 +00:00
},
"update": {
"x": {
"scale": "xscale",
"field": "x"
},
"y": {
"scale": "yscale",
"field": "y"
},
"fill": {
"value": "#1e4577"
}
2022-02-27 04:41:30 +00:00
}
}
}
]
2022-04-07 11:28:33 +00:00
}