Skip to content

Instantly share code, notes, and snippets.

@Finterly
Created March 30, 2020 15:32
Show Gist options
  • Save Finterly/85c7c72bfe6464b1f84eaaeb00982450 to your computer and use it in GitHub Desktop.
Save Finterly/85c7c72bfe6464b1f84eaaeb00982450 to your computer and use it in GitHub Desktop.
Butterfly-vega-code
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 600,
"height": 400,
"padding": 20,
"data": [
{
"name": "source",
"url": "https://raw.githubusercontent.com/Finterly/Datasets_to_play_with/master/butterfly.json",
"transform": [
{
"type": "formula",
"expr": "'πŸ¦‹'",
"as": "wings"
}
]
},
{
"name": "pattern",
"values": [
{
"a": "-6",
"b": "5",
"wings": "πŸ¦‹"
},
{
"a": "6",
"b": "5",
"wings": "πŸ¦‹"
},
{
"a": "-8.5",
"b": "6.5",
"wings": "πŸ¦‹"
},
{
"a": "8.5",
"b": "6.5",
"wings": "πŸ¦‹"
},
{
"a": "-7",
"b": "6",
"wings": "πŸ¦‹"
},
{
"a": "7",
"b": "6",
"wings": "πŸ¦‹"
},
{
"a": "-7.5",
"b": "5",
"wings": "πŸ¦‹"
},
{
"a": "7.5",
"b": "5",
"wings": "πŸ¦‹"
},
{
"a": "-2",
"b": "0",
"wings": "πŸ¦‹"
},
{
"a": "2",
"b": "0",
"wings": "πŸ¦‹"
},
{
"a": "-3",
"b": "1",
"wings": "πŸ¦‹"
},
{
"a": "3",
"b": "1",
"wings": "πŸ¦‹"
},
{
"a": "-2.7",
"b": "0",
"wings": "πŸ¦‹"
},
{
"a": "2.7",
"b": "0",
"wings": "πŸ¦‹"
},
{
"a": "-6",
"b": "2",
"wings": "πŸ¦‹"
},
{
"a": "6",
"b": "2",
"wings": "πŸ¦‹"
},
{
"a": "-7",
"b": "2",
"wings": "πŸ¦‹"
},
{
"a": "7",
"b": "2",
"wings": "πŸ¦‹"
},
{
"a": "-7",
"b": "2.5",
"wings": "πŸ¦‹"
},
{
"a": "7",
"b": "2.5",
"wings": "πŸ¦‹"
},
{
"a": "-3",
"b": "-6",
"wings": "πŸ¦‹"
},
{
"a": "3",
"b": "-6",
"wings": "πŸ¦‹"
},
{
"a": "-2",
"b": "-4.2",
"wings": "πŸ¦‹"
},
{
"a": "2",
"b": "-4.2",
"wings": "πŸ¦‹"
},
{
"a": "-1",
"b": "-2.9",
"wings": "πŸ¦‹"
},
{
"a": "1",
"b": "-2.9",
"wings": "πŸ¦‹"
},
{
"a": "-7.5",
"b": "6",
"wings": "πŸ¦‹"
},
{
"a": "7.5",
"b": "6",
"wings": "πŸ¦‹"
}
],
"transform": [
{
"type": "formula",
"expr": "'πŸ¦‹'",
"as": "wings"
}
]
}
],
"scales": [
{
"name": "xScale",
"type": "linear",
"domain": {
"data": "source",
"field": "x"
},
"range": "width"
},
{
"name": "yScale",
"type": "linear",
"domain": {
"data": "source",
"field": "y"
},
"range": "height"
}
],
"axes": [
{
"scale": "xScale",
"orient": "bottom",
"tickCount": 10,
"title": "x",
"grid": true
},
{
"scale": "yScale",
"orient": "left",
"tickCount": 10,
"title": "y",
"grid": true
}
],
"marks": [
{
"type": "text",
"from": {
"data": "source"
},
"encode": {
"enter": {
"x": {
"scale": "xScale",
"field": "x"
},
"y": {
"scale": "yScale",
"field": "y"
},
"text": {
"field": "wings"
}
}
}
},
{
"type": "text",
"from": {
"data": "pattern"
},
"encode": {
"enter": {
"x": {
"scale": "xScale",
"field": "a"
},
"y": {
"scale": "yScale",
"field": "b"
},
"text": {
"field": "wings"
},
"fontSize": {
"value": 30
}
}
}
}
],
"config": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment