Hadley-
I too have observed that it isn't possible to draw a single line mark using x,y,x2,y2 (or width/height). It seems that line marks are just drawn from x(d¹),y(d¹)->x(d²),y(d²)->...->x(dⁿ),y(dⁿ), and x2/y2 are ignored. Maybe it would be nice if, when x2 and/or y2 are specified, line marks would be drawn from x(d¹),y(d¹)->x2(d¹),y2(d¹)->x(d²),y(d²)->x2(d²),y2(d²)->...->x(dⁿ),y(dⁿ)->x2(dⁿ),y2(dⁿ).
For the time being, I did work around this by using the new (undocumented) "rule" mark, but I'm not sure if this is intended for public use. For example, the following mark will draw a red line across center of the chart:
{
"type": "rule",
"properties": {
"enter": {
"x": {"value": 0},
"y": {"value": 0},
"x2": {"group": "width"},
"y2": {"group": "height"},
"stroke": {"value": "red"},
"strokeWidth": {"value": 10}
> --
> You received this message because you are subscribed to the Google Groups "vega-js" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
vega-js+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
> <mark-line-y2.json>