Created
August 3, 2018 04:56
-
-
Save ijlyttle/b61d20e6f6476f9cdac1254937f7cb6c to your computer and use it in GitHub Desktop.
leap-year issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit | |
height: 500 | |
scrolling: yes | |
border: yes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- uploaded using vegawidget --> | |
<script src="https://cdn.jsdelivr.net/npm/vega@4.0.0-rc.2"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-lite@2.5.0"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-embed@3.14.0"></script> | |
<link rel="stylesheet" type="text/css" href="vega-embed.css"> | |
</head> | |
<body> | |
<div id="vis"></div> | |
<script type="text/javascript"> | |
const spec = "spec.json"; | |
const opt = {"defaultStyle":true,"renderer":"canvas"}; | |
vegaEmbed('#vis', spec, opt).then(function(result) { | |
// access view as result.view | |
}).catch(console.error); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v2.json", | |
"width": 300, | |
"data": { | |
"values": [ | |
{ | |
"date": "2012-02-27", | |
"value": 10 | |
}, | |
{ | |
"date": "2012-02-28", | |
"value": 10 | |
}, | |
{ | |
"date": "2012-02-29", | |
"value": 10 | |
}, | |
{ | |
"date": "2012-03-01", | |
"value": 10 | |
}, | |
{ | |
"date": "2012-03-02", | |
"value": 10 | |
}, | |
{ | |
"date": "2012-03-03", | |
"value": 10 | |
}, | |
{ | |
"date": "2013-02-27", | |
"value": 15 | |
}, | |
{ | |
"date": "2013-02-28", | |
"value": 15 | |
}, | |
{ | |
"date": "2013-03-01", | |
"value": 15 | |
}, | |
{ | |
"date": "2013-03-02", | |
"value": 15 | |
}, | |
{ | |
"date": "2013-03-03", | |
"value": 15 | |
} | |
] | |
}, | |
"mark": "point", | |
"encoding": { | |
"x": { | |
"field": "date", | |
"type": "temporal", | |
"timeUnit": "utcmonthdate" | |
}, | |
"y": { | |
"field": "value", | |
"type": "quantitative", | |
"aggregate": "sum" | |
}, | |
"color": { | |
"field": "date", | |
"type": "nominal", | |
"timeUnit": "utcyear" | |
}, | |
"tooltip": [ | |
{ | |
"field": "date", | |
"type": "nominal", | |
"timeUnit": "utcmonthdate", | |
"format": "%Y-%m-%d", | |
"title": "aggregated date" | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment