Skip to content

Commit

Permalink
remove ugly colors lint, minify vega examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Feb 9, 2024
1 parent 7f8b6a0 commit d62ef70
Show file tree
Hide file tree
Showing 15 changed files with 293 additions and 460 deletions.
55 changes: 17 additions & 38 deletions public/examples/area-chart.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 250,
"height": 200,
"data": {
"url": "data/penguins.json"
},
"mark": {
"type": "area",
"opacity": 0.5
},
"transform": [
{
"density": "Body Mass (g)",
"groupby": [
"Species"
],
"extent": [
2500,
6500
]
}
],
"encoding": {
"x": {
"field": "value",
"type": "quantitative",
"title": "Body Mass (g)"
},
"y": {
"field": "density",
"type": "quantitative",
"stack": null
},
"color": {
"field": "Species",
"type": "nominal"
}
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 250,
"height": 200,
"data": { "url": "data/penguins.json" },
"mark": { "type": "area", "opacity": 0.5 },
"transform": [
{
"density": "Body Mass (g)",
"groupby": ["Species"],
"extent": [2500, 6500]
}
}
],
"encoding": {
"x": { "field": "value", "type": "quantitative", "title": "Body Mass (g)" },
"y": { "field": "density", "type": "quantitative", "stack": null },
"color": { "field": "Species", "type": "nominal" }
}
}
93 changes: 24 additions & 69 deletions public/examples/grouped-bar-chart.json
Original file line number Diff line number Diff line change
@@ -1,70 +1,25 @@
{
"height": 150,
"width": 150,
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": [
{
"category": "A",
"group": "x",
"value": 0.1
},
{
"category": "A",
"group": "y",
"value": 0.6
},
{
"category": "A",
"group": "z",
"value": 0.9
},
{
"category": "B",
"group": "x",
"value": 0.7
},
{
"category": "B",
"group": "y",
"value": 0.2
},
{
"category": "B",
"group": "z",
"value": 1.1
},
{
"category": "C",
"group": "x",
"value": 0.6
},
{
"category": "C",
"group": "y",
"value": 0.1
},
{
"category": "C",
"group": "z",
"value": 0.2
}
]
},
"mark": "bar",
"encoding": {
"x": {
"field": "category"
},
"y": {
"field": "value",
"type": "quantitative"
},
"xOffset": {
"field": "group"
},
"color": {
"field": "group"
}
}
}
"height": 150,
"width": 150,
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": [
{ "category": "A", "group": "x", "value": 0.1 },
{ "category": "A", "group": "y", "value": 0.6 },
{ "category": "A", "group": "z", "value": 0.9 },
{ "category": "B", "group": "x", "value": 0.7 },
{ "category": "B", "group": "y", "value": 0.2 },
{ "category": "B", "group": "z", "value": 1.1 },
{ "category": "C", "group": "x", "value": 0.6 },
{ "category": "C", "group": "y", "value": 0.1 },
{ "category": "C", "group": "z", "value": 0.2 }
]
},
"mark": "bar",
"encoding": {
"x": { "field": "category" },
"y": { "field": "value", "type": "quantitative" },
"xOffset": { "field": "group" },
"color": { "field": "group" }
}
}
106 changes: 24 additions & 82 deletions public/examples/heatmap.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,25 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": [
{
"x": 0,
"y": 0,
"value": -10
},
{
"x": 1,
"y": 0,
"value": -5
},
{
"x": 2,
"y": 0,
"value": 0
},
{
"x": 3,
"y": 0,
"value": 5
},
{
"x": 0,
"y": 1,
"value": -5
},
{
"x": 1,
"y": 1,
"value": 0
},
{
"x": 2,
"y": 1,
"value": 5
},
{
"x": 3,
"y": 1,
"value": 10
},
{
"x": 0,
"y": 2,
"value": 0
},
{
"x": 1,
"y": 2,
"value": 5
},
{
"x": 2,
"y": 2,
"value": 10
},
{
"x": 3,
"y": 2,
"value": 15
}
]
},
"mark": "rect",
"encoding": {
"x": {
"field": "x",
"type": "ordinal"
},
"y": {
"field": "y",
"type": "ordinal"
},
"color": {
"field": "value",
"type": "ordinal",
"bin": true
}
}
}
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": [
{ "x": 0, "y": 0, "value": -10 },
{ "x": 1, "y": 0, "value": -5 },
{ "x": 2, "y": 0, "value": 0 },
{ "x": 3, "y": 0, "value": 5 },
{ "x": 0, "y": 1, "value": -5 },
{ "x": 1, "y": 1, "value": 0 },
{ "x": 2, "y": 1, "value": 5 },
{ "x": 3, "y": 1, "value": 10 },
{ "x": 0, "y": 2, "value": 0 },
{ "x": 1, "y": 2, "value": 5 },
{ "x": 2, "y": 2, "value": 10 },
{ "x": 3, "y": 2, "value": 15 }
]
},
"mark": "rect",
"encoding": {
"x": { "field": "x", "type": "ordinal" },
"y": { "field": "y", "type": "ordinal" },
"color": { "field": "value", "type": "ordinal", "bin": true }
}
}
Loading

0 comments on commit d62ef70

Please sign in to comment.