From 0b1c3857b5ec538ad0acec3e21c9ed741b38135f Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Mon, 1 May 2023 09:17:02 -0700 Subject: [PATCH] fix: avoid repetitive labels by using tickMinStep (#8872) Co-authored-by: GitHub Actions Bot --- examples/compiled/area.vg.json | 6 + .../compiled/area_temperature_range.vg.json | 6 + examples/compiled/area_vertical.vg.json | 6 + examples/compiled/bar_1d_binned.vg.json | 1 + .../compiled/bar_custom_time_domain.vg.json | 6 + examples/compiled/bar_month.vg.json | 3 + examples/compiled/bar_month_band.vg.json | 6 + .../compiled/bar_month_band_config.vg.json | 6 + examples/compiled/bar_month_temporal.vg.json | 6 + .../bar_month_temporal_initial.vg.json | 6 + examples/compiled/bar_narrow_int_span.png | Bin 0 -> 4036 bytes examples/compiled/bar_narrow_int_span.svg | 1 + examples/compiled/bar_narrow_int_span.vg.json | 125 ++++++++++++ examples/compiled/bar_yearmonth.vg.json | 6 + .../bar_yearmonth_custom_format.vg.json | 6 + .../compiled/circle_github_punchcard.vg.json | 3 + .../circle_labelangle_orient_signal.vg.json | 3 + examples/compiled/concat_weather.vg.json | 6 + .../compiled/dynamic_color_legend.vg.json | 6 + examples/compiled/hconcat_weather.vg.json | 3 + .../compiled/interactive_area_brush.vg.json | 6 + examples/compiled/interactive_legend.vg.json | 6 + .../interactive_legend_dblclick.vg.json | 6 + .../interactive_multi_line_tooltip.vg.json | 6 + .../interactive_seattle_weather.vg.json | 6 + examples/compiled/layer_bar_month.vg.json | 3 + examples/compiled/layer_dual_axis.vg.json | 6 + examples/compiled/layer_falkensee.vg.json | 6 + ...d_2d_horizontal_borders_strokedash.vg.json | 6 + .../compiled/layer_line_errorband_ci.vg.json | 6 + ...ayer_line_errorband_pre_aggregated.vg.json | 6 + .../layer_line_mean_point_raw.vg.json | 6 + .../compiled/layer_precipitation_mean.vg.json | 3 + examples/compiled/layer_timeunit_rect.vg.json | 6 + examples/compiled/line_calculate.vg.json | 6 + examples/compiled/line_concat_facet.vg.json | 6 + examples/compiled/line_max_year.vg.json | 6 + examples/compiled/line_mean_month.vg.json | 6 + examples/compiled/line_mean_year.vg.json | 6 + examples/compiled/line_month.vg.json | 6 + .../compiled/line_month_center_band.vg.json | 6 + examples/compiled/line_narrow_2year_span.png | Bin 0 -> 9293 bytes examples/compiled/line_narrow_2year_span.svg | 1 + .../compiled/line_narrow_2year_span.vg.json | 133 +++++++++++++ examples/compiled/line_narrow_year_span.png | Bin 0 -> 9768 bytes examples/compiled/line_narrow_year_span.svg | 1 + .../compiled/line_narrow_year_span.vg.json | 132 +++++++++++++ .../compiled/line_narrow_yearmonth_span.png | Bin 0 -> 18698 bytes .../compiled/line_narrow_yearmonth_span.svg | 1 + .../line_narrow_yearmonth_span.vg.json | 180 ++++++++++++++++++ .../compiled/line_narrow_yearquarter_span.png | Bin 0 -> 13232 bytes .../compiled/line_narrow_yearquarter_span.svg | 1 + .../line_narrow_yearquarter_span.vg.json | 132 +++++++++++++ examples/compiled/line_overlay.vg.json | 6 + .../compiled/line_overlay_stroked.vg.json | 6 + examples/compiled/line_quarter_legend.vg.json | 6 + .../compiled/rect_heatmap_weather.vg.json | 6 + examples/compiled/rect_lasagna.vg.json | 3 + examples/compiled/repeat_child_layer.vg.json | 9 + examples/compiled/repeat_line_weather.vg.json | 18 ++ .../compiled/selection_brush_timeunit.vg.json | 12 ++ .../selection_layer_bar_month.vg.json | 3 + examples/compiled/stacked_area.vg.json | 6 + .../compiled/stacked_area_normalize.vg.json | 6 + .../compiled/stacked_area_ordinal.vg.json | 6 + examples/compiled/stacked_area_stream.vg.json | 6 + examples/compiled/stacked_bar_count.vg.json | 3 + ...ked_bar_count_corner_radius_config.vg.json | 3 + ...acked_bar_count_corner_radius_mark.vg.json | 3 + ...ked_bar_count_corner_radius_mark_x.vg.json | 3 + ...ked_bar_count_corner_radius_stroke.vg.json | 3 + examples/compiled/stacked_bar_size.vg.json | 3 + examples/compiled/stacked_bar_weather.vg.json | 3 + examples/compiled/time_custom_step.vg.json | 6 + .../compiled/time_output_utc_scale.vg.json | 6 + .../compiled/time_output_utc_timeunit.vg.json | 6 + examples/compiled/time_parse_local.vg.json | 3 + examples/compiled/time_parse_utc.vg.json | 3 + .../compiled/time_parse_utc_format.vg.json | 3 + .../compiled/trellis_area_seattle.vg.json | 3 + examples/compiled/trellis_column_year.vg.json | 3 + .../compiled/trellis_line_quarter.vg.json | 3 + examples/compiled/vconcat_weather.vg.json | 3 + examples/compiled/wheat_wages.vg.json | 1 + .../window_cumulative_running_average.vg.json | 6 + examples/specs/bar_narrow_int_span.vl.json | 20 ++ examples/specs/line_narrow_2year_span.vl.json | 15 ++ examples/specs/line_narrow_year_span.vl.json | 15 ++ .../specs/line_narrow_yearmonth_span.vl.json | 16 ++ .../line_narrow_yearquarter_span.vl.json | 15 ++ ...e_narrow_yearmonth_span_normalized.vl.json | 35 ++++ src/compile/axis/parse.ts | 5 + src/compile/axis/properties.ts | 57 +++++- src/compile/format.ts | 4 +- src/timeunit.ts | 5 + test/compile/axis/properties.test.ts | 50 ++++- 96 files changed, 1296 insertions(+), 13 deletions(-) create mode 100644 examples/compiled/bar_narrow_int_span.png create mode 100644 examples/compiled/bar_narrow_int_span.svg create mode 100644 examples/compiled/bar_narrow_int_span.vg.json create mode 100644 examples/compiled/line_narrow_2year_span.png create mode 100644 examples/compiled/line_narrow_2year_span.svg create mode 100644 examples/compiled/line_narrow_2year_span.vg.json create mode 100644 examples/compiled/line_narrow_year_span.png create mode 100644 examples/compiled/line_narrow_year_span.svg create mode 100644 examples/compiled/line_narrow_year_span.vg.json create mode 100644 examples/compiled/line_narrow_yearmonth_span.png create mode 100644 examples/compiled/line_narrow_yearmonth_span.svg create mode 100644 examples/compiled/line_narrow_yearmonth_span.vg.json create mode 100644 examples/compiled/line_narrow_yearquarter_span.png create mode 100644 examples/compiled/line_narrow_yearquarter_span.svg create mode 100644 examples/compiled/line_narrow_yearquarter_span.vg.json create mode 100644 examples/specs/bar_narrow_int_span.vl.json create mode 100644 examples/specs/line_narrow_2year_span.vl.json create mode 100644 examples/specs/line_narrow_year_span.vl.json create mode 100644 examples/specs/line_narrow_yearmonth_span.vl.json create mode 100644 examples/specs/line_narrow_yearquarter_span.vl.json create mode 100644 examples/specs/normalized/line_narrow_yearmonth_span_normalized.vl.json diff --git a/examples/compiled/area.vg.json b/examples/compiled/area.vg.json index 23444f633c..2553f01d11 100644 --- a/examples/compiled/area.vg.json +++ b/examples/compiled/area.vg.json @@ -74,6 +74,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -105,6 +108,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/area_temperature_range.vg.json b/examples/compiled/area_temperature_range.vg.json index 871162cddc..c2d7292e48 100644 --- a/examples/compiled/area_temperature_range.vg.json +++ b/examples/compiled/area_temperature_range.vg.json @@ -82,6 +82,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -113,6 +116,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/area_vertical.vg.json b/examples/compiled/area_vertical.vg.json index c3f82dcfcd..6f5b19c335 100644 --- a/examples/compiled/area_vertical.vg.json +++ b/examples/compiled/area_vertical.vg.json @@ -90,6 +90,9 @@ "gridScale": "x", "grid": true, "tickCount": {"signal": "ceil(height/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -118,6 +121,9 @@ }, "labelOverlap": true, "tickCount": {"signal": "ceil(height/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ] diff --git a/examples/compiled/bar_1d_binned.vg.json b/examples/compiled/bar_1d_binned.vg.json index 517e6822ec..f8d0eaf977 100644 --- a/examples/compiled/bar_1d_binned.vg.json +++ b/examples/compiled/bar_1d_binned.vg.json @@ -83,6 +83,7 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/10)"}, + "tickMinStep": 1, "zindex": 0 } ], diff --git a/examples/compiled/bar_custom_time_domain.vg.json b/examples/compiled/bar_custom_time_domain.vg.json index ca28ce3542..bdf52baa77 100644 --- a/examples/compiled/bar_custom_time_domain.vg.json +++ b/examples/compiled/bar_custom_time_domain.vg.json @@ -89,6 +89,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 1, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -121,6 +124,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 1, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/bar_month.vg.json b/examples/compiled/bar_month.vg.json index cdd3dacecf..d59b3b4477 100644 --- a/examples/compiled/bar_month.vg.json +++ b/examples/compiled/bar_month.vg.json @@ -101,6 +101,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/bar_month_band.vg.json b/examples/compiled/bar_month_band.vg.json index 3420ee6aa1..53b1732ddb 100644 --- a/examples/compiled/bar_month_band.vg.json +++ b/examples/compiled/bar_month_band.vg.json @@ -82,6 +82,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -114,6 +117,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/bar_month_band_config.vg.json b/examples/compiled/bar_month_band_config.vg.json index 3420ee6aa1..53b1732ddb 100644 --- a/examples/compiled/bar_month_band_config.vg.json +++ b/examples/compiled/bar_month_band_config.vg.json @@ -82,6 +82,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -114,6 +117,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/bar_month_temporal.vg.json b/examples/compiled/bar_month_temporal.vg.json index 36c048b31b..725ebf56ca 100644 --- a/examples/compiled/bar_month_temporal.vg.json +++ b/examples/compiled/bar_month_temporal.vg.json @@ -77,6 +77,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -109,6 +112,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/bar_month_temporal_initial.vg.json b/examples/compiled/bar_month_temporal_initial.vg.json index f9973dd20d..35cd7b8ab1 100644 --- a/examples/compiled/bar_month_temporal_initial.vg.json +++ b/examples/compiled/bar_month_temporal_initial.vg.json @@ -78,6 +78,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -111,6 +114,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "encode": {"labels": {"update": {"text": {"signal": "datum.label[0]"}}}}, "zindex": 0 }, diff --git a/examples/compiled/bar_narrow_int_span.png b/examples/compiled/bar_narrow_int_span.png new file mode 100644 index 0000000000000000000000000000000000000000..0dcf106c8ec038a22cc4b34b12d4404badd82d84 GIT binary patch literal 4036 zcmc(iXH-+^7KRTf45(CDWBd*|MnKX=3m#BSo)E`K2+x9SWq=j!v@|S+h|YB8EWdCr*O}}hv4I? z-LKIXPWx3_N-_#_o|PIr!fte1)>YVnM=@C@A?q5C8ERvfR#aSkQIS8e zk+5uBm_A zpy5M0T6U}cQF}c11vk%H{yak_*4QHeZglimMtAh9S8~-IXYc}MO9RQ*jzTbda=*QN zIXR>*$aeku^;D17BMCJ%7ZqV=@RDZvWu>LsK|z;1o42Ry{4f*9g#~vff{Vi2<;|C} z^vTYmdsCb5-ZA+vjxsciC1qvtZG~!t?#!W|XohRt5Id=&qLNz9!Wb!&d85l84wtvK zwk9P7OeQMjS5+zWIdUSBb904iOS_f_2(?~9@TQ_7CO<#Ft{TE3%*-t9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bJ#AN1+c8YFPam+ALRb2f=*pseGBY6mEi~bK5Trfv6aD8*OHsHtZu_)W<&9h9~)X& zpxqnBJWb8a&J(!eMVFr42M*iWg9rOj7}=)r<6o|S9{pSom-X66U>4GyzaN%Cx87Dh zHLXvc$@k-(i3FOFH~Z(QDb4AQ>bwd3)x-0N$2qqa^>-S^8Uh@t+2{yE`frmU>2UvhFZGV2j80+TQsLqqmW;~?RS9-|6N z-zw_{xen^<@t=CZ_Y(VWs{Ys9|L=Co4JgmHv;av$nylr+$FqB4-oCx+G=amhgP)k+ zC*IZFot%<_>R^Iqz36&2I(0viKXxtsj#S*iOUQoVmC>9RqeqIckcbwGfU zuoms4M*0u~{X^Mdu{C(#o9334qH1sDr#QFFfucXt#&8IntfHdgyWZa1mHPEyNW=vn zH~7rQ_Qnx;u~5m2ColbvDlUEP;n_K2Efp&S3YWU*lva2yt(^$BQFaJi?^}>DAnHqpadEk8`A?%6y3O9y?TWk9?tl{ z5!a^cI`Hr^FfuaIRnzAJ4G#~O(>cRwz#ZRy`@M?Qy?f`!gJyn|w0Uz1sIYIP4_)g~ zdLn<96?k4>&nqP*<%7)B2vd=^Ykpe7fhbJXj^}ci>Pn-;SBi|ja?*8Q9&ZBuHCKZ- z@v0;Q0^veHO*Osz{Hn<_xMQ~6ZASCf&LV48PW^>?hyDbQ$FFS9%Ar#Vue)1BctAuPa(y(1^Ow8gB7pZH*zE5Er*JO4CJ+!nM=(>>V~ye`CHwCWzS zYT2hEI2;ZtM(U!Wcq;C$R{lJ7XTJOh;J@%G88`VjF?guN3W&(b5d>O_P0$sA6q0EY zv>K`iq}H0GML2%&N_wFnD3SL?y=L|I=# zzyVO+`NK7e@A}T*La%u{yeVi3-MdfsW4a; \ No newline at end of file diff --git a/examples/compiled/bar_narrow_int_span.vg.json b/examples/compiled/bar_narrow_int_span.vg.json new file mode 100644 index 0000000000..097366c8af --- /dev/null +++ b/examples/compiled/bar_narrow_int_span.vg.json @@ -0,0 +1,125 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "A simple bar chart with integer axis.", + "background": "white", + "padding": 5, + "width": 200, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "values": [{"a": 0, "b": 28}, {"a": 1, "b": 38}, {"a": 2, "b": 35}] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + { + "type": "stack", + "groupby": ["a"], + "field": "b", + "sort": {"field": [], "order": []}, + "as": ["b_start", "b_end"], + "offset": "zero" + }, + { + "type": "filter", + "expr": "isValid(datum[\"a\"]) && isFinite(+datum[\"a\"]) && isValid(datum[\"b\"]) && isFinite(+datum[\"b\"])" + } + ] + } + ], + "marks": [ + { + "name": "marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": "\"a: \" + (format(datum[\"a\"], \"d\")) + \"; b: \" + (format(datum[\"b\"], \"\"))" + }, + "xc": {"scale": "x", "field": "a"}, + "width": {"value": 5}, + "y": {"scale": "y", "field": "b_end"}, + "y2": {"scale": "y", "field": "b_start"} + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "linear", + "domain": {"data": "data_0", "field": "a"}, + "range": [0, {"signal": "width"}], + "nice": true, + "zero": false, + "padding": 5 + }, + { + "name": "y", + "type": "linear", + "domain": {"data": "data_0", "fields": ["b_start", "b_end"]}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": 1, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "a", + "format": "d", + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": 1, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] +} diff --git a/examples/compiled/bar_yearmonth.vg.json b/examples/compiled/bar_yearmonth.vg.json index 6285b69979..4e379e068b 100644 --- a/examples/compiled/bar_yearmonth.vg.json +++ b/examples/compiled/bar_yearmonth.vg.json @@ -79,6 +79,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -112,6 +115,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/bar_yearmonth_custom_format.vg.json b/examples/compiled/bar_yearmonth_custom_format.vg.json index 1a5d2ecde0..f92265af01 100644 --- a/examples/compiled/bar_yearmonth_custom_format.vg.json +++ b/examples/compiled/bar_yearmonth_custom_format.vg.json @@ -79,6 +79,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -110,6 +113,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/circle_github_punchcard.vg.json b/examples/compiled/circle_github_punchcard.vg.json index 7d6253a367..d344d3c008 100644 --- a/examples/compiled/circle_github_punchcard.vg.json +++ b/examples/compiled/circle_github_punchcard.vg.json @@ -118,6 +118,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 1, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/circle_labelangle_orient_signal.vg.json b/examples/compiled/circle_labelangle_orient_signal.vg.json index c1d1e53fc5..54c2d54ff0 100644 --- a/examples/compiled/circle_labelangle_orient_signal.vg.json +++ b/examples/compiled/circle_labelangle_orient_signal.vg.json @@ -129,6 +129,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 1, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "encode": { "labels": { "update": { diff --git a/examples/compiled/concat_weather.vg.json b/examples/compiled/concat_weather.vg.json index 0df5e44753..7db19ec215 100644 --- a/examples/compiled/concat_weather.vg.json +++ b/examples/compiled/concat_weather.vg.json @@ -170,6 +170,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { @@ -239,6 +242,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/dynamic_color_legend.vg.json b/examples/compiled/dynamic_color_legend.vg.json index c879e5b1ca..0f7b189077 100644 --- a/examples/compiled/dynamic_color_legend.vg.json +++ b/examples/compiled/dynamic_color_legend.vg.json @@ -382,6 +382,9 @@ "gridScale": "concat_0_y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -413,6 +416,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/hconcat_weather.vg.json b/examples/compiled/hconcat_weather.vg.json index 958915aad6..240bcd9e94 100644 --- a/examples/compiled/hconcat_weather.vg.json +++ b/examples/compiled/hconcat_weather.vg.json @@ -149,6 +149,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/interactive_area_brush.vg.json b/examples/compiled/interactive_area_brush.vg.json index 49c36df21f..1c3914f04e 100644 --- a/examples/compiled/interactive_area_brush.vg.json +++ b/examples/compiled/interactive_area_brush.vg.json @@ -385,6 +385,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -418,6 +421,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/interactive_legend.vg.json b/examples/compiled/interactive_legend.vg.json index 5e1c0ccd2e..be543ff04d 100644 --- a/examples/compiled/interactive_legend.vg.json +++ b/examples/compiled/interactive_legend.vg.json @@ -199,6 +199,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -218,6 +221,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ], diff --git a/examples/compiled/interactive_legend_dblclick.vg.json b/examples/compiled/interactive_legend_dblclick.vg.json index f76010964b..abdd81c33e 100644 --- a/examples/compiled/interactive_legend_dblclick.vg.json +++ b/examples/compiled/interactive_legend_dblclick.vg.json @@ -199,6 +199,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -218,6 +221,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ], diff --git a/examples/compiled/interactive_multi_line_tooltip.vg.json b/examples/compiled/interactive_multi_line_tooltip.vg.json index 9dad93d0be..e2e040cc4b 100644 --- a/examples/compiled/interactive_multi_line_tooltip.vg.json +++ b/examples/compiled/interactive_multi_line_tooltip.vg.json @@ -184,6 +184,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -217,6 +220,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/interactive_seattle_weather.vg.json b/examples/compiled/interactive_seattle_weather.vg.json index 850ac9048e..95aedce2d9 100644 --- a/examples/compiled/interactive_seattle_weather.vg.json +++ b/examples/compiled/interactive_seattle_weather.vg.json @@ -377,6 +377,9 @@ "gridScale": "concat_0_y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -408,6 +411,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_bar_month.vg.json b/examples/compiled/layer_bar_month.vg.json index 498fab4f7b..98c23e75f6 100644 --- a/examples/compiled/layer_bar_month.vg.json +++ b/examples/compiled/layer_bar_month.vg.json @@ -145,6 +145,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_dual_axis.vg.json b/examples/compiled/layer_dual_axis.vg.json index 781c9f0b87..618e2b0245 100644 --- a/examples/compiled/layer_dual_axis.vg.json +++ b/examples/compiled/layer_dual_axis.vg.json @@ -108,6 +108,9 @@ "orient": "bottom", "gridScale": "layer_0_y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -123,6 +126,9 @@ "format": "%b", "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_falkensee.vg.json b/examples/compiled/layer_falkensee.vg.json index 9eb4857ab4..1a44900ffb 100644 --- a/examples/compiled/layer_falkensee.vg.json +++ b/examples/compiled/layer_falkensee.vg.json @@ -217,6 +217,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -250,6 +253,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_line_errorband_2d_horizontal_borders_strokedash.vg.json b/examples/compiled/layer_line_errorband_2d_horizontal_borders_strokedash.vg.json index d219e8ca88..29179e6ef3 100644 --- a/examples/compiled/layer_line_errorband_2d_horizontal_borders_strokedash.vg.json +++ b/examples/compiled/layer_line_errorband_2d_horizontal_borders_strokedash.vg.json @@ -162,6 +162,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -195,6 +198,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_line_errorband_ci.vg.json b/examples/compiled/layer_line_errorband_ci.vg.json index c917e627ba..8a395aa988 100644 --- a/examples/compiled/layer_line_errorband_ci.vg.json +++ b/examples/compiled/layer_line_errorband_ci.vg.json @@ -116,6 +116,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -149,6 +152,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_line_errorband_pre_aggregated.vg.json b/examples/compiled/layer_line_errorband_pre_aggregated.vg.json index 28f4ec42f4..a77d9a9b94 100644 --- a/examples/compiled/layer_line_errorband_pre_aggregated.vg.json +++ b/examples/compiled/layer_line_errorband_pre_aggregated.vg.json @@ -140,6 +140,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -173,6 +176,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_line_mean_point_raw.vg.json b/examples/compiled/layer_line_mean_point_raw.vg.json index 7feac86522..9d7abba5d9 100644 --- a/examples/compiled/layer_line_mean_point_raw.vg.json +++ b/examples/compiled/layer_line_mean_point_raw.vg.json @@ -119,6 +119,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -152,6 +155,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_precipitation_mean.vg.json b/examples/compiled/layer_precipitation_mean.vg.json index d19a7112bd..6d2e5e4be2 100644 --- a/examples/compiled/layer_precipitation_mean.vg.json +++ b/examples/compiled/layer_precipitation_mean.vg.json @@ -145,6 +145,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/layer_timeunit_rect.vg.json b/examples/compiled/layer_timeunit_rect.vg.json index 46afda310c..ad9088eda9 100644 --- a/examples/compiled/layer_timeunit_rect.vg.json +++ b/examples/compiled/layer_timeunit_rect.vg.json @@ -133,6 +133,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -166,6 +169,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "encode": {"labels": {"update": {"text": {"signal": "datum.label[0]"}}}}, "zindex": 0 }, diff --git a/examples/compiled/line_calculate.vg.json b/examples/compiled/line_calculate.vg.json index ae904ba929..98d125d2f4 100644 --- a/examples/compiled/line_calculate.vg.json +++ b/examples/compiled/line_calculate.vg.json @@ -76,6 +76,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -108,6 +111,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_concat_facet.vg.json b/examples/compiled/line_concat_facet.vg.json index bd4d08a0b0..f47152ce69 100644 --- a/examples/compiled/line_concat_facet.vg.json +++ b/examples/compiled/line_concat_facet.vg.json @@ -122,6 +122,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ] @@ -242,6 +245,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_max_year.vg.json b/examples/compiled/line_max_year.vg.json index d65059dcee..bdd36827fb 100644 --- a/examples/compiled/line_max_year.vg.json +++ b/examples/compiled/line_max_year.vg.json @@ -75,6 +75,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -108,6 +111,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_mean_month.vg.json b/examples/compiled/line_mean_month.vg.json index d9559d671b..790f295090 100644 --- a/examples/compiled/line_mean_month.vg.json +++ b/examples/compiled/line_mean_month.vg.json @@ -71,6 +71,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -103,6 +106,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_mean_year.vg.json b/examples/compiled/line_mean_year.vg.json index 20d75c4c17..b093367e4e 100644 --- a/examples/compiled/line_mean_year.vg.json +++ b/examples/compiled/line_mean_year.vg.json @@ -72,6 +72,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -105,6 +108,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_month.vg.json b/examples/compiled/line_month.vg.json index 674b3427ac..d0834d3ca4 100644 --- a/examples/compiled/line_month.vg.json +++ b/examples/compiled/line_month.vg.json @@ -72,6 +72,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -104,6 +107,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_month_center_band.vg.json b/examples/compiled/line_month_center_band.vg.json index 05c08689e6..e089c38f0d 100644 --- a/examples/compiled/line_month_center_band.vg.json +++ b/examples/compiled/line_month_center_band.vg.json @@ -78,6 +78,9 @@ "orient": "bottom", "gridScale": "y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -110,6 +113,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_narrow_2year_span.png b/examples/compiled/line_narrow_2year_span.png new file mode 100644 index 0000000000000000000000000000000000000000..12f54ef6bd6b84f06c8befab31b915b14e414642 GIT binary patch literal 9293 zcmbt)2{_bk+xJM;79^B45z4MY_C_Ts3fZ@^m0k9A6ryD5Mv{GNNJw^L4M`HROqOA? zWZw;A8}B*yeLvs#e9!m1@A1ChcXUkSnE5Z)|GLiew_Wq>wx-$ zC&6ozmKy$7Oq@xCH|qNuYF7~Z8!&h&Fn&rRZECzxwR6+&_1a19HKi#(o9|mu z5!yF+LtM@kVyh9nSC(S&hkk|d6OppKbajlHUreKE_NKFc5Tc@@ zR@T<{Duxoz+a4v6NQ1srRaJ3uaT1oF4}Xs2K&w4O(z?ryu^m6|vW&lc;J^V|TG|E+ zi3b7d>gom}tmlM<)og z^s5YOHa;G$+&?J7dZ@d*d+-qq`^=d$1_gTW-o2w`V4yiAAnrc1FYjY>(rUu%n*!&~ohv1YGw!Xet(3v1 zhfjVgeb}?^O^-ZGn~{-WT0Z9)g?bhi7PdicW@W|CA>-7${rvfJgK~$HW@cswsi^Mg z>0P^W>gxTT zx3@%$%MVw2YdT+GSJ%*JdT>G8)b!T<`==4@3F3kmFUH5k9q%tNR=alXDR&MXZ`WC( z+wX6`f*F+3v$BHq&3r=7>b!jrFfcGcUgna4FKum&9UVu4S|Zq(j~#o`a-aA7`PeUC zt}EVPMk2)awiXpi2EILK5iayNiCkBooSf8GV0oqC8R~+puCGF)wcb$r%tlw8s8w9q zc+@)7uDXM5#W$uqi!!V}vW;n^3*!gc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AcOD5ShK|Pfbe72R%gY2y*cP5$Xp))7*h9PY1#;JD`kN$m9FA0iENt_fO0& z;V>0F<>X+UD%X5}8>_g5=K3(PSVJ+^m7xm36C)GT<3^9jFlbO@GmcR \ No newline at end of file diff --git a/examples/compiled/line_narrow_2year_span.vg.json b/examples/compiled/line_narrow_2year_span.vg.json new file mode 100644 index 0000000000..a630bc860f --- /dev/null +++ b/examples/compiled/line_narrow_2year_span.vg.json @@ -0,0 +1,133 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Google's stock price from 2006 to 2008.", + "background": "white", + "padding": 5, + "width": 200, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "url": "data/stocks.csv", + "format": {"type": "csv", "parse": {"date": "date"}}, + "transform": [ + {"type": "filter", "expr": "datum.symbol==='GOOG'"}, + { + "type": "filter", + "expr": "inrange(time(datetime(year(datum[\"date\"]), 0, 1, 0, 0, 0, 0)), [time(datetime(2006, 0, 1, 0, 0, 0, 0)), time(datetime(2008, 0, 1, 0, 0, 0, 0))])" + }, + { + "field": "date", + "type": "timeunit", + "units": ["year"], + "step": 2, + "as": ["year_step_2_date", "year_step_2_date_end"] + }, + { + "type": "aggregate", + "groupby": ["year_step_2_date"], + "ops": ["average"], + "fields": ["price"], + "as": ["average_price"] + } + ] + } + ], + "marks": [ + { + "name": "marks", + "type": "line", + "style": ["line"], + "sort": {"field": "datum[\"year_step_2_date\"]"}, + "from": {"data": "source_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "description": { + "signal": "\"date (year): \" + (timeFormat(datum[\"year_step_2_date\"], timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Average of price: \" + (format(datum[\"average_price\"], \"\"))" + }, + "x": {"scale": "x", "field": "year_step_2_date"}, + "y": {"scale": "y", "field": "average_price"}, + "defined": { + "signal": "isValid(datum[\"year_step_2_date\"]) && isFinite(+datum[\"year_step_2_date\"]) && isValid(datum[\"average_price\"]) && isFinite(+datum[\"average_price\"])" + } + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "time", + "domain": {"data": "source_0", "field": "year_step_2_date"}, + "range": [0, {"signal": "width"}] + }, + { + "name": "y", + "type": "linear", + "domain": {"data": "source_0", "field": "average_price"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2003, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "date (year)", + "format": { + "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" + }, + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2003, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "Average of price", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] +} diff --git a/examples/compiled/line_narrow_year_span.png b/examples/compiled/line_narrow_year_span.png new file mode 100644 index 0000000000000000000000000000000000000000..f03bab03432cc2b3026847a5d92dee2c55fdf0f4 GIT binary patch literal 9768 zcmbVyc{mho`}SzDi>HOG^C*R6mn};sOUS;9Bv~R$*_T0<>{Mi5iY(cQ?8Z`rkX>Y* zvai_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wts0VEx#sb;d+1$6Hkg}75vTO8m0aGXB6&0`Dy28Q1m8PCcN`3JG z-4R$~m2lfTeM-m=S5)JVqcul1^;(@y~=(4{^`7h1)EBc7CXSeuibK8 z`2Mc#SR+YDfn*7i3HJ%=f#()0ShlM_J}Qyef+Y&zM4Tt60jZN z^9OJLnOht6?9Xuee0XW z7?9vDOCthj(uo5r@DGeCZ7)Cq!c0fVdG2oD9&lJmu(eK|KK$EhQTl)I(%`#wy#K5&S`_qFx`Ln@$j%!9lpN#s$wBq#X)8JH$RQti#H2&>b zSP!>%@rLbrfa;dv;dr?~(mr602*8FHCaxNZUJsS^_rDBW)?HVZ70 zTr*MkHIwW?jRf4`-n!W62+ZBjzXhklEJJpTUbQi81jTaGEfRD#_=zzfC7=?qHS_6M zu(#QPNPr1qZeh_1q~%~bkd`=W2bq83R#soB-3T9y4Pd7@jW4uFnQxG#9|{XOI5>iy zpCs$g*DJ6+SsVMD-;aP&ds$EK@E%< z1Q_mDxVgiC*c(?lbVI*g7|5l)tQh$KI56>(B``&yqo>dD!%X3Kt9 \ No newline at end of file diff --git a/examples/compiled/line_narrow_year_span.vg.json b/examples/compiled/line_narrow_year_span.vg.json new file mode 100644 index 0000000000..646188b75f --- /dev/null +++ b/examples/compiled/line_narrow_year_span.vg.json @@ -0,0 +1,132 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Google's stock price between 2006-2007.", + "background": "white", + "padding": 5, + "width": 200, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "url": "data/stocks.csv", + "format": {"type": "csv", "parse": {"date": "date"}}, + "transform": [ + {"type": "filter", "expr": "datum.symbol==='GOOG'"}, + { + "type": "filter", + "expr": "inrange(time(datetime(year(datum[\"date\"]), 0, 1, 0, 0, 0, 0)), [time(datetime(2006, 0, 1, 0, 0, 0, 0)), time(datetime(2007, 0, 1, 0, 0, 0, 0))])" + }, + { + "field": "date", + "type": "timeunit", + "units": ["year"], + "as": ["year_date", "year_date_end"] + }, + { + "type": "aggregate", + "groupby": ["year_date"], + "ops": ["average"], + "fields": ["price"], + "as": ["average_price"] + } + ] + } + ], + "marks": [ + { + "name": "marks", + "type": "line", + "style": ["line"], + "sort": {"field": "datum[\"year_date\"]"}, + "from": {"data": "source_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "description": { + "signal": "\"date (year): \" + (timeFormat(datum[\"year_date\"], timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Average of price: \" + (format(datum[\"average_price\"], \"\"))" + }, + "x": {"scale": "x", "field": "year_date"}, + "y": {"scale": "y", "field": "average_price"}, + "defined": { + "signal": "isValid(datum[\"year_date\"]) && isFinite(+datum[\"year_date\"]) && isValid(datum[\"average_price\"]) && isFinite(+datum[\"average_price\"])" + } + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "time", + "domain": {"data": "source_0", "field": "year_date"}, + "range": [0, {"signal": "width"}] + }, + { + "name": "y", + "type": "linear", + "domain": {"data": "source_0", "field": "average_price"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "date (year)", + "format": { + "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" + }, + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "Average of price", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] +} diff --git a/examples/compiled/line_narrow_yearmonth_span.png b/examples/compiled/line_narrow_yearmonth_span.png new file mode 100644 index 0000000000000000000000000000000000000000..7de343c2d6400f5418ea33fab72298ce26d63557 GIT binary patch literal 18698 zcmdVCbyQaEwl{o(L6?X$2q;QONQZ!QD_u%SBOoP6qf$~LB1m^Pf=H)?BHazrjg;g& z*K_vSXP+^?@x6b)dq2g^x>sD+j9<)U&|_s8JZuVV6bgkWCo8FnLZP$3fA3;mg@1;i z{1)L~SB({9BvBX0|C4L8B2lQDC^^Z8>aOwYldrVZ_s=o54~v_Nf7HE6PDXoY{dQK@ z%<|hptf`fym0MZgL6uFkDogFl!RKX9R9Q$4Pc4}%X9_Q42i`mpTo?LtcIF#TrW60s z_u+KW(#os3c&@hYzloo@lKvLnr+bScA|i_T)MvSc3WWdZHktUrzrIjJlF-xB_gN`w z!cVe!E9EXI7Y1Qrs>x~>yDbj*Y?`TlbrP8~WpZNc~dx`=Lof~Hjzy7kM%=KigVcf?n0wJE)5 zmRc%Ur~7UIxC0 z`_WZ{8~84~9^AgHe*Kd=3iVSFcgKSE(P`AjU=}_HBJzaS?aSBOP3}9rES01+xU;wK z=>N4$Lr6v$uHur~e4FJ!(;?q$fiwPFtnc>ri_?>GQaZjq4Ak%IA7`IGxteO+Z%;=@ zjAe;^E1ju$<>LJHoAQ;emR2kR*D>)&Uz^K)VC^Rzb91fj#zWKKbSOis=RUp;=5|_R>mKRiR&7|Y1zYL2(=p~GA#&{KT{du@Zo$~T< zm(Bu}q+~(LmsE;~XtnndpRcG{yN~E}jtkwQFHn7&)}mD}J-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T>Zjh%%bq%hVi^z5QLNfe`D#Rb4^3@+kcnq+K%0v5COrAdv0f%;be@$y_ ze0?+Xj#p2l8ZJ3N77Ey{IQS66|YU*q`P!LvWN zwc`q|NtvoNetE+bH-Eo+}Ss!_5ZOsDY!Bv=M zzkeD(;Ee^hyp2r(#fPKiUWRz(JD_*Yfwuqz!WYQ9JyhgR8*|}!=)OAPadW^?elIQckBopR zgb%V3S*Y~u#+m#v@C{KfKpz1?O8Wlic#Z1KO|ik&)@{U9q&@ zo{0%XeyYr`U!%9C>z|eD4p!e3{qxtu#N6BwvtE)>~Tr}G!Qq<8QhYASjX3wC_1jNOWjhEmmqk*t# z46<8{A|ndj7d1aWZ^2CgW4l4pY4r(szyJK@i0fK?%5eLY&gW4zJv{}GyWkB0kK;Y8 zH;q2y8`4?*B@PSnsG$PAHYkXLe_a3W-cCqJI6CtJsgxt{LMO2P^JQ{uy7Mw97xrKW zgZg)ul{GylC+P9r7J%YlKPB0_?M&yxje=tb&5j!a_Fa5g8d7-pAXE@x8q&UZ+RCy%wka0rV|3H(TF~$9S`E5);WDWdBOZ))=5vd!A4EnDk_`{7*a#G5Yh2n;<{}0iWOGy9# literal 0 HcmV?d00001 diff --git a/examples/compiled/line_narrow_yearmonth_span.svg b/examples/compiled/line_narrow_yearmonth_span.svg new file mode 100644 index 0000000000..ce11da6367 --- /dev/null +++ b/examples/compiled/line_narrow_yearmonth_span.svg @@ -0,0 +1 @@ +Jan 2006Feb 2006Mar 2006Apr 2006May 2006Jun 2006date (year-month)0100200300400Average of price \ No newline at end of file diff --git a/examples/compiled/line_narrow_yearmonth_span.vg.json b/examples/compiled/line_narrow_yearmonth_span.vg.json new file mode 100644 index 0000000000..1e34084575 --- /dev/null +++ b/examples/compiled/line_narrow_yearmonth_span.vg.json @@ -0,0 +1,180 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Google's stock price first half of 2006.", + "background": "white", + "padding": 5, + "width": 500, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "url": "data/stocks.csv", + "format": {"type": "csv", "parse": {"date": "date"}}, + "transform": [ + {"type": "filter", "expr": "datum.symbol==='GOOG'"}, + { + "type": "filter", + "expr": "time(datetime(year(datum[\"date\"]), 0, 1, 0, 0, 0, 0))===time(datetime(2006, 0, 1, 0, 0, 0, 0))" + }, + { + "type": "filter", + "expr": "inrange(time(datetime(2012, month(datum[\"date\"]), 1, 0, 0, 0, 0)), [time(datetime(2012, 0, 1, 0, 0, 0, 0)), time(datetime(2012, 5, 1, 0, 0, 0, 0))])" + }, + { + "field": "date", + "type": "timeunit", + "units": ["year", "month"], + "as": ["yearmonth_date", "yearmonth_date_end"] + }, + { + "type": "aggregate", + "groupby": ["yearmonth_date"], + "ops": ["average"], + "fields": ["price"], + "as": ["average_price"] + } + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + { + "type": "filter", + "expr": "(isDate(datum[\"yearmonth_date\"]) || (isValid(datum[\"yearmonth_date\"]) && isFinite(+datum[\"yearmonth_date\"]))) && isValid(datum[\"average_price\"]) && isFinite(+datum[\"average_price\"])" + } + ] + } + ], + "marks": [ + { + "name": "layer_0_marks", + "type": "line", + "style": ["line"], + "sort": {"field": "datum[\"yearmonth_date\"]"}, + "from": {"data": "source_0"}, + "encode": { + "update": { + "tooltip": { + "signal": "{\"date (year-month)\": timeFormat(datum[\"yearmonth_date\"], timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})), \"Average of price\": format(datum[\"average_price\"], \"\")}" + }, + "stroke": {"value": "#4c78a8"}, + "description": { + "signal": "\"date (year-month): \" + (timeFormat(datum[\"yearmonth_date\"], timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Average of price: \" + (format(datum[\"average_price\"], \"\"))" + }, + "x": {"scale": "x", "field": "yearmonth_date"}, + "y": {"scale": "y", "field": "average_price"}, + "defined": { + "signal": "isValid(datum[\"yearmonth_date\"]) && isFinite(+datum[\"yearmonth_date\"]) && isValid(datum[\"average_price\"]) && isFinite(+datum[\"average_price\"])" + } + } + } + }, + { + "name": "layer_1_marks", + "type": "symbol", + "style": ["point"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "opacity": {"value": 1}, + "tooltip": { + "signal": "{\"date (year-month)\": timeFormat(datum[\"yearmonth_date\"], timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})), \"Average of price\": format(datum[\"average_price\"], \"\")}" + }, + "fill": {"value": "#4c78a8"}, + "ariaRoleDescription": {"value": "point"}, + "description": { + "signal": "\"date (year-month): \" + (timeFormat(datum[\"yearmonth_date\"], timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Average of price: \" + (format(datum[\"average_price\"], \"\"))" + }, + "x": {"scale": "x", "field": "yearmonth_date"}, + "y": {"scale": "y", "field": "average_price"} + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "time", + "domain": { + "fields": [ + {"data": "source_0", "field": "yearmonth_date"}, + {"data": "data_0", "field": "yearmonth_date"} + ] + }, + "range": [0, {"signal": "width"}] + }, + { + "name": "y", + "type": "linear", + "domain": { + "fields": [ + {"data": "source_0", "field": "average_price"}, + {"data": "data_0", "field": "average_price"} + ] + }, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "date (year-month)", + "format": { + "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" + }, + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "Average of price", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] +} diff --git a/examples/compiled/line_narrow_yearquarter_span.png b/examples/compiled/line_narrow_yearquarter_span.png new file mode 100644 index 0000000000000000000000000000000000000000..c64996ff86c8d16ef676defe656bddd26368c260 GIT binary patch literal 13232 zcmch8Wmr^e+xDV|4v~~JK&6ooDF+0lBvg@-KheCL5eg; zGjzjujXuwFyz%G#_3gct%?z{Fz3w=#GcF!!YpGIGuu&igLVfM3vMzi*gg;v-Qutdg zbv6~gkXop#DkDeuf1lUnCLjnma!vX24X@!47Zj)%8=r8O;XtF&<_->>n#s?e zMMXtXMR6%`hLX`vXJ0_0yavZJWjrWyuV+4tj;6kU|2}v8)$-cWQFH!8waKX|9&T<# zCY=VMu>uxT1PD@ZM;@pIyNf(uKm zr_P+QSe^V75f#;Zc(6A%H%GzF&i>92OL6JJ!f2i>I*QGyZJSxxw0XKS&1I~Sq(Jk{ zjmGx&NZ*BtiBK5g>mEBsM#lP{p5w^q;$rmrx_hnK$>y0AhW%Rqy~av**s8<4$hBV`&-s`LkMqNsjJiq2&2a@zbYC-n@C^MVjJ#pehTzWdSl$6x7OP(~G zoSZ&uD{E_^nVFfUMmKKU$P?~JnVg*L_9+kVZSlW&@nZfaJPWP-HgfCMExO2-{`dDN znFI}qpRc5to=f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%GgRzHZ?9{pX2-LOddoD0WIaEAAVI?$dzww+ zKxAmZ9R|D}q88L#t9!7>ModVsyFMEVy%380jA#&1kT8l!NwooODmRMYs@5!h!wFBF zl9Dot&-7~#ckPjA≪k-VCQtp9brd<$?`eP;2m6A>;Dycbl)O<~gespbX99*4HtH z`K@q7%l8J4jGNZF6h@}YgY^rH!T%%-4l;^OIHO63KnCRYT@w-l*uYYWJ2dolppTS`U&H36)Bc5yCn^%EZzQc_lCUE{lD1^aNQAOM!^*dt|)GYQ3D z!!A`oa2i#-SG5bR9KA+X-^cLNM@dC>H|m!{YgtK&CH%et{H!P+A75+#f#p8vp6gEX z5Uap47DGl`+1c0s^(#}RHE>iyywg4R<1FZ|%kYZ}AO%2N!jd;ZsVTPa69T4aaEYJ>K&SaA=*wn!5lmc~bS*Oc=9u5NhI2nNTyqJ!Z9*Z5jI`g{ z*ti1GR>hPgE4b?grZtbD@ZtNhz)WBfwIG&yaUJR{*mGl(lNca}<8alk*C{y4j+JlJyDk@ok5q@sUBI+1cb%fB^jwaC z$sdPy82t9ee|ueihZufns+Akx+k{+TH7)IwBXc;v_(F&8`hc{} zQO?K9%Y5MdJ+J9h>-A~K>Nufyq|~c0Fn6_F!5ekd`|frV;(YSAq1Orr|X0$&`Prq$q@@qn9iYx1 \ No newline at end of file diff --git a/examples/compiled/line_narrow_yearquarter_span.vg.json b/examples/compiled/line_narrow_yearquarter_span.vg.json new file mode 100644 index 0000000000..53573813aa --- /dev/null +++ b/examples/compiled/line_narrow_yearquarter_span.vg.json @@ -0,0 +1,132 @@ +{ + "$schema": "https://vega.github.io/schema/vega/v5.json", + "description": "Google's stock price between 2006-2007.", + "background": "white", + "padding": 5, + "width": 200, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "url": "data/stocks.csv", + "format": {"type": "csv", "parse": {"date": "date"}}, + "transform": [ + {"type": "filter", "expr": "datum.symbol==='GOOG'"}, + { + "type": "filter", + "expr": "time(datetime(year(datum[\"date\"]), 0, 1, 0, 0, 0, 0))===time(datetime(2006, 0, 1, 0, 0, 0, 0))" + }, + { + "field": "date", + "type": "timeunit", + "units": ["year", "quarter"], + "as": ["yearquarter_date", "yearquarter_date_end"] + }, + { + "type": "aggregate", + "groupby": ["yearquarter_date"], + "ops": ["average"], + "fields": ["price"], + "as": ["average_price"] + } + ] + } + ], + "marks": [ + { + "name": "marks", + "type": "line", + "style": ["line"], + "sort": {"field": "datum[\"yearquarter_date\"]"}, + "from": {"data": "source_0"}, + "encode": { + "update": { + "stroke": {"value": "#4c78a8"}, + "description": { + "signal": "\"date (year-quarter): \" + (timeFormat(datum[\"yearquarter_date\"], timeUnitSpecifier([\"year\",\"quarter\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"}))) + \"; Average of price: \" + (format(datum[\"average_price\"], \"\"))" + }, + "x": {"scale": "x", "field": "yearquarter_date"}, + "y": {"scale": "y", "field": "average_price"}, + "defined": { + "signal": "isValid(datum[\"yearquarter_date\"]) && isFinite(+datum[\"yearquarter_date\"]) && isValid(datum[\"average_price\"]) && isFinite(+datum[\"average_price\"])" + } + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "time", + "domain": {"data": "source_0", "field": "yearquarter_date"}, + "range": [0, {"signal": "width"}] + }, + { + "name": "y", + "type": "linear", + "domain": {"data": "source_0", "field": "average_price"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "gridScale": "y", + "grid": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 3, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "gridScale": "x", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "domain": false, + "labels": false, + "aria": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + }, + { + "scale": "x", + "orient": "bottom", + "grid": false, + "title": "date (year-quarter)", + "format": { + "signal": "timeUnitSpecifier([\"year\",\"quarter\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" + }, + "labelFlush": true, + "labelOverlap": true, + "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 3, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, + "zindex": 0 + }, + { + "scale": "y", + "orient": "left", + "grid": false, + "title": "Average of price", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 0 + } + ] +} diff --git a/examples/compiled/line_overlay.vg.json b/examples/compiled/line_overlay.vg.json index 903f0ca027..59770b2c56 100644 --- a/examples/compiled/line_overlay.vg.json +++ b/examples/compiled/line_overlay.vg.json @@ -142,6 +142,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -175,6 +178,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_overlay_stroked.vg.json b/examples/compiled/line_overlay_stroked.vg.json index 8e0a1645e6..23ea58d875 100644 --- a/examples/compiled/line_overlay_stroked.vg.json +++ b/examples/compiled/line_overlay_stroked.vg.json @@ -143,6 +143,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -176,6 +179,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/line_quarter_legend.vg.json b/examples/compiled/line_quarter_legend.vg.json index a9798f7eb2..b860056361 100644 --- a/examples/compiled/line_quarter_legend.vg.json +++ b/examples/compiled/line_quarter_legend.vg.json @@ -105,6 +105,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -138,6 +141,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/rect_heatmap_weather.vg.json b/examples/compiled/rect_heatmap_weather.vg.json index a185f5a3cd..6c00cfca80 100644 --- a/examples/compiled/rect_heatmap_weather.vg.json +++ b/examples/compiled/rect_heatmap_weather.vg.json @@ -105,6 +105,9 @@ "formatType": "time", "labelBaseline": "top", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 1 }, { @@ -117,6 +120,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 1 } ], diff --git a/examples/compiled/rect_lasagna.vg.json b/examples/compiled/rect_lasagna.vg.json index b6364132b8..95f0ff9d87 100644 --- a/examples/compiled/rect_lasagna.vg.json +++ b/examples/compiled/rect_lasagna.vg.json @@ -93,6 +93,9 @@ "labelOverlap": false, "formatType": "time", "labelBaseline": "top", + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "encode": { "labels": { "update": { diff --git a/examples/compiled/repeat_child_layer.vg.json b/examples/compiled/repeat_child_layer.vg.json index a298ac87cf..d965ab328d 100644 --- a/examples/compiled/repeat_child_layer.vg.json +++ b/examples/compiled/repeat_child_layer.vg.json @@ -202,6 +202,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { @@ -347,6 +350,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { @@ -476,6 +482,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/repeat_line_weather.vg.json b/examples/compiled/repeat_line_weather.vg.json index 2c7b64b8f9..82f13ef59f 100644 --- a/examples/compiled/repeat_line_weather.vg.json +++ b/examples/compiled/repeat_line_weather.vg.json @@ -85,6 +85,9 @@ "orient": "bottom", "gridScale": "child__temp_max_y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -117,6 +120,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { @@ -193,6 +199,9 @@ "orient": "bottom", "gridScale": "child__precipitation_y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -225,6 +234,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { @@ -295,6 +307,9 @@ "orient": "bottom", "gridScale": "child__wind_y", "grid": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -327,6 +342,9 @@ }, "labelFlush": true, "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/selection_brush_timeunit.vg.json b/examples/compiled/selection_brush_timeunit.vg.json index f18b6c35b9..3e6799ba00 100644 --- a/examples/compiled/selection_brush_timeunit.vg.json +++ b/examples/compiled/selection_brush_timeunit.vg.json @@ -369,6 +369,9 @@ "gridScale": "concat_0_y", "grid": true, "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 0, 1, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -402,6 +405,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 0, 1, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { @@ -454,6 +460,9 @@ "gridScale": "concat_1_y", "grid": true, "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 1, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -487,6 +496,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(childWidth/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 1, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/selection_layer_bar_month.vg.json b/examples/compiled/selection_layer_bar_month.vg.json index 600cd0b017..c9333dbbc1 100644 --- a/examples/compiled/selection_layer_bar_month.vg.json +++ b/examples/compiled/selection_layer_bar_month.vg.json @@ -409,6 +409,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/stacked_area.vg.json b/examples/compiled/stacked_area.vg.json index a177f5d75a..9d16b1dbcf 100644 --- a/examples/compiled/stacked_area.vg.json +++ b/examples/compiled/stacked_area.vg.json @@ -118,6 +118,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -149,6 +152,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/stacked_area_normalize.vg.json b/examples/compiled/stacked_area_normalize.vg.json index 1c85f63436..a3f8b8232c 100644 --- a/examples/compiled/stacked_area_normalize.vg.json +++ b/examples/compiled/stacked_area_normalize.vg.json @@ -115,6 +115,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -133,6 +136,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ], diff --git a/examples/compiled/stacked_area_ordinal.vg.json b/examples/compiled/stacked_area_ordinal.vg.json index 5b00edc800..d35e7e8ea8 100644 --- a/examples/compiled/stacked_area_ordinal.vg.json +++ b/examples/compiled/stacked_area_ordinal.vg.json @@ -120,6 +120,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -153,6 +156,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/stacked_area_stream.vg.json b/examples/compiled/stacked_area_stream.vg.json index d63e398e50..7181229a5a 100644 --- a/examples/compiled/stacked_area_stream.vg.json +++ b/examples/compiled/stacked_area_stream.vg.json @@ -118,6 +118,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -137,6 +140,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ], diff --git a/examples/compiled/stacked_bar_count.vg.json b/examples/compiled/stacked_bar_count.vg.json index 7687ac5e77..122e0b7c50 100644 --- a/examples/compiled/stacked_bar_count.vg.json +++ b/examples/compiled/stacked_bar_count.vg.json @@ -114,6 +114,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/stacked_bar_count_corner_radius_config.vg.json b/examples/compiled/stacked_bar_count_corner_radius_config.vg.json index bcc361cd0e..71509e63d7 100644 --- a/examples/compiled/stacked_bar_count_corner_radius_config.vg.json +++ b/examples/compiled/stacked_bar_count_corner_radius_config.vg.json @@ -162,6 +162,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/stacked_bar_count_corner_radius_mark.vg.json b/examples/compiled/stacked_bar_count_corner_radius_mark.vg.json index c5cfffe114..0c06b8c8ec 100644 --- a/examples/compiled/stacked_bar_count_corner_radius_mark.vg.json +++ b/examples/compiled/stacked_bar_count_corner_radius_mark.vg.json @@ -160,6 +160,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/stacked_bar_count_corner_radius_mark_x.vg.json b/examples/compiled/stacked_bar_count_corner_radius_mark_x.vg.json index 5ce246633a..984baf0d17 100644 --- a/examples/compiled/stacked_bar_count_corner_radius_mark_x.vg.json +++ b/examples/compiled/stacked_bar_count_corner_radius_mark_x.vg.json @@ -170,6 +170,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ], diff --git a/examples/compiled/stacked_bar_count_corner_radius_stroke.vg.json b/examples/compiled/stacked_bar_count_corner_radius_stroke.vg.json index 5dc5751083..15bd6cdf6c 100644 --- a/examples/compiled/stacked_bar_count_corner_radius_stroke.vg.json +++ b/examples/compiled/stacked_bar_count_corner_radius_stroke.vg.json @@ -164,6 +164,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/stacked_bar_size.vg.json b/examples/compiled/stacked_bar_size.vg.json index 0123944f99..7008e2f790 100644 --- a/examples/compiled/stacked_bar_size.vg.json +++ b/examples/compiled/stacked_bar_size.vg.json @@ -115,6 +115,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/stacked_bar_weather.vg.json b/examples/compiled/stacked_bar_weather.vg.json index 5eb9d436b0..14721fff3b 100644 --- a/examples/compiled/stacked_bar_weather.vg.json +++ b/examples/compiled/stacked_bar_weather.vg.json @@ -114,6 +114,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/time_custom_step.vg.json b/examples/compiled/time_custom_step.vg.json index 93b118f25a..2298dc5443 100644 --- a/examples/compiled/time_custom_step.vg.json +++ b/examples/compiled/time_custom_step.vg.json @@ -101,6 +101,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 5, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -134,6 +137,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 5, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/time_output_utc_scale.vg.json b/examples/compiled/time_output_utc_scale.vg.json index e7045e7c2a..a2450c89a2 100644 --- a/examples/compiled/time_output_utc_scale.vg.json +++ b/examples/compiled/time_output_utc_scale.vg.json @@ -79,6 +79,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 1, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -115,6 +118,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 1, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/time_output_utc_timeunit.vg.json b/examples/compiled/time_output_utc_timeunit.vg.json index 593c960502..5bbfe8c82b 100644 --- a/examples/compiled/time_output_utc_timeunit.vg.json +++ b/examples/compiled/time_output_utc_timeunit.vg.json @@ -83,6 +83,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 1, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -119,6 +122,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 1, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/time_parse_local.vg.json b/examples/compiled/time_parse_local.vg.json index 639620ae10..83690debb1 100644 --- a/examples/compiled/time_parse_local.vg.json +++ b/examples/compiled/time_parse_local.vg.json @@ -75,6 +75,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 1, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ] diff --git a/examples/compiled/time_parse_utc.vg.json b/examples/compiled/time_parse_utc.vg.json index 3971c5a8f4..244ed944cd 100644 --- a/examples/compiled/time_parse_utc.vg.json +++ b/examples/compiled/time_parse_utc.vg.json @@ -73,6 +73,9 @@ }, "formatType": "utc", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 1, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ] diff --git a/examples/compiled/time_parse_utc_format.vg.json b/examples/compiled/time_parse_utc_format.vg.json index 3d4dd1b6c0..df4379d2f8 100644 --- a/examples/compiled/time_parse_utc_format.vg.json +++ b/examples/compiled/time_parse_utc_format.vg.json @@ -79,6 +79,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 0, 1, 0, 1, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ] diff --git a/examples/compiled/trellis_area_seattle.vg.json b/examples/compiled/trellis_area_seattle.vg.json index 95353fa85c..2591cd8017 100644 --- a/examples/compiled/trellis_area_seattle.vg.json +++ b/examples/compiled/trellis_area_seattle.vg.json @@ -120,6 +120,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(child_width/40)"}, + "tickMinStep": { + "signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ] diff --git a/examples/compiled/trellis_column_year.vg.json b/examples/compiled/trellis_column_year.vg.json index 7f9ad73158..335a8d1d2b 100644 --- a/examples/compiled/trellis_column_year.vg.json +++ b/examples/compiled/trellis_column_year.vg.json @@ -109,6 +109,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 3, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ] diff --git a/examples/compiled/trellis_line_quarter.vg.json b/examples/compiled/trellis_line_quarter.vg.json index 674938706a..ff4c8da8da 100644 --- a/examples/compiled/trellis_line_quarter.vg.json +++ b/examples/compiled/trellis_line_quarter.vg.json @@ -113,6 +113,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 3, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 } ] diff --git a/examples/compiled/vconcat_weather.vg.json b/examples/compiled/vconcat_weather.vg.json index b815a04198..3db6ba2d6b 100644 --- a/examples/compiled/vconcat_weather.vg.json +++ b/examples/compiled/vconcat_weather.vg.json @@ -149,6 +149,9 @@ }, "formatType": "time", "labelOverlap": true, + "tickMinStep": { + "signal": "datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/compiled/wheat_wages.vg.json b/examples/compiled/wheat_wages.vg.json index 332b33349b..00affe167f 100644 --- a/examples/compiled/wheat_wages.vg.json +++ b/examples/compiled/wheat_wages.vg.json @@ -307,6 +307,7 @@ "tickCount": 5, "labelFlush": true, "labelOverlap": true, + "tickMinStep": 1, "zindex": 0 }, { diff --git a/examples/compiled/window_cumulative_running_average.vg.json b/examples/compiled/window_cumulative_running_average.vg.json index 07decb5b23..2db4ec3178 100644 --- a/examples/compiled/window_cumulative_running_average.vg.json +++ b/examples/compiled/window_cumulative_running_average.vg.json @@ -122,6 +122,9 @@ "gridScale": "y", "grid": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "domain": false, "labels": false, "aria": false, @@ -155,6 +158,9 @@ "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, + "tickMinStep": { + "signal": "datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" + }, "zindex": 0 }, { diff --git a/examples/specs/bar_narrow_int_span.vl.json b/examples/specs/bar_narrow_int_span.vl.json new file mode 100644 index 0000000000..1378fe525d --- /dev/null +++ b/examples/specs/bar_narrow_int_span.vl.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "A simple bar chart with integer axis.", + "data": { + "values": [ + {"a": 0, "b": 28}, + {"a": 1, "b": 38}, + {"a": 2, "b": 35} + ] + }, + "mark": "bar", + "encoding": { + "x": { + "field": "a", + "type": "quantitative", + "axis": {"format": "d"} + }, + "y": {"field": "b", "type": "quantitative"} + } +} diff --git a/examples/specs/line_narrow_2year_span.vl.json b/examples/specs/line_narrow_2year_span.vl.json new file mode 100644 index 0000000000..59ff1c11ef --- /dev/null +++ b/examples/specs/line_narrow_2year_span.vl.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Google's stock price from 2006 to 2008.", + "data": {"url": "data/stocks.csv"}, + "transform": [ + {"filter": "datum.symbol==='GOOG'"}, + {"filter": {"field": "date", "timeUnit": "year", "range": [2006, 2008]}} + + ], + "mark": "line", + "encoding": { + "x": {"field": "date", "timeUnit": {"unit": "year", "step": 2}, "type": "temporal"}, + "y": {"aggregate": "average", "field": "price", "type": "quantitative"} + } +} diff --git a/examples/specs/line_narrow_year_span.vl.json b/examples/specs/line_narrow_year_span.vl.json new file mode 100644 index 0000000000..1d89ed66fc --- /dev/null +++ b/examples/specs/line_narrow_year_span.vl.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Google's stock price between 2006-2007.", + "data": {"url": "data/stocks.csv"}, + "transform": [ + {"filter": "datum.symbol==='GOOG'"}, + {"filter": {"field": "date", "timeUnit": "year", "range": [2006, 2007]}} + + ], + "mark": "line", + "encoding": { + "x": {"field": "date", "timeUnit": "year", "type": "temporal"}, + "y": {"aggregate": "average", "field": "price", "type": "quantitative"} + } +} diff --git a/examples/specs/line_narrow_yearmonth_span.vl.json b/examples/specs/line_narrow_yearmonth_span.vl.json new file mode 100644 index 0000000000..7b7b7813ac --- /dev/null +++ b/examples/specs/line_narrow_yearmonth_span.vl.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Google's stock price first half of 2006.", + "data": {"url": "data/stocks.csv"}, + "transform": [ + {"filter": "datum.symbol==='GOOG'"}, + {"filter": {"field": "date", "timeUnit": "year", "equal": 2006}}, + {"filter": {"field": "date", "timeUnit": "month", "range": [1,6]}} + ], + "width": 500, + "mark": {"type": "line", "tooltip": true, "point": true}, + "encoding": { + "x": {"field": "date", "timeUnit": "yearmonth", "type": "temporal"}, + "y": {"aggregate": "average", "field": "price", "type": "quantitative"} + } +} diff --git a/examples/specs/line_narrow_yearquarter_span.vl.json b/examples/specs/line_narrow_yearquarter_span.vl.json new file mode 100644 index 0000000000..3d12243a93 --- /dev/null +++ b/examples/specs/line_narrow_yearquarter_span.vl.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Google's stock price between 2006-2007.", + "data": {"url": "data/stocks.csv"}, + "transform": [ + {"filter": "datum.symbol==='GOOG'"}, + {"filter": {"field": "date", "timeUnit": "year", "equal": 2006}} + + ], + "mark": "line", + "encoding": { + "x": {"field": "date", "timeUnit": "yearquarter", "type": "temporal"}, + "y": {"aggregate": "average", "field": "price", "type": "quantitative"} + } +} diff --git a/examples/specs/normalized/line_narrow_yearmonth_span_normalized.vl.json b/examples/specs/normalized/line_narrow_yearmonth_span_normalized.vl.json new file mode 100644 index 0000000000..1f3075d832 --- /dev/null +++ b/examples/specs/normalized/line_narrow_yearmonth_span_normalized.vl.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Google's stock price first half of 2006.", + "data": {"url": "data/stocks.csv"}, + "width": 500, + "transform": [ + {"filter": "datum.symbol==='GOOG'"}, + {"filter": {"field": "date", "timeUnit": "year", "equal": 2006}}, + {"filter": {"field": "date", "timeUnit": "month", "range": [1, 6]}} + ], + "layer": [ + { + "mark": {"type": "line", "tooltip": true}, + "encoding": { + "x": { + "field": "date", + "timeUnit": {"unit": "yearmonth"}, + "type": "temporal" + }, + "y": {"aggregate": "average", "field": "price", "type": "quantitative"} + } + }, + { + "mark": {"type": "point", "opacity": 1, "filled": true, "tooltip": true}, + "encoding": { + "x": { + "field": "date", + "timeUnit": {"unit": "yearmonth"}, + "type": "temporal" + }, + "y": {"aggregate": "average", "field": "price", "type": "quantitative"} + } + } + ] +} \ No newline at end of file diff --git a/src/compile/axis/parse.ts b/src/compile/axis/parse.ts index d61bb38732..ad3b9e197a 100644 --- a/src/compile/axis/parse.ts +++ b/src/compile/axis/parse.ts @@ -14,6 +14,7 @@ import {AxisComponent, AxisComponentIndex, AxisComponentProps, AXIS_COMPONENT_PR import {getAxisConfig, getAxisConfigs} from './config'; import * as encode from './encode'; import {AxisRuleParams, axisRules, defaultOrient, getFieldDefTitle, getLabelAngle} from './properties'; +import {guideFormat, guideFormatType} from '../format'; export function parseUnitAxes(model: UnitModel): AxisComponentIndex { return POSITION_SCALE_CHANNELS.reduce((axis, channel) => { @@ -247,6 +248,8 @@ function parseAxis(channel: PositionScaleChannel, model: UnitModel): AxisCompone axis = axis || {}; const labelAngle = getLabelAngle(fieldOrDatumDef, axis, channel, config.style, axisConfigs); + const formatType = guideFormatType(axis.formatType, fieldOrDatumDef, scaleType); + const format = guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, axis.format, axis.formatType, config, true); const ruleParams: AxisRuleParams = { fieldOrDatumDef, @@ -256,6 +259,8 @@ function parseAxis(channel: PositionScaleChannel, model: UnitModel): AxisCompone scaleType, orient, labelAngle, + format, + formatType, mark, config }; diff --git a/src/compile/axis/properties.ts b/src/compile/axis/properties.ts index f710c6e068..4fe2f5df00 100644 --- a/src/compile/axis/properties.ts +++ b/src/compile/axis/properties.ts @@ -17,16 +17,17 @@ import {Config, StyleConfigIndex} from '../../config'; import {Mark} from '../../mark'; import {hasDiscreteDomain} from '../../scale'; import {Sort} from '../../sort'; -import {normalizeTimeUnit} from '../../timeunit'; +import {getSmallestTimeUnitPart, normalizeTimeUnit} from '../../timeunit'; import {NOMINAL, ORDINAL, Type} from '../../type'; import {contains, normalizeAngle} from '../../util'; import {isSignalRef} from '../../vega.schema'; import {mergeTitle, mergeTitleFieldDefs} from '../common'; -import {guideFormat, guideFormatType} from '../format'; +import {guideFormatType} from '../format'; import {UnitModel} from '../unit'; import {ScaleType} from './../../scale'; import {AxisComponentProps} from './component'; import {AxisConfigs, getAxisConfig} from './config'; +import {DateTime, dateTimeToExpr} from '../../datetime'; export interface AxisRuleParams { fieldOrDatumDef: PositionFieldDef | PositionDatumDef; @@ -38,6 +39,8 @@ export interface AxisRuleParams { scaleType: ScaleType; orient: Orient | SignalRef; labelAngle: number | SignalRef; + format: string | SignalRef; + formatType: ReturnType; config: Config; } @@ -46,15 +49,9 @@ export const axisRules: { } = { scale: ({model, channel}) => model.scaleName(channel), - format: ({fieldOrDatumDef, config, axis}) => { - const {format, formatType} = axis; - return guideFormat(fieldOrDatumDef, fieldOrDatumDef.type, format, formatType, config, true); - }, + format: ({format}) => format, // we already calculate this in parse - formatType: ({axis, fieldOrDatumDef, scaleType}) => { - const {formatType} = axis; - return guideFormatType(formatType, fieldOrDatumDef, scaleType); - }, + formatType: ({formatType}) => formatType, // we already calculate this in parse grid: ({fieldOrDatumDef, axis, scaleType}) => axis.grid ?? defaultGrid(scaleType, fieldOrDatumDef), @@ -88,6 +85,8 @@ export const axisRules: { return axis.tickCount ?? defaultTickCount({fieldOrDatumDef, scaleType, size, values: axis.values}); }, + tickMinStep: defaultTickMinStep, + title: ({axis, model, channel}) => { if (axis.title !== undefined) { return axis.title; @@ -315,6 +314,44 @@ export function defaultTickCount({ return undefined; } +export function defaultTickMinStep({format, fieldOrDatumDef}: Pick) { + if (format === 'd') { + return 1; + } + + if (isFieldDef(fieldOrDatumDef)) { + const {timeUnit} = fieldOrDatumDef; + if (timeUnit) { + const normalizedTimeUnit = normalizeTimeUnit(timeUnit); + const smallestUnitPart = getSmallestTimeUnitPart(normalizedTimeUnit.unit); + if (smallestUnitPart && smallestUnitPart !== 'day') { + const startDate: DateTime = { + year: 2001, // pick a non-leap year + month: 1, + date: 1, + hours: 0, + minutes: 0, + seconds: 0, + milliseconds: 0 + }; + const step = normalizedTimeUnit.step || 1; + const endDate: DateTime = { + ...startDate, + ...(smallestUnitPart === 'quarter' + ? {month: +startDate.month + step * 3} + : {[smallestUnitPart]: +startDate[smallestUnitPart] + step}) + }; + + // Calculate timestamp duration for the smallest unit listed + return { + signal: `${dateTimeToExpr(endDate)} - ${dateTimeToExpr(startDate)}` + }; + } + } + } + return undefined; +} + export function getFieldDefTitle(model: UnitModel, channel: 'x' | 'y') { const channel2 = channel === 'x' ? 'x2' : 'y2'; const fieldDef = model.fieldDef(channel); diff --git a/src/compile/format.ts b/src/compile/format.ts index aa5d76b1e6..5d6f34734e 100644 --- a/src/compile/format.ts +++ b/src/compile/format.ts @@ -177,11 +177,11 @@ export function guideFormat( fieldOrDatumDef: FieldDef | DatumDef, type: Type, format: string | Dict, - formatType: string, + formatType: string | SignalRef, config: Config, omitTimeFormatConfig: boolean // axis doesn't use config.timeFormat ) { - if (isCustomFormatType(formatType)) { + if (isString(formatType) && isCustomFormatType(formatType)) { return undefined; // handled in encode block } else if (format === undefined && formatType === undefined && config.customFormatTypes) { if (channelDefType(fieldOrDatumDef) === 'quantitative') { diff --git a/src/timeunit.ts b/src/timeunit.ts index 36a8d055ec..ba2ceeede6 100644 --- a/src/timeunit.ts +++ b/src/timeunit.ts @@ -197,6 +197,11 @@ export function getTimeUnitParts(timeUnit: TimeUnit): LocalSingleTimeUnit[] { return TIMEUNIT_PARTS.filter(part => containsTimeUnit(timeUnit, part)); } +export function getSmallestTimeUnitPart(timeUnit: TimeUnit): LocalSingleTimeUnit { + const parts = getTimeUnitParts(timeUnit); + return parts[parts.length - 1]; +} + /** Returns true if fullTimeUnit contains the timeUnit, false otherwise. */ export function containsTimeUnit(fullTimeUnit: TimeUnit, timeUnit: TimeUnit) { const index = fullTimeUnit.indexOf(timeUnit); diff --git a/test/compile/axis/properties.test.ts b/test/compile/axis/properties.test.ts index 92d5470b5e..baec56e46a 100644 --- a/test/compile/axis/properties.test.ts +++ b/test/compile/axis/properties.test.ts @@ -4,7 +4,7 @@ import {stringValue} from 'vega-util'; import {getAxisConfigs} from '../../../src/compile/axis/config'; import * as properties from '../../../src/compile/axis/properties'; import {defaultLabelAlign, defaultLabelBaseline, getLabelAngle} from '../../../src/compile/axis/properties'; -import {TimeUnit} from '../../../src/timeunit'; +import {TimeUnit, TimeUnitParams} from '../../../src/timeunit'; import {normalizeAngle} from '../../../src/util'; import {isSignalRef} from '../../../src/vega.schema'; import {range} from '../../util'; @@ -106,6 +106,54 @@ describe('compile/axis/properties', () => { expect(tickCount).toBeUndefined(); }); }); + describe('defaultTickMinStep()', () => { + it('should return 1 for integer', () => { + const tickMinStep = properties.defaultTickMinStep({ + fieldOrDatumDef: {field: 'a', type: 'quantitative'}, + format: 'd' + }); + expect(tickMinStep).toBe(1); + }); + + const TIMEUNIT_CASES: {timeUnit: TimeUnit | TimeUnitParams; signal: string}[] = [ + { + timeUnit: 'year', + signal: 'datetime(2002, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)' + }, + { + timeUnit: {unit: 'year', step: 2}, + signal: 'datetime(2003, 0, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)' + }, + { + timeUnit: 'yearmonth', + signal: 'datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)' + }, + { + timeUnit: {unit: 'yearmonth', step: 4}, + signal: 'datetime(2001, 4, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)' + }, + { + timeUnit: 'month', + signal: 'datetime(2001, 1, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)' + }, + { + timeUnit: 'yearquarter', + signal: 'datetime(2001, 3, 1, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)' + }, + { + timeUnit: 'yearmonthdate', + signal: 'datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)' + } + ]; + + it.each(TIMEUNIT_CASES)('should return timestamp duration for $timeUnit', ({timeUnit, signal}) => { + const tickMinStep = properties.defaultTickMinStep({ + fieldOrDatumDef: {timeUnit, field: 'a', type: 'temporal'}, + format: undefined + }); + expect(tickMinStep).toEqual({signal}); + }); + }); describe('values', () => { it('should return correct timestamp values for DateTimes', () => {