Skip to content

Commit

Permalink
fix: use x / xc / x2 based on align when width is speci… (#5149)
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz authored and kanitw committed Jul 20, 2019
1 parent 52f6ab5 commit e566e42
Show file tree
Hide file tree
Showing 55 changed files with 272 additions and 143 deletions.
36 changes: 18 additions & 18 deletions build/vega-lite-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -130,7 +130,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"color": {
"$ref": "#/definitions/Color",
Expand Down Expand Up @@ -1139,7 +1139,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -1153,7 +1153,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"cornerRadius": {
"description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`",
Expand Down Expand Up @@ -7310,7 +7310,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -7324,7 +7324,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"color": {
"$ref": "#/definitions/Color",
Expand Down Expand Up @@ -7866,7 +7866,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -7880,7 +7880,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"color": {
"$ref": "#/definitions/Color",
Expand Down Expand Up @@ -8133,7 +8133,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -8147,7 +8147,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"binSpacing": {
"description": "Offset between bars for binned field. Ideal value for this is either 0 (Preferred by statisticians) or 1 (Vega-Lite Default, D3 example style).\n\n__Default value:__ `1`",
Expand Down Expand Up @@ -8755,7 +8755,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -8769,7 +8769,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"clip": {
"description": "Whether a mark be clipped to the enclosing group’s width and height.",
Expand Down Expand Up @@ -9582,7 +9582,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -9596,7 +9596,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"binSpacing": {
"description": "Offset between bars for binned field. Ideal value for this is either 0 (Preferred by statisticians) or 1 (Vega-Lite Default, D3 example style).\n\n__Default value:__ `1`",
Expand Down Expand Up @@ -11183,7 +11183,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -11197,7 +11197,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"color": {
"$ref": "#/definitions/Color",
Expand Down Expand Up @@ -11524,7 +11524,7 @@
"properties": {
"align": {
"$ref": "#/definitions/Align",
"description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`."
"description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`."
},
"angle": {
"description": "The rotation angle of the text, in degrees.",
Expand All @@ -11543,7 +11543,7 @@
},
"baseline": {
"$ref": "#/definitions/TextBaseline",
"description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
"description": "The vertical alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`"
},
"color": {
"$ref": "#/definitions/Color",
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/airport_connections.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@
"opacity": {"value": 0.35},
"stroke": {"value": "#000"},
"x": {"field": "layer_1_x"},
"y": {"field": "layer_1_y"},
"x2": {"field": "layer_1_x2"},
"y": {"field": "layer_1_y"},
"y2": {"field": "layer_1_y2"}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/area_vertical.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"orient": {"value": "horizontal"},
"fill": {"value": "#4c78a8"},
"x": {"scale": "x", "field": "sum_Weight_in_lbs"},
"y": {"scale": "y", "field": "year_Year"},
"x2": {"scale": "x", "value": 0},
"y": {"scale": "y", "field": "year_Year"},
"defined": {
"signal": "datum[\"sum_Weight_in_lbs\"] !== null && !isNaN(datum[\"sum_Weight_in_lbs\"]) && datum[\"year_Year\"] !== null && !isNaN(datum[\"year_Year\"])"
}
Expand Down
8 changes: 4 additions & 4 deletions examples/compiled/boxplot_1D_horizontal.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\")}"
},
"x": {"scale": "x", "field": "lower_whisker_people"},
"y": {"signal": "height", "mult": 0.5},
"x2": {"scale": "x", "field": "lower_box_people"}
"x2": {"scale": "x", "field": "lower_box_people"},
"y": {"signal": "height", "mult": 0.5}
}
}
},
Expand All @@ -172,8 +172,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\")}"
},
"x": {"scale": "x", "field": "upper_box_people"},
"y": {"signal": "height", "mult": 0.5},
"x2": {"scale": "x", "field": "upper_whisker_people"}
"x2": {"scale": "x", "field": "upper_whisker_people"},
"y": {"signal": "height", "mult": 0.5}
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions examples/compiled/boxplot_1D_horizontal_custom_mark.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\")}"
},
"x": {"scale": "x", "field": "lower_whisker_people"},
"y": {"signal": "height", "mult": 0.5},
"x2": {"scale": "x", "field": "lower_box_people"}
"x2": {"scale": "x", "field": "lower_box_people"},
"y": {"signal": "height", "mult": 0.5}
}
}
},
Expand All @@ -192,8 +192,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\")}"
},
"x": {"scale": "x", "field": "upper_box_people"},
"y": {"signal": "height", "mult": 0.5},
"x2": {"scale": "x", "field": "upper_whisker_people"}
"x2": {"scale": "x", "field": "upper_whisker_people"},
"y": {"signal": "height", "mult": 0.5}
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions examples/compiled/boxplot_1D_horizontal_explicit.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\")}"
},
"x": {"scale": "x", "field": "lower_whisker_people"},
"y": {"signal": "height", "mult": 0.5},
"x2": {"scale": "x", "field": "lower_box_people"}
"x2": {"scale": "x", "field": "lower_box_people"},
"y": {"signal": "height", "mult": 0.5}
}
}
},
Expand All @@ -172,8 +172,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\")}"
},
"x": {"scale": "x", "field": "upper_box_people"},
"y": {"signal": "height", "mult": 0.5},
"x2": {"scale": "x", "field": "upper_whisker_people"}
"x2": {"scale": "x", "field": "upper_whisker_people"},
"y": {"signal": "height", "mult": 0.5}
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions examples/compiled/boxplot_2D_horizontal.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\"), \"age\": ''+datum[\"age\"]}"
},
"x": {"scale": "x", "field": "lower_whisker_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "lower_box_people"}
"x2": {"scale": "x", "field": "lower_box_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand All @@ -174,8 +174,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\"), \"age\": ''+datum[\"age\"]}"
},
"x": {"scale": "x", "field": "upper_box_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "upper_whisker_people"}
"x2": {"scale": "x", "field": "upper_whisker_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions examples/compiled/boxplot_2D_horizontal_color_size.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\"), \"age\": ''+datum[\"age\"]}"
},
"x": {"scale": "x", "field": "lower_whisker_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "lower_box_people"}
"x2": {"scale": "x", "field": "lower_box_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand All @@ -174,8 +174,8 @@
"signal": "{\"Upper Whisker of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Lower Whisker of people\": format(datum[\"lower_whisker_people\"], \"\"), \"age\": ''+datum[\"age\"]}"
},
"x": {"scale": "x", "field": "upper_box_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "upper_whisker_people"}
"x2": {"scale": "x", "field": "upper_whisker_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions examples/compiled/boxplot_minmax_2D_horizontal.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"signal": "{\"Max of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Q3 of people\": format(datum[\"upper_box_people\"], \"\"), \"Median of people\": format(datum[\"mid_box_people\"], \"\"), \"Q1 of people\": format(datum[\"lower_box_people\"], \"\"), \"Min of people\": format(datum[\"lower_whisker_people\"], \"\"), \"age\": ''+datum[\"age\"]}"
},
"x": {"scale": "x", "field": "lower_whisker_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "lower_box_people"}
"x2": {"scale": "x", "field": "lower_box_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand All @@ -101,8 +101,8 @@
"signal": "{\"Max of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Q3 of people\": format(datum[\"upper_box_people\"], \"\"), \"Median of people\": format(datum[\"mid_box_people\"], \"\"), \"Q1 of people\": format(datum[\"lower_box_people\"], \"\"), \"Min of people\": format(datum[\"lower_whisker_people\"], \"\"), \"age\": ''+datum[\"age\"]}"
},
"x": {"scale": "x", "field": "upper_box_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "upper_whisker_people"}
"x2": {"scale": "x", "field": "upper_whisker_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"signal": "{\"Max of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Q3 of people\": format(datum[\"upper_box_people\"], \"\"), \"Median of people\": format(datum[\"mid_box_people\"], \"\"), \"Q1 of people\": format(datum[\"lower_box_people\"], \"\"), \"Min of people\": format(datum[\"lower_whisker_people\"], \"\"), \"age\": ''+datum[\"age\"]}"
},
"x": {"scale": "x", "field": "lower_whisker_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "lower_box_people"}
"x2": {"scale": "x", "field": "lower_box_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand All @@ -101,8 +101,8 @@
"signal": "{\"Max of people\": format(datum[\"upper_whisker_people\"], \"\"), \"Q3 of people\": format(datum[\"upper_box_people\"], \"\"), \"Median of people\": format(datum[\"mid_box_people\"], \"\"), \"Q1 of people\": format(datum[\"lower_box_people\"], \"\"), \"Min of people\": format(datum[\"lower_whisker_people\"], \"\"), \"age\": ''+datum[\"age\"]}"
},
"x": {"scale": "x", "field": "upper_box_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "upper_whisker_people"}
"x2": {"scale": "x", "field": "upper_whisker_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions examples/compiled/concat_layer_voyager_result_future.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
"update": {
"stroke": {"value": "black"},
"x": {"scale": "concat_0_x", "field": "lo"},
"y": {"scale": "concat_0_y", "field": "study", "band": 0.5},
"x2": {"scale": "concat_0_x", "field": "hi"}
"x2": {"scale": "concat_0_x", "field": "hi"},
"y": {"scale": "concat_0_y", "field": "study", "band": 0.5}
}
}
},
Expand Down Expand Up @@ -270,14 +270,14 @@
},
{"scale": "concat_1_x", "field": "from"}
],
"y": {"signal": "concat_1_height", "mult": 0.5},
"x2": [
{
"test": "datum[\"to\"] === null || isNaN(datum[\"to\"])",
"value": 0
},
{"scale": "concat_1_x", "field": "to"}
]
],
"y": {"signal": "concat_1_height", "mult": 0.5}
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions examples/compiled/errorbar_horizontal_aggregate.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"update": {
"stroke": {"value": "black"},
"x": {"scale": "x", "field": "min_people"},
"y": {"scale": "y", "field": "age", "band": 0.5},
"x2": {"scale": "x", "field": "max_people"}
"x2": {"scale": "x", "field": "max_people"},
"y": {"scale": "y", "field": "age", "band": 0.5}
}
}
},
Expand Down
Loading

0 comments on commit e566e42

Please sign in to comment.