Skip to content

Instantly share code, notes, and snippets.

@ebolyen
Created February 10, 2022 02:53
Show Gist options
  • Save ebolyen/196ecc3819726eecb101494d8d6141b7 to your computer and use it in GitHub Desktop.
Save ebolyen/196ecc3819726eecb101494d8d6141b7 to your computer and use it in GitHub Desktop.
Vega spec from Wed Feb 09 2022
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"title": {"text": {"signal": "'Distribution of the ' + lower(x_axis) + ' of penguins by ' + lower(y_axis)"}, "anchor": "start"},
"width": {"signal": "child_width"},
"height": {"signal": "child_height"},
"data": [
{"name": "grid_store"},
{
"name": "source_0",
"url": "data/penguins.json",
"format": {"type": "json"},
"transform": [
{
"type": "fold",
"fields": ["Species", "Sex", "Island"],
"as": ["yKey", "yValue"]
},
{
"type": "fold",
"fields": [
"Beak Length (mm)",
"Beak Depth (mm)",
"Flipper Length (mm)",
"Body Mass (g)"
],
"as": ["xKey", "xValue"]
},
{
"type": "filter",
"expr": "datum.yKey == y_axis && datum.xKey == x_axis && datum.yValue != null && datum.yValue != '.' && datum.xValue != null"
}
]
},
{
"name": "row_domain",
"source": "source_0",
"transform": [{"type": "aggregate", "groupby": ["yValue"]}]
},
{
"name": "data_1",
"source": "source_0",
"transform": [
{
"type": "kde",
"field": "xValue",
"groupby": ["yValue"],
"as": ["value", "density"]
}
]
},
{
"name": "data_2",
"source": "source_0",
"transform": [
{
"type": "joinaggregate",
"as": ["clone"],
"ops": ["values"],
"fields": ["xValue"],
"groupby": ["yValue"]
},
{
"type": "kde",
"field": "xValue",
"groupby": ["clone", "Species"],
"as": ["value", "density"]
},
{
"type": "joinaggregate",
"as": ["max_density"],
"ops": ["max"],
"fields": ["density"],
"groupby": ["yValue"]
},
{"type": "sample", "size": {"signal": "show_rain"}},
{"type": "flatten", "fields": ["clone"], "as": ["clone"]},
{
"type": "formula",
"expr": "datum[\"clone\"] && datum[\"clone\"][\"xValue\"]",
"as": "clone.xValue"
},
{
"type": "formula",
"expr": "datum[\"clone\"] && datum[\"clone\"][\"Species\"]",
"as": "clone.Species"
},
{
"type": "formula",
"expr": "datum[\"clone\"] && datum[\"clone\"][\"Island\"]",
"as": "clone.Island"
},
{
"type": "formula",
"expr": "datum[\"clone\"] && datum[\"clone\"][\"Body Mass (g)\"]",
"as": "clone.Body Mass (g)"
},
{
"type": "formula",
"expr": "random() * datum.max_density * 0.7 - datum.max_density * 0.7",
"as": "jitter"
},
{"type": "formula", "expr": "datum.clone.yValue", "as": "yValue"},
{
"type": "filter",
"expr": "isValid(datum[\"clone.xValue\"]) && isFinite(+datum[\"clone.xValue\"]) && isValid(datum[\"jitter\"]) && isFinite(+datum[\"jitter\"])"
}
]
},
{
"name": "data_3",
"source": "source_0",
"transform": [
{
"type": "joinaggregate",
"as": ["lower_box_xValue", "upper_box_xValue"],
"ops": ["q1", "q3"],
"fields": ["xValue", "xValue"],
"groupby": ["yValue"]
},
{
"type": "filter",
"expr": "(datum[\"lower_box_xValue\"] - 1.5 * (datum[\"upper_box_xValue\"] - datum[\"lower_box_xValue\"]) <= datum[\"xValue\"]) && (datum[\"xValue\"] <= datum[\"upper_box_xValue\"] + 1.5 * (datum[\"upper_box_xValue\"] - datum[\"lower_box_xValue\"]))"
},
{
"type": "aggregate",
"groupby": ["yValue"],
"ops": ["min", "max", "min", "max"],
"fields": [
"xValue",
"xValue",
"lower_box_xValue",
"upper_box_xValue"
],
"as": [
"lower_whisker_xValue",
"upper_whisker_xValue",
"lower_box_xValue",
"upper_box_xValue"
]
}
]
},
{
"name": "data_4",
"source": "source_0",
"transform": [
{
"type": "aggregate",
"groupby": ["yValue"],
"ops": ["q1", "q3", "median", "min", "max"],
"fields": ["xValue", "xValue", "xValue", "xValue", "xValue"],
"as": [
"lower_box_xValue",
"upper_box_xValue",
"mid_box_xValue",
"min_xValue",
"max_xValue"
]
}
]
}
],
"signals": [
{"name": "child_width", "value": 600, "bind": {"input": "range", "min": 100, "max": 1024}},
{"name": "child_height", "value": 80, "bind": {"input": "range", "min": 40, "max": 256}},
{
"name": "unit",
"value": {},
"on": [
{"events": "mousemove", "update": "isTuple(group()) ? group() : unit"}
]
},
{"name": "grid", "update": "{\"value\": grid_value}"},
{"name": "grid_value"},
{
"name": "y_axis",
"value": "Species",
"bind": {"input": "select", "options": ["Species", "Sex", "Island"]}
},
{
"name": "x_axis",
"value": "Body Mass (g)",
"bind": {
"input": "select",
"options": [
"Beak Length (mm)",
"Beak Depth (mm)",
"Flipper Length (mm)",
"Body Mass (g)"
]
}
},
{"name": "show_rain", "value": true, "bind": {"input": "checkbox"}},
{"name": "include_zero", "value": true, "bind": {"input": "checkbox"}}
],
"layout": {
"padding": 0,
"columns": 1,
"bounds": "flush",
"align": "none"
},
"marks": [
{
"name": "row-title",
"type": "group",
"role": "row-title",
"title": {
"text": {"signal": "y_axis"},
"orient": "left",
"style": "guide-title",
"offset": 10
}
},
{
"name": "row_header",
"type": "group",
"role": "row-header",
"from": {"data": "row_domain"},
"sort": {"field": "datum[\"yValue\"]", "order": "ascending"},
"title": {
"text": {
"signal": "isValid(parent[\"yValue\"]) ? parent[\"yValue\"] : \"\"+parent[\"yValue\"]"
},
"orient": "left",
"style": "guide-label",
"frame": "group",
"baseline": "middle",
"align": "left",
"angle": 0,
"offset": 10
},
"encode": {"update": {"height": {"signal": "child_height"}}}
},
{
"name": "column_footer",
"type": "group",
"role": "column-footer",
"encode": {"update": {"width": {"signal": "child_width"}}},
"axes": [
{
"scale": "x",
"orient": "bottom",
"grid": false,
"title": {"signal": "x_axis"},
"labelFlush": true,
"labelOverlap": true,
"tickCount": {"signal": "ceil(child_width/40)"},
"zindex": 0
}
]
},
{
"name": "cell",
"type": "group",
"style": "cell",
"from": {
"facet": {"name": "facet", "data": "source_0", "groupby": ["yValue"]}
},
"sort": {"field": ["datum[\"yValue\"]"], "order": ["ascending"]},
"data": [
{
"source": "facet",
"name": "data_0",
"transform": [
{
"type": "kde",
"field": "xValue",
"groupby": ["yValue"],
"as": ["value", "density"]
}
]
},
{
"source": "facet",
"name": "data_1",
"transform": [
{
"type": "joinaggregate",
"as": ["clone"],
"ops": ["values"],
"fields": ["xValue"],
"groupby": []
},
{
"type": "kde",
"field": "xValue",
"groupby": ["clone", "Species"],
"as": ["value", "density"]
},
{
"type": "joinaggregate",
"as": ["max_density"],
"ops": ["max"],
"fields": ["density"],
"groupby": []
},
{"type": "sample", "size": {"signal": "show_rain"}},
{"type": "flatten", "fields": ["clone"], "as": ["clone"]},
{
"type": "formula",
"expr": "datum[\"clone\"] && datum[\"clone\"][\"xValue\"]",
"as": "clone.xValue"
},
{
"type": "formula",
"expr": "datum[\"clone\"] && datum[\"clone\"][\"Species\"]",
"as": "clone.Species"
},
{
"type": "formula",
"expr": "datum[\"clone\"] && datum[\"clone\"][\"Island\"]",
"as": "clone.Island"
},
{
"type": "formula",
"expr": "datum[\"clone\"] && datum[\"clone\"][\"Body Mass (g)\"]",
"as": "clone.Body Mass (g)"
},
{
"type": "formula",
"expr": "random() * datum.max_density * 0.7 - datum.max_density * 0.7",
"as": "jitter"
},
{"type": "formula", "expr": "datum.clone.yValue", "as": "yValue"},
{
"type": "filter",
"expr": "isValid(datum[\"clone.xValue\"]) && isFinite(+datum[\"clone.xValue\"]) && isValid(datum[\"jitter\"]) && isFinite(+datum[\"jitter\"])"
}
]
},
{
"source": "facet",
"name": "data_2",
"transform": [
{
"type": "joinaggregate",
"as": ["lower_box_xValue", "upper_box_xValue"],
"ops": ["q1", "q3"],
"fields": ["xValue", "xValue"],
"groupby": []
},
{
"type": "filter",
"expr": "(datum[\"lower_box_xValue\"] - 1.5 * (datum[\"upper_box_xValue\"] - datum[\"lower_box_xValue\"]) <= datum[\"xValue\"]) && (datum[\"xValue\"] <= datum[\"upper_box_xValue\"] + 1.5 * (datum[\"upper_box_xValue\"] - datum[\"lower_box_xValue\"]))"
},
{
"type": "aggregate",
"groupby": [],
"ops": ["min", "max", "min", "max"],
"fields": [
"xValue",
"xValue",
"lower_box_xValue",
"upper_box_xValue"
],
"as": [
"lower_whisker_xValue",
"upper_whisker_xValue",
"lower_box_xValue",
"upper_box_xValue"
]
}
]
},
{
"source": "facet",
"name": "data_3",
"transform": [
{
"type": "aggregate",
"groupby": [],
"ops": ["q1", "q3", "median", "min", "max", "min"],
"fields": ["xValue", "xValue", "xValue", "xValue", "xValue", "yValue"],
"as": [
"lower_box_xValue",
"upper_box_xValue",
"mid_box_xValue",
"min_xValue",
"max_xValue",
"yValue"
]
}
]
}
],
"encode": {
"update": {
"width": {"signal": "child_width"},
"height": {"signal": "child_height"}
}
},
"signals": [
{
"name": "facet",
"value": {},
"on": [
{
"events": [{"source": "scope", "type": "mousemove"}],
"update": "isTuple(facet) ? facet : group(\"cell\").datum"
}
]
},
{
"name": "grid_value",
"on": [
{
"events": [{"source": "view", "type": "dblclick"}],
"update": "null"
},
{
"events": {"signal": "grid_translate_delta"},
"update": "panLinear(grid_translate_anchor.extent_x, -grid_translate_delta.x / child_width)"
},
{
"events": {"signal": "grid_zoom_delta"},
"update": "zoomLinear(domain(\"x\"), grid_zoom_anchor.x, grid_zoom_delta)"
}
],
"push": "outer"
},
{
"name": "grid_tuple",
"on": [
{
"events": [{"signal": "grid_value"}],
"update": "grid_value ? {unit: \"child_layer_0\" + '__facet_row_' + (facet[\"yValue\"]), fields: grid_tuple_fields, values: [grid_value]} : null"
}
]
},
{
"name": "grid_tuple_fields",
"value": [{"field": "value", "channel": "x", "type": "R"}]
},
{
"name": "grid_translate_anchor",
"value": {},
"on": [
{
"events": [{"source": "scope", "type": "mousedown"}],
"update": "{x: x(unit), y: y(unit), extent_x: domain(\"x\")}"
}
]
},
{
"name": "grid_translate_delta",
"value": {},
"on": [
{
"events": [
{
"source": "window",
"type": "mousemove",
"consume": true,
"between": [
{"source": "scope", "type": "mousedown"},
{"source": "window", "type": "mouseup"}
]
}
],
"update": "{x: grid_translate_anchor.x - x(unit), y: grid_translate_anchor.y - y(unit)}"
}
]
},
{
"name": "grid_zoom_anchor",
"on": [
{
"events": [{"source": "scope", "type": "wheel", "consume": true}],
"update": "{x: invert(\"x\", x(unit)), y: invert(\"child_y\", y(unit))}"
}
]
},
{
"name": "grid_zoom_delta",
"on": [
{
"events": [{"source": "scope", "type": "wheel", "consume": true}],
"force": true,
"update": "pow(1.001, event.deltaY * pow(16, event.deltaMode))"
}
]
},
{
"name": "grid_modify",
"on": [
{
"events": {"signal": "grid_tuple"},
"update": "modify(\"grid_store\", grid_tuple, true)"
}
]
}
],
"marks": [
{
"name": "child_layer_0_pathgroup",
"type": "group",
"from": {
"facet": {
"name": "faceted_path_child_layer_0_main",
"data": "data_0",
"groupby": ["yValue"]
}
},
"encode": {
"update": {
"width": {"field": {"group": "width"}},
"height": {"field": {"group": "height"}}
}
},
"marks": [
{
"name": "child_layer_0_marks",
"type": "area",
"clip": true,
"style": ["area"],
"sort": {"field": "datum[\"value\"]"},
"interactive": true,
"from": {"data": "faceted_path_child_layer_0_main"},
"encode": {
"update": {
"orient": {"value": "vertical"},
"fill": {"scale": "color", "field": "yValue"},
"stroke": {"scale": "color", "field": "yValue"},
"description": {
"signal": "\"value: \" + (format(datum[\"value\"], \"\")) + \"; density: \" + (format(datum[\"density\"], \"\")) + \"; [object Object]: \" + (isValid(datum[\"yValue\"]) ? datum[\"yValue\"] : \"\"+datum[\"yValue\"])"
},
"x": {"scale": "x", "field": "value"},
"y": {"scale": "child_y", "field": "density"},
"y2": {"scale": "child_y", "value": 0},
"defined": {
"signal": "isValid(datum[\"value\"]) && isFinite(+datum[\"value\"]) && isValid(datum[\"density\"]) && isFinite(+datum[\"density\"])"
}
}
}
}
]
},
{
"name": "child_layer_1_marks",
"type": "symbol",
"clip": true,
"style": ["circle"],
"interactive": true,
"from": {"data": "data_1"},
"encode": {
"update": {
"opacity": {"value": 0.7},
"tooltip": {
"signal": "{\"Species\": isValid(datum[\"clone.Species\"]) ? datum[\"clone.Species\"] : \"\"+datum[\"clone.Species\"], \"Island\": isValid(datum[\"clone.Island\"]) ? datum[\"clone.Island\"] : \"\"+datum[\"clone.Island\"], \"Body Mass (g)\": format(datum[\"clone.Body Mass (g)\"], \"\")}"
},
"fill": {"scale": "fill", "field": "yValue"},
"ariaRoleDescription": {"value": "circle"},
"description": {
"signal": "\"clone.xValue: \" + (format(datum[\"clone.xValue\"], \"\")) + \"; jitter: \" + (format(datum[\"jitter\"], \"\")) + \"; yValue: \" + (isValid(datum[\"yValue\"]) ? datum[\"yValue\"] : \"\"+datum[\"yValue\"]) + \"; Species: \" + (isValid(datum[\"clone.Species\"]) ? datum[\"clone.Species\"] : \"\"+datum[\"clone.Species\"]) + \"; Island: \" + (isValid(datum[\"clone.Island\"]) ? datum[\"clone.Island\"] : \"\"+datum[\"clone.Island\"]) + \"; Body Mass (g): \" + (format(datum[\"clone.Body Mass (g)\"], \"\"))"
},
"x": {"scale": "x", "field": "clone\\.xValue"},
"y": {
"scale": "child_y",
"field": "jitter",
"offset": {"value": 11}
},
"shape": {"value": "circle"}
}
}
},
{
"name": "child_layer_2_layer_0_layer_0_marks",
"type": "rule",
"clip": true,
"style": ["rule", "boxplot-rule"],
"interactive": true,
"aria": false,
"from": {"data": "data_2"},
"encode": {
"update": {
"opacity": {"value": 1},
"stroke": {"value": "black"},
"strokeWidth": {"value": 2},
"tooltip": {
"signal": "{\"Upper Whisker of xValue\": format(datum[\"upper_whisker_xValue\"], \"\"), \"Lower Whisker of xValue\": format(datum[\"lower_whisker_xValue\"], \"\")}"
},
"x": [
{
"test": "!isValid(datum[\"lower_whisker_xValue\"]) || !isFinite(+datum[\"lower_whisker_xValue\"])",
"value": 0
},
{"scale": "x", "field": "lower_whisker_xValue"}
],
"x2": [
{
"test": "!isValid(datum[\"lower_box_xValue\"]) || !isFinite(+datum[\"lower_box_xValue\"])",
"value": 0
},
{"scale": "x", "field": "lower_box_xValue"}
],
"y": {"scale": "child_y", "value": 0}
}
}
},
{
"name": "child_layer_2_layer_0_layer_1_marks",
"type": "rule",
"clip": true,
"style": ["rule", "boxplot-rule"],
"interactive": true,
"aria": false,
"from": {"data": "data_2"},
"encode": {
"update": {
"opacity": {"value": 1},
"stroke": {"value": "black"},
"strokeWidth": {"value": 2},
"tooltip": {
"signal": "{\"Upper Whisker of xValue\": format(datum[\"upper_whisker_xValue\"], \"\"), \"Lower Whisker of xValue\": format(datum[\"lower_whisker_xValue\"], \"\")}"
},
"x": [
{
"test": "!isValid(datum[\"upper_box_xValue\"]) || !isFinite(+datum[\"upper_box_xValue\"])",
"value": 0
},
{"scale": "x", "field": "upper_box_xValue"}
],
"x2": [
{
"test": "!isValid(datum[\"upper_whisker_xValue\"]) || !isFinite(+datum[\"upper_whisker_xValue\"])",
"value": 0
},
{"scale": "x", "field": "upper_whisker_xValue"}
],
"y": {"scale": "child_y", "value": 0}
}
}
},
{
"name": "child_layer_2_layer_0_layer_2_marks",
"type": "rect",
"clip": true,
"style": ["tick", "boxplot-ticks"],
"interactive": true,
"aria": false,
"from": {"data": "data_2"},
"encode": {
"update": {
"opacity": {"value": 1},
"stroke": {"value": "black"},
"strokeWidth": {"value": 1},
"fill": {"value": "black"},
"tooltip": {
"signal": "{\"Upper Whisker of xValue\": format(datum[\"upper_whisker_xValue\"], \"\"), \"Lower Whisker of xValue\": format(datum[\"lower_whisker_xValue\"], \"\")}"
},
"xc": [
{
"test": "!isValid(datum[\"lower_whisker_xValue\"]) || !isFinite(+datum[\"lower_whisker_xValue\"])",
"value": 0
},
{"scale": "x", "field": "lower_whisker_xValue"}
],
"yc": {"scale": "child_y", "value": 0},
"height": {"value": 15},
"width": {"value": 1}
}
}
},
{
"name": "child_layer_2_layer_0_layer_3_marks",
"type": "rect",
"clip": true,
"style": ["tick", "boxplot-ticks"],
"interactive": true,
"aria": false,
"from": {"data": "data_2"},
"encode": {
"update": {
"opacity": {"value": 1},
"stroke": {"value": "black"},
"strokeWidth": {"value": 1},
"fill": {"value": "black"},
"tooltip": {
"signal": "{\"Upper Whisker of xValue\": format(datum[\"upper_whisker_xValue\"], \"\"), \"Lower Whisker of xValue\": format(datum[\"lower_whisker_xValue\"], \"\")}"
},
"xc": [
{
"test": "!isValid(datum[\"upper_whisker_xValue\"]) || !isFinite(+datum[\"upper_whisker_xValue\"])",
"value": 0
},
{"scale": "x", "field": "upper_whisker_xValue"}
],
"yc": {"scale": "child_y", "value": 0},
"height": {"value": 15},
"width": {"value": 1}
}
}
},
{
"name": "child_layer_2_layer_1_layer_0_marks",
"type": "rect",
"clip": true,
"style": ["bar", "boxplot-box"],
"interactive": true,
"from": {"data": "data_3"},
"encode": {
"update": {
"cornerRadius": {"value": 2},
"ariaRoleDescription": {"value": "box"},
"fill": {"scale": "fill", "field": "yValue"},
"stroke": {"value": "black"},
"strokeWidth": {"value": 2},
"tooltip": {
"signal": "{\"Max of xValue\": format(datum[\"max_xValue\"], \"\"), \"Q3 of xValue\": format(datum[\"upper_box_xValue\"], \"\"), \"Median of xValue\": format(datum[\"mid_box_xValue\"], \"\"), \"Q1 of xValue\": format(datum[\"lower_box_xValue\"], \"\"), \"Min of xValue\": format(datum[\"min_xValue\"], \"\")}"
},
"description": {
"signal": "\"xValue: \" + (format(datum[\"lower_box_xValue\"], \"\")) + \"; upper_box_xValue: \" + (format(datum[\"upper_box_xValue\"], \"\")) + \"; Max of xValue: \" + (format(datum[\"max_xValue\"], \"\")) + \"; Q3 of xValue: \" + (format(datum[\"upper_box_xValue\"], \"\")) + \"; Median of xValue: \" + (format(datum[\"mid_box_xValue\"], \"\")) + \"; Q1 of xValue: \" + (format(datum[\"lower_box_xValue\"], \"\")) + \"; Min of xValue: \" + (format(datum[\"min_xValue\"], \"\"))"
},
"x": [
{
"test": "!isValid(datum[\"lower_box_xValue\"]) || !isFinite(+datum[\"lower_box_xValue\"])",
"value": 0
},
{"scale": "x", "field": "lower_box_xValue"}
],
"x2": [
{
"test": "!isValid(datum[\"upper_box_xValue\"]) || !isFinite(+datum[\"upper_box_xValue\"])",
"value": 0
},
{"scale": "x", "field": "upper_box_xValue"}
],
"yc": {"scale": "child_y", "value": 0},
"height": {"value": 14}
}
}
},
{
"name": "child_layer_2_layer_1_layer_1_marks",
"type": "rect",
"clip": true,
"style": ["tick", "boxplot-median"],
"interactive": true,
"aria": false,
"from": {"data": "data_3"},
"encode": {
"update": {
"stroke": {"value": "black"},
"strokeWidth": {"value": 1},
"tooltip": {
"signal": "{\"Max of xValue\": format(datum[\"max_xValue\"], \"\"), \"Q3 of xValue\": format(datum[\"upper_box_xValue\"], \"\"), \"Median of xValue\": format(datum[\"mid_box_xValue\"], \"\"), \"Q1 of xValue\": format(datum[\"lower_box_xValue\"], \"\"), \"Min of xValue\": format(datum[\"min_xValue\"], \"\")}"
},
"xc": [
{
"test": "!isValid(datum[\"mid_box_xValue\"]) || !isFinite(+datum[\"mid_box_xValue\"])",
"value": 0
},
{"scale": "x", "field": "mid_box_xValue"}
],
"yc": {"scale": "child_y", "value": 0},
"height": {"value": 14},
"width": {"value": 1}
}
}
}
],
"scales": [
{
"name": "child_y",
"type": "linear",
"domain": {
"fields": [
{"data": "data_0", "field": "density"},
{"data": "data_1", "field": "jitter"}
]
},
"range": [{"signal": "child_height"}, 0],
"nice": true,
"zero": true,
"padding": 14
}
],
"axes": [
{
"scale": "x",
"orient": "bottom",
"gridScale": "child_y",
"grid": true,
"tickCount": {"signal": "ceil(child_width/40)"},
"domain": false,
"labels": false,
"aria": false,
"maxExtent": 0,
"minExtent": 0,
"ticks": false,
"zindex": 0
},
{
"scale": "child_y",
"orient": "left",
"grid": false,
"labels": false,
"ticks": false,
"labelOverlap": true,
"tickCount": {"signal": "ceil(child_height/40)"},
"zindex": 0
}
]
}
],
"scales": [
{
"name": "x",
"type": "linear",
"domain": {
"fields": [
{"data": "data_1", "field": "value"},
{"data": "data_1", "field": "clone\\.xValue"},
{"data": "data_3", "field": "lower_whisker_xValue"},
{"data": "data_3", "field": "lower_box_xValue"},
{"data": "data_3", "field": "upper_box_xValue"},
{"data": "data_3", "field": "upper_whisker_xValue"},
{"data": "data_4", "field": "lower_box_xValue"},
{"data": "data_4", "field": "upper_box_xValue"},
{"data": "data_4", "field": "mid_box_xValue"}
]
},
"domainRaw": {"signal": "grid[\"value\"]"},
"range": [0, {"signal": "child_width"}],
"zero": {"signal": "include_zero"},
"nice": true
},
{
"name": "color",
"type": "ordinal",
"domain": {"data": "data_1", "field": "yValue", "sort": true},
"range": "category"
},
{
"name": "fill",
"type": "ordinal",
"domain": {"data": "data_1", "field": "yValue", "sort": true},
"range": "category"
}
],
"legends": [
{
"title": {"signal": "y_axis"},
"fill": "color",
"symbolType": "circle",
"encode": {"symbols": {"update": {"opacity": {"value": 0.7}}}}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment