Skip to content

Commit

Permalink
add back data folder and fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaLingWeng committed Dec 7, 2023
1 parent 530a8e6 commit d486197
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 28 deletions.
67 changes: 53 additions & 14 deletions examples/compiled/text_tooltip_image.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,34 @@
"padding": 5,
"width": 20,
"style": "cell",
"encode": {"update": {"stroke": {"value": null}}},
"encode": {
"update": {
"stroke": {
"value": null
}
}
},
"data": [
{
"name": "source_0",
"values": [
{"image": "../data/ffox.png"},
{"image": "../data/gimp.png"},
{"image": "../data/7zip.png"}
{
"image": "data/ffox.png"
},
{
"image": "data/gimp.png"
},
{
"image": "data/7zip.png"
}
]
}
],
"signals": [
{"name": "y_step", "value": 20},
{
"name": "y_step",
"value": 20
},
{
"name": "height",
"update": "bandspace(domain('y').length, 1, 0.5) * y_step"
Expand All @@ -27,24 +42,40 @@
{
"name": "marks",
"type": "text",
"style": ["text"],
"from": {"data": "source_0"},
"style": [
"text"
],
"from": {
"data": "source_0"
},
"encode": {
"update": {
"fill": {"value": "black"},
"fill": {
"value": "black"
},
"tooltip": {
"signal": "{\"image\": isValid(datum[\"image\"]) ? datum[\"image\"] : \"\"+datum[\"image\"]}"
},
"description": {
"signal": "\"image: \" + (isValid(datum[\"image\"]) ? datum[\"image\"] : \"\"+datum[\"image\"])"
},
"x": {"signal": "width", "mult": 0.5},
"y": {"scale": "y", "field": "image"},
"x": {
"signal": "width",
"mult": 0.5
},
"y": {
"scale": "y",
"field": "image"
},
"text": {
"signal": "isValid(datum[\"image\"]) ? datum[\"image\"] : \"\"+datum[\"image\"]"
},
"align": {"value": "center"},
"baseline": {"value": "middle"}
"align": {
"value": "center"
},
"baseline": {
"value": "middle"
}
}
}
}
Expand All @@ -53,8 +84,16 @@
{
"name": "y",
"type": "point",
"domain": {"data": "source_0", "field": "image", "sort": true},
"range": {"step": {"signal": "y_step"}},
"domain": {
"data": "source_0",
"field": "image",
"sort": true
},
"range": {
"step": {
"signal": "y_step"
}
},
"padding": 0.5
}
]
Expand Down
19 changes: 5 additions & 14 deletions examples/specs/text_tooltip_image.vl.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,17 @@
"image": "data/ffox.png"
},
{
"image": "../data/gimp.png"
"image": "data/gimp.png"
},
{
"image": "../data/7zip.png"
"image": "data/7zip.png"
}
]
},
"mark": "text",
"encoding": {
"text": {
"field": "image"
},
"y": {
"field": "image",
"axis": null
},
"tooltip": [
{
"field": "image"
}
]
"text": {"field": "image"},
"y": {"field": "image", "axis": null},
"tooltip": [{"field": "image"}]
}
}
1 change: 1 addition & 0 deletions site/docs/data

0 comments on commit d486197

Please sign in to comment.