2022-02-27 04:41:30 +00:00
|
|
|
{
|
|
|
|
"$schema": "https://vega.github.io/schema/vega/v5.json",
|
2022-04-07 00:46:22 +00:00
|
|
|
"description": "A basic area chart example",
|
2022-02-27 04:41:30 +00:00
|
|
|
"width": 500,
|
2022-04-07 00:46:22 +00:00
|
|
|
"height": 100,
|
2022-02-27 04:41:30 +00:00
|
|
|
"padding": 5,
|
2022-04-06 21:51:24 +00:00
|
|
|
"data": [
|
|
|
|
{
|
|
|
|
"name": "con"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "dis"
|
|
|
|
}
|
|
|
|
],
|
2022-02-27 04:41:30 +00:00
|
|
|
"signals": [
|
|
|
|
{
|
|
|
|
"name": "xscale",
|
|
|
|
"description": "The transform of the x scale",
|
2022-04-06 01:18:18 +00:00
|
|
|
"value": false,
|
2022-02-27 04:41:30 +00:00
|
|
|
"bind": {
|
2022-04-06 01:18:18 +00:00
|
|
|
"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",
|
2022-04-06 01:18:18 +00:00
|
|
|
"value": false,
|
2022-02-27 04:41:30 +00:00
|
|
|
"bind": {
|
2022-04-06 01:18:18 +00:00
|
|
|
"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",
|
2022-04-06 21:51:24 +00:00
|
|
|
"exponent": {
|
|
|
|
"signal": "xscale ? 0.1 : 1"
|
|
|
|
},
|
2022-03-23 00:38:01 +00:00
|
|
|
"range": "width",
|
|
|
|
"zero": false,
|
|
|
|
"nice": false,
|
|
|
|
"domain": {
|
|
|
|
"fields": [
|
2022-04-06 21:51:24 +00:00
|
|
|
{
|
|
|
|
"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",
|
2022-04-06 21:51:24 +00:00
|
|
|
"exponent": {
|
|
|
|
"signal": "yscale ? 0.1 : 1"
|
|
|
|
},
|
2022-03-23 00:38:01 +00:00
|
|
|
"range": "height",
|
|
|
|
"nice": true,
|
|
|
|
"zero": true,
|
|
|
|
"domain": {
|
|
|
|
"fields": [
|
2022-04-06 21:51:24 +00:00
|
|
|
{
|
|
|
|
"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
|
|
|
}
|
|
|
|
],
|
2022-04-06 21:51:24 +00:00
|
|
|
"axes": [
|
|
|
|
{
|
|
|
|
"orient": "bottom",
|
|
|
|
"scale": "xscale",
|
2022-04-07 00:46:22 +00:00
|
|
|
"labelColor": "#666",
|
|
|
|
"tickColor": "#ddd",
|
|
|
|
"format": "~s",
|
2022-04-06 21:51:24 +00:00
|
|
|
"tickCount": 20
|
|
|
|
}
|
|
|
|
],
|
2022-02-27 04:41:30 +00:00
|
|
|
"marks": [
|
|
|
|
{
|
|
|
|
"type": "area",
|
2022-04-06 21:51:24 +00:00
|
|
|
"from": {
|
|
|
|
"data": "con"
|
|
|
|
},
|
2022-02-27 04:41:30 +00:00
|
|
|
"encode": {
|
|
|
|
"update": {
|
2022-04-06 21:51:24 +00:00
|
|
|
"x": {
|
|
|
|
"scale": "xscale",
|
|
|
|
"field": "x"
|
|
|
|
},
|
|
|
|
"y": {
|
|
|
|
"scale": "yscale",
|
|
|
|
"field": "y"
|
|
|
|
},
|
|
|
|
"y2": {
|
|
|
|
"scale": "yscale",
|
|
|
|
"value": 0
|
|
|
|
},
|
2022-02-27 04:41:30 +00:00
|
|
|
"fill": {
|
2022-04-07 00:46:22 +00:00
|
|
|
"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
|
|
|
},
|
2022-04-06 21:51:24 +00:00
|
|
|
"interpolate": {
|
|
|
|
"value": "monotone"
|
|
|
|
},
|
|
|
|
"fillOpacity": {
|
|
|
|
"value": 1
|
|
|
|
}
|
2022-02-27 04:41:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "rect",
|
2022-04-06 21:51:24 +00:00
|
|
|
"from": {
|
|
|
|
"data": "dis"
|
|
|
|
},
|
2022-02-27 04:41:30 +00:00
|
|
|
"encode": {
|
|
|
|
"enter": {
|
2022-04-06 21:51:24 +00:00
|
|
|
"y2": {
|
|
|
|
"scale": "yscale",
|
|
|
|
"value": 0
|
|
|
|
},
|
|
|
|
"width": {
|
|
|
|
"value": 1
|
|
|
|
}
|
2022-02-27 04:41:30 +00:00
|
|
|
},
|
|
|
|
"update": {
|
2022-04-06 21:51:24 +00:00
|
|
|
"x": {
|
|
|
|
"scale": "xscale",
|
|
|
|
"field": "x"
|
|
|
|
},
|
|
|
|
"y": {
|
|
|
|
"scale": "yscale",
|
|
|
|
"field": "y"
|
|
|
|
}
|
2022-02-27 04:41:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "symbol",
|
2022-04-06 21:51:24 +00:00
|
|
|
"from": {
|
|
|
|
"data": "dis"
|
|
|
|
},
|
2022-02-27 04:41:30 +00:00
|
|
|
"encode": {
|
|
|
|
"enter": {
|
2022-04-06 21:51:24 +00:00
|
|
|
"shape": {
|
|
|
|
"value": "circle"
|
|
|
|
},
|
|
|
|
"width": {
|
|
|
|
"value": 5
|
|
|
|
},
|
|
|
|
"tooltip": {
|
|
|
|
"signal": "datum.y"
|
|
|
|
}
|
2022-02-27 04:41:30 +00:00
|
|
|
},
|
|
|
|
"update": {
|
2022-04-06 21:51:24 +00:00
|
|
|
"x": {
|
|
|
|
"scale": "xscale",
|
|
|
|
"field": "x"
|
|
|
|
},
|
|
|
|
"y": {
|
|
|
|
"scale": "yscale",
|
|
|
|
"field": "y"
|
2022-04-07 00:46:22 +00:00
|
|
|
},
|
|
|
|
"fill": {
|
|
|
|
"value": "#1e4577"
|
2022-04-06 21:51:24 +00:00
|
|
|
}
|
2022-02-27 04:41:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2022-04-07 11:28:33 +00:00
|
|
|
}
|