diff --git a/examples/compiled/area_vertical.svg b/examples/compiled/area_vertical.svg index d39b750451..c9e56ede6b 100644 --- a/examples/compiled/area_vertical.svg +++ b/examples/compiled/area_vertical.svg @@ -1 +1 @@ -050,000100,000150,000Sum of Weight_in_lbs197019721974197619781980Year (year) \ No newline at end of file +050,000100,000150,000Sum of Weight_in_lbs197019721974197619781980Year (year) \ No newline at end of file diff --git a/examples/compiled/area_vertical.vg.json b/examples/compiled/area_vertical.vg.json index c9009c436e..2e1bceb6f2 100644 --- a/examples/compiled/area_vertical.vg.json +++ b/examples/compiled/area_vertical.vg.json @@ -116,9 +116,7 @@ "orient": "left", "grid": false, "title": "Year (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelOverlap": true, "tickCount": {"signal": "ceil(height/40)"}, "tickMinStep": { diff --git a/examples/compiled/bar_binned_yearmonth_grouped.png b/examples/compiled/bar_binned_yearmonth_grouped.png index fac7dd92ab..db5bfdd3d0 100644 Binary files a/examples/compiled/bar_binned_yearmonth_grouped.png and b/examples/compiled/bar_binned_yearmonth_grouped.png differ diff --git a/examples/compiled/bar_binned_yearmonth_grouped.svg b/examples/compiled/bar_binned_yearmonth_grouped.svg index 0d88d3b01a..be29775e4b 100644 --- a/examples/compiled/bar_binned_yearmonth_grouped.svg +++ b/examples/compiled/bar_binned_yearmonth_grouped.svg @@ -1 +1 @@ -Jan 2005Feb 2005Mar 2005Apr 2005date050100150200priceAAPLAMZNGOOGIBMMSFTsymbol \ No newline at end of file +2005FebruaryMarchAprildate050100150200priceAAPLAMZNGOOGIBMMSFTsymbol \ No newline at end of file diff --git a/examples/compiled/bar_binned_yearmonth_grouped.vg.json b/examples/compiled/bar_binned_yearmonth_grouped.vg.json index 4d0ef4b7d4..fd2a5bcf79 100644 --- a/examples/compiled/bar_binned_yearmonth_grouped.vg.json +++ b/examples/compiled/bar_binned_yearmonth_grouped.vg.json @@ -133,9 +133,7 @@ "orient": "bottom", "grid": false, "title": "date", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/bar_binned_yearmonth_grouped_center_band.png b/examples/compiled/bar_binned_yearmonth_grouped_center_band.png index b99bb81be1..6e0350ba36 100644 Binary files a/examples/compiled/bar_binned_yearmonth_grouped_center_band.png and b/examples/compiled/bar_binned_yearmonth_grouped_center_band.png differ diff --git a/examples/compiled/bar_binned_yearmonth_grouped_center_band.svg b/examples/compiled/bar_binned_yearmonth_grouped_center_band.svg index 1d3814b562..9a0bb2c7cc 100644 --- a/examples/compiled/bar_binned_yearmonth_grouped_center_band.svg +++ b/examples/compiled/bar_binned_yearmonth_grouped_center_band.svg @@ -1 +1 @@ -Jan 2005Feb 2005Mar 2005date050100150200priceAAPLAMZNGOOGIBMMSFTsymbol \ No newline at end of file +2005FebruaryMarchdate050100150200priceAAPLAMZNGOOGIBMMSFTsymbol \ No newline at end of file diff --git a/examples/compiled/bar_binned_yearmonth_grouped_center_band.vg.json b/examples/compiled/bar_binned_yearmonth_grouped_center_band.vg.json index addd923f0b..109d05e602 100644 --- a/examples/compiled/bar_binned_yearmonth_grouped_center_band.vg.json +++ b/examples/compiled/bar_binned_yearmonth_grouped_center_band.vg.json @@ -146,9 +146,7 @@ "orient": "bottom", "grid": false, "title": "date", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/bar_binned_yearmonth_label.png b/examples/compiled/bar_binned_yearmonth_label.png index e66d06af4d..e5624c97e3 100644 Binary files a/examples/compiled/bar_binned_yearmonth_label.png and b/examples/compiled/bar_binned_yearmonth_label.png differ diff --git a/examples/compiled/bar_binned_yearmonth_label.svg b/examples/compiled/bar_binned_yearmonth_label.svg index a64a79e85d..36f7717d8c 100644 --- a/examples/compiled/bar_binned_yearmonth_label.svg +++ b/examples/compiled/bar_binned_yearmonth_label.svg @@ -1 +1 @@ -Jan 2005Feb 2005Mar 2005Apr 2005date050100150200price195.62187.99180.51 \ No newline at end of file +2005FebruaryMarchAprildate050100150200price195.62187.99180.51 \ No newline at end of file diff --git a/examples/compiled/bar_binned_yearmonth_label.vg.json b/examples/compiled/bar_binned_yearmonth_label.vg.json index 5b9b9bcb5e..02feb2015d 100644 --- a/examples/compiled/bar_binned_yearmonth_label.vg.json +++ b/examples/compiled/bar_binned_yearmonth_label.vg.json @@ -173,9 +173,7 @@ "orient": "bottom", "grid": false, "title": "date", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/bar_binned_yearmonth_label_band_center.png b/examples/compiled/bar_binned_yearmonth_label_band_center.png index 554ae02bdc..f83fd2bd2b 100644 Binary files a/examples/compiled/bar_binned_yearmonth_label_band_center.png and b/examples/compiled/bar_binned_yearmonth_label_band_center.png differ diff --git a/examples/compiled/bar_binned_yearmonth_label_band_center.svg b/examples/compiled/bar_binned_yearmonth_label_band_center.svg index 010afea05f..0dd459722c 100644 --- a/examples/compiled/bar_binned_yearmonth_label_band_center.svg +++ b/examples/compiled/bar_binned_yearmonth_label_band_center.svg @@ -1 +1 @@ -Jan 2005Feb 2005Mar 2005date050100150200price195.62187.99180.51 \ No newline at end of file +2005FebruaryMarchdate050100150200price195.62187.99180.51 \ No newline at end of file diff --git a/examples/compiled/bar_binned_yearmonth_label_band_center.vg.json b/examples/compiled/bar_binned_yearmonth_label_band_center.vg.json index 91204d2334..6d13ebc362 100644 --- a/examples/compiled/bar_binned_yearmonth_label_band_center.vg.json +++ b/examples/compiled/bar_binned_yearmonth_label_band_center.vg.json @@ -181,9 +181,7 @@ "orient": "bottom", "grid": false, "title": "date", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/bar_binnedyearmonth.png b/examples/compiled/bar_binnedyearmonth.png index a3ea41d46e..f1ff878abf 100644 Binary files a/examples/compiled/bar_binnedyearmonth.png and b/examples/compiled/bar_binnedyearmonth.png differ diff --git a/examples/compiled/bar_binnedyearmonth.svg b/examples/compiled/bar_binnedyearmonth.svg index 371924fe1a..50ea3559c7 100644 --- a/examples/compiled/bar_binnedyearmonth.svg +++ b/examples/compiled/bar_binnedyearmonth.svg @@ -1 +1 @@ -Jan 2005Jan 2006Jan 2007Jan 2008Jan 2009Jan 2010date0200400600800price \ No newline at end of file +200520062007200820092010date0200400600800price \ No newline at end of file diff --git a/examples/compiled/bar_binnedyearmonth.vg.json b/examples/compiled/bar_binnedyearmonth.vg.json index d4f5d85d57..30c2386d53 100644 --- a/examples/compiled/bar_binnedyearmonth.vg.json +++ b/examples/compiled/bar_binnedyearmonth.vg.json @@ -119,9 +119,7 @@ "orient": "bottom", "grid": false, "title": "date", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/bar_group_timeunit.svg b/examples/compiled/bar_group_timeunit.svg index 59619b4008..e3ea6a4df7 100644 --- a/examples/compiled/bar_group_timeunit.svg +++ b/examples/compiled/bar_group_timeunit.svg @@ -1 +1 @@ -19691970197119721973197419751976197719781979198019811982Year (year)05101520253035Number of CarsEuropeJapanUSAOrigin \ No newline at end of file +19691970197119721973197419751976197719781979198019811982Year (year)05101520253035Number of CarsEuropeJapanUSAOrigin \ No newline at end of file diff --git a/examples/compiled/bar_group_timeunit.vg.json b/examples/compiled/bar_group_timeunit.vg.json index 41207af3b0..6c6d0df44e 100644 --- a/examples/compiled/bar_group_timeunit.vg.json +++ b/examples/compiled/bar_group_timeunit.vg.json @@ -128,9 +128,7 @@ "orient": "bottom", "grid": false, "title": "Year (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/bar_simple_binned_timeunit_special_chars.png b/examples/compiled/bar_simple_binned_timeunit_special_chars.png index c434c09031..dc6acbb240 100644 Binary files a/examples/compiled/bar_simple_binned_timeunit_special_chars.png and b/examples/compiled/bar_simple_binned_timeunit_special_chars.png differ diff --git a/examples/compiled/bar_simple_binned_timeunit_special_chars.svg b/examples/compiled/bar_simple_binned_timeunit_special_chars.svg index 822168923d..6d2fe4a7e5 100644 --- a/examples/compiled/bar_simple_binned_timeunit_special_chars.svg +++ b/examples/compiled/bar_simple_binned_timeunit_special_chars.svg @@ -1 +1 @@ -020406080100bJan 02, 2022Jan 04, 2022Jan 06, 2022Jan 08, 2022Jan 10, 2022a.bA Simple Bar Chart with Lines at Extents \ No newline at end of file +020406080100bJan 02Tue 04Thu 06Sat 08Mon 10a.bA Simple Bar Chart with Lines at Extents \ No newline at end of file diff --git a/examples/compiled/bar_simple_binned_timeunit_special_chars.vg.json b/examples/compiled/bar_simple_binned_timeunit_special_chars.vg.json index 2fb873170f..37e13d0569 100644 --- a/examples/compiled/bar_simple_binned_timeunit_special_chars.vg.json +++ b/examples/compiled/bar_simple_binned_timeunit_special_chars.vg.json @@ -145,9 +145,7 @@ "orient": "left", "grid": false, "title": "a.b", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\",\"date\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelOverlap": true, "tickCount": {"signal": "ceil(height/40)"}, "tickMinStep": { diff --git a/examples/compiled/bar_yearmonth.png b/examples/compiled/bar_yearmonth.png index cd7ca0813d..d9e5d0b10e 100644 Binary files a/examples/compiled/bar_yearmonth.png and b/examples/compiled/bar_yearmonth.png differ diff --git a/examples/compiled/bar_yearmonth.svg b/examples/compiled/bar_yearmonth.svg index 01afff80b1..1e9b82dcc9 100644 --- a/examples/compiled/bar_yearmonth.svg +++ b/examples/compiled/bar_yearmonth.svg @@ -1 +1 @@ -Jan 2012Jan 2013Jan 2014Jan 2015Jan 2016date (year-month)051015202530Mean of temp_max \ No newline at end of file +20122013201420152016date (year-month)051015202530Mean of temp_max \ No newline at end of file diff --git a/examples/compiled/bar_yearmonth.vg.json b/examples/compiled/bar_yearmonth.vg.json index 3427f5e5de..46cf29ecec 100644 --- a/examples/compiled/bar_yearmonth.vg.json +++ b/examples/compiled/bar_yearmonth.vg.json @@ -121,9 +121,7 @@ "orient": "bottom", "grid": false, "title": "date (year-month)", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/bar_yearmonth_center_band.png b/examples/compiled/bar_yearmonth_center_band.png index e73ae6b156..56fd440467 100644 Binary files a/examples/compiled/bar_yearmonth_center_band.png and b/examples/compiled/bar_yearmonth_center_band.png differ diff --git a/examples/compiled/bar_yearmonth_center_band.svg b/examples/compiled/bar_yearmonth_center_band.svg index 4e3fa4a8cc..872361ecd4 100644 --- a/examples/compiled/bar_yearmonth_center_band.svg +++ b/examples/compiled/bar_yearmonth_center_band.svg @@ -1 +1 @@ -Jan 2012Jan 2013Jan 2014Jan 2015date (year-month)051015202530Mean of temp_max \ No newline at end of file +2012201320142015date (year-month)051015202530Mean of temp_max \ No newline at end of file diff --git a/examples/compiled/bar_yearmonth_center_band.vg.json b/examples/compiled/bar_yearmonth_center_band.vg.json index 4886b6c607..24318c56f2 100644 --- a/examples/compiled/bar_yearmonth_center_band.vg.json +++ b/examples/compiled/bar_yearmonth_center_band.vg.json @@ -139,9 +139,7 @@ "orient": "bottom", "grid": false, "title": "date (year-month)", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/bar_yearmonthdate_minBandSize.png b/examples/compiled/bar_yearmonthdate_minBandSize.png index bf74654735..a13762f1f7 100644 Binary files a/examples/compiled/bar_yearmonthdate_minBandSize.png and b/examples/compiled/bar_yearmonthdate_minBandSize.png differ diff --git a/examples/compiled/bar_yearmonthdate_minBandSize.svg b/examples/compiled/bar_yearmonthdate_minBandSize.svg index 7a68bb0727..2f5d06b998 100644 --- a/examples/compiled/bar_yearmonthdate_minBandSize.svg +++ b/examples/compiled/bar_yearmonthdate_minBandSize.svg @@ -1 +1 @@ -Jan 01, 2012Apr 01, 2012Jul 01, 2012Oct 01, 2012Jan 01, 2013Apr 01, 2013Jul 01, 2013Oct 01, 2013Jan 01, 2014Apr 01, 2014Jul 01, 2014Oct 01, 2014Jan 01, 2015Apr 01, 2015Jul 01, 2015Oct 01, 2015date (year-month-date)010203040Mean of temp_max \ No newline at end of file +2012AprilJulyOctober2013AprilJulyOctober2014AprilJulyOctober2015AprilJulyOctoberdate (year-month-date)010203040Mean of temp_max \ No newline at end of file diff --git a/examples/compiled/bar_yearmonthdate_minBandSize.vg.json b/examples/compiled/bar_yearmonthdate_minBandSize.vg.json index bcf02a3741..538d7aadce 100644 --- a/examples/compiled/bar_yearmonthdate_minBandSize.vg.json +++ b/examples/compiled/bar_yearmonthdate_minBandSize.vg.json @@ -120,9 +120,7 @@ "orient": "bottom", "grid": false, "title": "date (year-month-date)", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\",\"date\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/interactive_area_brush.png b/examples/compiled/interactive_area_brush.png index cf19fb2115..0433fb097c 100644 Binary files a/examples/compiled/interactive_area_brush.png and b/examples/compiled/interactive_area_brush.png differ diff --git a/examples/compiled/interactive_area_brush.svg b/examples/compiled/interactive_area_brush.svg index 77e3ae949c..56108241e4 100644 --- a/examples/compiled/interactive_area_brush.svg +++ b/examples/compiled/interactive_area_brush.svg @@ -1 +1 @@ -Jan 2000Jan 2002Jan 2004Jan 2006Jan 2008Jan 2010date (year-month)05,00010,00015,000Sum of count \ No newline at end of file +200020022004200620082010date (year-month)05,00010,00015,000Sum of count \ No newline at end of file diff --git a/examples/compiled/interactive_area_brush.vg.json b/examples/compiled/interactive_area_brush.vg.json index 907f4329c6..a6ccf24f87 100644 --- a/examples/compiled/interactive_area_brush.vg.json +++ b/examples/compiled/interactive_area_brush.vg.json @@ -422,9 +422,7 @@ "orient": "bottom", "grid": false, "title": "date (year-month)", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/interactive_multi_line_tooltip.png b/examples/compiled/interactive_multi_line_tooltip.png index f28400219e..25417904f9 100644 Binary files a/examples/compiled/interactive_multi_line_tooltip.png and b/examples/compiled/interactive_multi_line_tooltip.png differ diff --git a/examples/compiled/interactive_multi_line_tooltip.svg b/examples/compiled/interactive_multi_line_tooltip.svg index 47666ed31d..b4e13b276d 100644 --- a/examples/compiled/interactive_multi_line_tooltip.svg +++ b/examples/compiled/interactive_multi_line_tooltip.svg @@ -1 +1 @@ -Jan 01, 2012Jan 01, 2013Jan 01, 2014Jan 01, 2015date (year-month-date)−10010203040temp_max, temp_min \ No newline at end of file +2012201320142015date (year-month-date)−10010203040temp_max, temp_min \ No newline at end of file diff --git a/examples/compiled/interactive_multi_line_tooltip.vg.json b/examples/compiled/interactive_multi_line_tooltip.vg.json index 9b6c48a41e..abf1487b10 100644 --- a/examples/compiled/interactive_multi_line_tooltip.vg.json +++ b/examples/compiled/interactive_multi_line_tooltip.vg.json @@ -214,9 +214,7 @@ "orient": "bottom", "grid": false, "title": "date (year-month-date)", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\",\"date\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/layer_falkensee.svg b/examples/compiled/layer_falkensee.svg index e03f96370e..36386a7d89 100644 --- a/examples/compiled/layer_falkensee.svg +++ b/examples/compiled/layer_falkensee.svg @@ -1 +1 @@ -18801890190019101920193019401950196019701980199020002010year (year)010,00020,00030,00040,000populationGDR (East Germany)Nazi Ruleevent \ No newline at end of file +18801890190019101920193019401950196019701980199020002010year (year)010,00020,00030,00040,000populationGDR (East Germany)Nazi Ruleevent \ No newline at end of file diff --git a/examples/compiled/layer_falkensee.vg.json b/examples/compiled/layer_falkensee.vg.json index c37431810b..bfa81b1308 100644 --- a/examples/compiled/layer_falkensee.vg.json +++ b/examples/compiled/layer_falkensee.vg.json @@ -247,9 +247,7 @@ "orient": "bottom", "grid": false, "title": "year (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/layer_line_errorband_2d_horizontal_borders_strokedash.svg b/examples/compiled/layer_line_errorband_2d_horizontal_borders_strokedash.svg index 074de41a5b..9b42d23831 100644 --- a/examples/compiled/layer_line_errorband_2d_horizontal_borders_strokedash.svg +++ b/examples/compiled/layer_line_errorband_2d_horizontal_borders_strokedash.svg @@ -1 +1 @@ -197019721974197619781980Year (year)1520253035Miles per Gallon (95% CIs) \ No newline at end of file +197019721974197619781980Year (year)1520253035Miles per Gallon (95% CIs) \ No newline at end of file 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 8ba8495633..692fe31c10 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 @@ -192,9 +192,7 @@ "orient": "bottom", "grid": false, "title": "Year (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/layer_line_errorband_ci.svg b/examples/compiled/layer_line_errorband_ci.svg index 4751668a36..b3ebc2e59c 100644 --- a/examples/compiled/layer_line_errorband_ci.svg +++ b/examples/compiled/layer_line_errorband_ci.svg @@ -1 +1 @@ -197019721974197619781980Year (year)010203040Mean of Miles per Gallon (95% CIs) \ No newline at end of file +197019721974197619781980Year (year)010203040Mean of Miles per Gallon (95% CIs) \ No newline at end of file diff --git a/examples/compiled/layer_line_errorband_ci.vg.json b/examples/compiled/layer_line_errorband_ci.vg.json index 2f467bc8c4..a470acd333 100644 --- a/examples/compiled/layer_line_errorband_ci.vg.json +++ b/examples/compiled/layer_line_errorband_ci.vg.json @@ -146,9 +146,7 @@ "orient": "bottom", "grid": false, "title": "Year (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/layer_line_errorband_pre_aggregated.svg b/examples/compiled/layer_line_errorband_pre_aggregated.svg index b50281b0bc..c80364a4cc 100644 --- a/examples/compiled/layer_line_errorband_pre_aggregated.svg +++ b/examples/compiled/layer_line_errorband_pre_aggregated.svg @@ -1 +1 @@ -1975197619771978Year (year)2022242628Mean of Miles per Gallon (95% CIs) \ No newline at end of file +1975197619771978Year (year)2022242628Mean of Miles per Gallon (95% CIs) \ No newline at end of file diff --git a/examples/compiled/layer_line_errorband_pre_aggregated.vg.json b/examples/compiled/layer_line_errorband_pre_aggregated.vg.json index ec42299e65..61abdafe26 100644 --- a/examples/compiled/layer_line_errorband_pre_aggregated.vg.json +++ b/examples/compiled/layer_line_errorband_pre_aggregated.vg.json @@ -170,9 +170,7 @@ "orient": "bottom", "grid": false, "title": "Year (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/layer_line_mean_point_raw.svg b/examples/compiled/layer_line_mean_point_raw.svg index a1e56d8b2d..62c376b2a5 100644 --- a/examples/compiled/layer_line_mean_point_raw.svg +++ b/examples/compiled/layer_line_mean_point_raw.svg @@ -1 +1 @@ -2004200520062007200820092010date (year)0200400600800price, Mean of price \ No newline at end of file +2004200520062007200820092010date (year)0200400600800price, Mean of price \ No newline at end of file diff --git a/examples/compiled/layer_line_mean_point_raw.vg.json b/examples/compiled/layer_line_mean_point_raw.vg.json index a631d91286..c87c3afba0 100644 --- a/examples/compiled/layer_line_mean_point_raw.vg.json +++ b/examples/compiled/layer_line_mean_point_raw.vg.json @@ -149,9 +149,7 @@ "orient": "bottom", "grid": false, "title": "date (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_max_year.png b/examples/compiled/line_max_year.png index f122c96e39..423488e872 100644 Binary files a/examples/compiled/line_max_year.png and b/examples/compiled/line_max_year.png differ diff --git a/examples/compiled/line_max_year.svg b/examples/compiled/line_max_year.svg index 35f663e7c6..faca21313f 100644 --- a/examples/compiled/line_max_year.svg +++ b/examples/compiled/line_max_year.svg @@ -1 +1 @@ -Jan 2012Jan 2013Jan 2014Jan 2015date (year-month)010203040Max of temp_max \ No newline at end of file +2012201320142015date (year-month)010203040Max of temp_max \ No newline at end of file diff --git a/examples/compiled/line_max_year.vg.json b/examples/compiled/line_max_year.vg.json index 9499315646..fdf2770e30 100644 --- a/examples/compiled/line_max_year.vg.json +++ b/examples/compiled/line_max_year.vg.json @@ -105,9 +105,7 @@ "orient": "bottom", "grid": false, "title": "date (year-month)", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_mean_year.svg b/examples/compiled/line_mean_year.svg index 00c462f5eb..bddc04300a 100644 --- a/examples/compiled/line_mean_year.svg +++ b/examples/compiled/line_mean_year.svg @@ -1 +1 @@ -20112012201320142015date (year)051015Mean of temp_max \ No newline at end of file +20112012201320142015date (year)051015Mean of temp_max \ No newline at end of file diff --git a/examples/compiled/line_mean_year.vg.json b/examples/compiled/line_mean_year.vg.json index 00e5abe839..9de555f04d 100644 --- a/examples/compiled/line_mean_year.vg.json +++ b/examples/compiled/line_mean_year.vg.json @@ -102,9 +102,7 @@ "orient": "bottom", "grid": false, "title": "date (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_narrow_2year_span.svg b/examples/compiled/line_narrow_2year_span.svg index d6435a0630..400f7d173f 100644 --- a/examples/compiled/line_narrow_2year_span.svg +++ b/examples/compiled/line_narrow_2year_span.svg @@ -1 +1 @@ -200620072008date (year)0100200300400500Average of price \ No newline at end of file +200620072008date (year)0100200300400500Average of price \ 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 index 098235082b..9dd07f920c 100644 --- a/examples/compiled/line_narrow_2year_span.vg.json +++ b/examples/compiled/line_narrow_2year_span.vg.json @@ -109,9 +109,7 @@ "orient": "bottom", "grid": false, "title": "date (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_narrow_year_span.svg b/examples/compiled/line_narrow_year_span.svg index f39f0a8981..6bb5667368 100644 --- a/examples/compiled/line_narrow_year_span.svg +++ b/examples/compiled/line_narrow_year_span.svg @@ -1 +1 @@ -20062007date (year)0100200300400500Average of price \ No newline at end of file +20062007date (year)0100200300400500Average of price \ 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 index 1f63be521a..ed07b28d9c 100644 --- a/examples/compiled/line_narrow_year_span.vg.json +++ b/examples/compiled/line_narrow_year_span.vg.json @@ -108,9 +108,7 @@ "orient": "bottom", "grid": false, "title": "date (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_narrow_yearmonth_span.png b/examples/compiled/line_narrow_yearmonth_span.png index 6d25e4c587..47a8475655 100644 Binary files a/examples/compiled/line_narrow_yearmonth_span.png and b/examples/compiled/line_narrow_yearmonth_span.png differ diff --git a/examples/compiled/line_narrow_yearmonth_span.svg b/examples/compiled/line_narrow_yearmonth_span.svg index ce11da6367..cdf0e4519e 100644 --- a/examples/compiled/line_narrow_yearmonth_span.svg +++ b/examples/compiled/line_narrow_yearmonth_span.svg @@ -1 +1 @@ -Jan 2006Feb 2006Mar 2006Apr 2006May 2006Jun 2006date (year-month)0100200300400Average of price \ No newline at end of file +2006FebruaryMarchAprilMayJunedate (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 index 6eb37d6108..17329cb9fa 100644 --- a/examples/compiled/line_narrow_yearmonth_span.vg.json +++ b/examples/compiled/line_narrow_yearmonth_span.vg.json @@ -156,9 +156,7 @@ "orient": "bottom", "grid": false, "title": "date (year-month)", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_narrow_yearquarter_span.png b/examples/compiled/line_narrow_yearquarter_span.png index c72ded1695..97f7ccbb96 100644 Binary files a/examples/compiled/line_narrow_yearquarter_span.png and b/examples/compiled/line_narrow_yearquarter_span.png differ diff --git a/examples/compiled/line_narrow_yearquarter_span.svg b/examples/compiled/line_narrow_yearquarter_span.svg index fe93346d0d..8d1536e9f2 100644 --- a/examples/compiled/line_narrow_yearquarter_span.svg +++ b/examples/compiled/line_narrow_yearquarter_span.svg @@ -1 +1 @@ -2006 Q12006 Q22006 Q32006 Q4date (year-quarter)0100200300400500Average of price \ No newline at end of file +2006AprilJulyOctoberdate (year-quarter)0100200300400500Average of price \ 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 index f1a0ab4aa9..b897f8c245 100644 --- a/examples/compiled/line_narrow_yearquarter_span.vg.json +++ b/examples/compiled/line_narrow_yearquarter_span.vg.json @@ -108,9 +108,7 @@ "orient": "bottom", "grid": false, "title": "date (year-quarter)", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"quarter\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_overlay.svg b/examples/compiled/line_overlay.svg index 8fedcb7622..7c0e2b72ca 100644 --- a/examples/compiled/line_overlay.svg +++ b/examples/compiled/line_overlay.svg @@ -1 +1 @@ -200020022004200620082010date (year)0100200300400500Mean of priceAAPLAMZNGOOGIBMMSFTsymbol \ No newline at end of file +200020022004200620082010date (year)0100200300400500Mean of priceAAPLAMZNGOOGIBMMSFTsymbol \ No newline at end of file diff --git a/examples/compiled/line_overlay.vg.json b/examples/compiled/line_overlay.vg.json index 6cf07f6de8..4f30dc15d4 100644 --- a/examples/compiled/line_overlay.vg.json +++ b/examples/compiled/line_overlay.vg.json @@ -172,9 +172,7 @@ "orient": "bottom", "grid": false, "title": "date (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_overlay_stroked.svg b/examples/compiled/line_overlay_stroked.svg index d64d338e70..d66aa2ca87 100644 --- a/examples/compiled/line_overlay_stroked.svg +++ b/examples/compiled/line_overlay_stroked.svg @@ -1 +1 @@ -200020022004200620082010date (year)0100200300400500Mean of priceAAPLAMZNGOOGIBMMSFTsymbol \ No newline at end of file +200020022004200620082010date (year)0100200300400500Mean of priceAAPLAMZNGOOGIBMMSFTsymbol \ No newline at end of file diff --git a/examples/compiled/line_overlay_stroked.vg.json b/examples/compiled/line_overlay_stroked.vg.json index 457b9fbf1e..784a197210 100644 --- a/examples/compiled/line_overlay_stroked.vg.json +++ b/examples/compiled/line_overlay_stroked.vg.json @@ -173,9 +173,7 @@ "orient": "bottom", "grid": false, "title": "date (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/line_quarter_legend.svg b/examples/compiled/line_quarter_legend.svg index c3696cad97..ce8f049c0b 100644 --- a/examples/compiled/line_quarter_legend.svg +++ b/examples/compiled/line_quarter_legend.svg @@ -1 +1 @@ -200020022004200620082010date (year)050100150200Mean of priceQ1Q2Q3Q4date (quarter) \ No newline at end of file +200020022004200620082010date (year)050100150200Mean of priceQ1Q2Q3Q4date (quarter) \ No newline at end of file diff --git a/examples/compiled/line_quarter_legend.vg.json b/examples/compiled/line_quarter_legend.vg.json index 32a109b83f..2f6ff237c9 100644 --- a/examples/compiled/line_quarter_legend.vg.json +++ b/examples/compiled/line_quarter_legend.vg.json @@ -135,9 +135,7 @@ "orient": "bottom", "grid": false, "title": "date (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/stacked_area_ordinal.svg b/examples/compiled/stacked_area_ordinal.svg index b0188bc79a..c0e619263b 100644 --- a/examples/compiled/stacked_area_ordinal.svg +++ b/examples/compiled/stacked_area_ordinal.svg @@ -1 +1 @@ -197019721974197619781980Year (year)050,000100,000150,000Sum of Weight_in_lbs34568Cylinders \ No newline at end of file +197019721974197619781980Year (year)050,000100,000150,000Sum of Weight_in_lbs34568Cylinders \ No newline at end of file diff --git a/examples/compiled/stacked_area_ordinal.vg.json b/examples/compiled/stacked_area_ordinal.vg.json index ae4df38f7f..005345e004 100644 --- a/examples/compiled/stacked_area_ordinal.vg.json +++ b/examples/compiled/stacked_area_ordinal.vg.json @@ -150,9 +150,7 @@ "orient": "bottom", "grid": false, "title": "Year (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/tick_timeunit.svg b/examples/compiled/tick_timeunit.svg index efd48ab69e..43d7c763f3 100644 --- a/examples/compiled/tick_timeunit.svg +++ b/examples/compiled/tick_timeunit.svg @@ -1 +1 @@ -20042005200620072008200920102011date (year)01,0002,0003,0004,0005,0006,0007,000Sum of price \ No newline at end of file +20042005200620072008200920102011date (year)01,0002,0003,0004,0005,0006,0007,000Sum of price \ No newline at end of file diff --git a/examples/compiled/tick_timeunit.vg.json b/examples/compiled/tick_timeunit.vg.json index 2120d002ad..f79dc13dcb 100644 --- a/examples/compiled/tick_timeunit.vg.json +++ b/examples/compiled/tick_timeunit.vg.json @@ -119,9 +119,7 @@ "orient": "bottom", "grid": false, "title": "date (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/examples/compiled/time_output_utc_scale.png b/examples/compiled/time_output_utc_scale.png index 8f72160a7a..a5840a9bc6 100644 Binary files a/examples/compiled/time_output_utc_scale.png and b/examples/compiled/time_output_utc_scale.png differ diff --git a/examples/compiled/time_output_utc_scale.svg b/examples/compiled/time_output_utc_scale.svg index d52ffea878..58cd704b70 100644 --- a/examples/compiled/time_output_utc_scale.svg +++ b/examples/compiled/time_output_utc_scale.svg @@ -1 +1 @@ -Jan 02, 2012 07:00Jan 02, 2012 08:00Jan 02, 2012 09:00Jan 02, 2012 10:00Jan 02, 2012 11:00date (year-month-date-hours-minutes)050100150200price \ No newline at end of file +07 AM08 AM09 AM10 AM11 AMdate (year-month-date-hours-minutes)050100150200price \ No newline at end of file diff --git a/examples/compiled/time_output_utc_scale.vg.json b/examples/compiled/time_output_utc_scale.vg.json index 772419de5f..0c9326b2d8 100644 --- a/examples/compiled/time_output_utc_scale.vg.json +++ b/examples/compiled/time_output_utc_scale.vg.json @@ -110,9 +110,7 @@ "grid": false, "title": "date (year-month-date-hours-minutes)", "labelAngle": 15, - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\",\"date\",\"hours\",\"minutes\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelAlign": "left", "labelBaseline": "top", "labelFlush": true, diff --git a/examples/compiled/time_output_utc_timeunit.png b/examples/compiled/time_output_utc_timeunit.png index 8f72160a7a..a5840a9bc6 100644 Binary files a/examples/compiled/time_output_utc_timeunit.png and b/examples/compiled/time_output_utc_timeunit.png differ diff --git a/examples/compiled/time_output_utc_timeunit.svg b/examples/compiled/time_output_utc_timeunit.svg index 3f4bf10fc9..58e085aa10 100644 --- a/examples/compiled/time_output_utc_timeunit.svg +++ b/examples/compiled/time_output_utc_timeunit.svg @@ -1 +1 @@ -Jan 02, 2012 07:00Jan 02, 2012 08:00Jan 02, 2012 09:00Jan 02, 2012 10:00Jan 02, 2012 11:00date (year-month-date-hours-minutes)050100150200price \ No newline at end of file +07 AM08 AM09 AM10 AM11 AMdate (year-month-date-hours-minutes)050100150200price \ No newline at end of file diff --git a/examples/compiled/time_output_utc_timeunit.vg.json b/examples/compiled/time_output_utc_timeunit.vg.json index 5d4be95d66..ee826e6274 100644 --- a/examples/compiled/time_output_utc_timeunit.vg.json +++ b/examples/compiled/time_output_utc_timeunit.vg.json @@ -114,9 +114,7 @@ "grid": false, "title": "date (year-month-date-hours-minutes)", "labelAngle": 15, - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\",\"date\",\"hours\",\"minutes\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelAlign": "left", "labelBaseline": "top", "labelFlush": true, diff --git a/examples/compiled/time_parse_binnedutc.png b/examples/compiled/time_parse_binnedutc.png index 8282e3c125..e563d00a0d 100644 Binary files a/examples/compiled/time_parse_binnedutc.png and b/examples/compiled/time_parse_binnedutc.png differ diff --git a/examples/compiled/time_parse_binnedutc.svg b/examples/compiled/time_parse_binnedutc.svg index a3fdd7d123..8c2645f7b5 100644 --- a/examples/compiled/time_parse_binnedutc.svg +++ b/examples/compiled/time_parse_binnedutc.svg @@ -1 +1 @@ -Oct 10, 2011 00:00Oct 12, 2011 00:00time \ No newline at end of file +Mon 10Wed 12time \ No newline at end of file diff --git a/examples/compiled/time_parse_binnedutc.vg.json b/examples/compiled/time_parse_binnedutc.vg.json index 55dc8f7d78..cea5dfa113 100644 --- a/examples/compiled/time_parse_binnedutc.vg.json +++ b/examples/compiled/time_parse_binnedutc.vg.json @@ -66,9 +66,7 @@ "orient": "left", "grid": false, "title": "time", - "format": { - "signal": "timeUnitSpecifier([\"year\",\"month\",\"date\",\"hours\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "formatType": "utc", "labelOverlap": true, "tickMinStep": { diff --git a/examples/compiled/window_cumulative_running_average.svg b/examples/compiled/window_cumulative_running_average.svg index 675d537495..228588b92e 100644 --- a/examples/compiled/window_cumulative_running_average.svg +++ b/examples/compiled/window_cumulative_running_average.svg @@ -1 +1 @@ -197019721974197619781980Year (year)01020304050Miles Per Gallon \ No newline at end of file +197019721974197619781980Year (year)01020304050Miles Per Gallon \ No newline at end of file diff --git a/examples/compiled/window_cumulative_running_average.vg.json b/examples/compiled/window_cumulative_running_average.vg.json index 62da2036e4..bfa2f8fd5d 100644 --- a/examples/compiled/window_cumulative_running_average.vg.json +++ b/examples/compiled/window_cumulative_running_average.vg.json @@ -152,9 +152,7 @@ "orient": "bottom", "grid": false, "title": "Year (year)", - "format": { - "signal": "timeUnitSpecifier([\"year\"], {\"year-month\":\"%b %Y \",\"year-month-date\":\"%b %d, %Y \"})" - }, + "format": {}, "labelFlush": true, "labelOverlap": true, "tickCount": {"signal": "ceil(width/40)"}, diff --git a/src/compile/format.ts b/src/compile/format.ts index be42af2cdb..32211affcf 100644 --- a/src/compile/format.ts +++ b/src/compile/format.ts @@ -179,7 +179,7 @@ export function guideFormat( format: string | Dict, formatType: string | SignalRef, config: Config, - omitTimeFormatConfig: boolean // axis doesn't use config.timeFormat + isAxis: boolean ) { if (isString(formatType) && isCustomFormatType(formatType)) { return undefined; // handled in encode block @@ -216,7 +216,7 @@ export function guideFormat( return undefined; // hanlded in encode block } - return timeFormat({specifiedFormat: format as string, timeUnit, config, omitTimeFormatConfig}); + return timeFormat({specifiedFormat: format as string, timeUnit, config, isAxis}); } return numberFormat({type, specifiedFormat: format, config}); @@ -269,12 +269,12 @@ export function timeFormat({ specifiedFormat, timeUnit, config, - omitTimeFormatConfig + isAxis }: { specifiedFormat?: string; timeUnit?: TimeUnit; config: Config; - omitTimeFormatConfig?: boolean; + isAxis?: boolean; }) { if (specifiedFormat) { return specifiedFormat; @@ -282,11 +282,12 @@ export function timeFormat({ if (timeUnit) { return { - signal: timeUnitSpecifierExpression(timeUnit) + signal: timeUnitSpecifierExpression(timeUnit, {isAxis}) }; } - return omitTimeFormatConfig ? undefined : config.timeFormat; + // axis doesn't use config.timeFormat + return isAxis ? undefined : config.timeFormat; } function formatExpr(field: string, format: string) { diff --git a/src/timeunit.ts b/src/timeunit.ts index 0ef009371f..da344af31b 100644 --- a/src/timeunit.ts +++ b/src/timeunit.ts @@ -338,12 +338,20 @@ export function fieldExpr(fullTimeUnit: TimeUnit, field: string, {end}: {end: bo return dateTimeExprToExpr(dateExpr); } -export function timeUnitSpecifierExpression(timeUnit: TimeUnit) { +export function timeUnitSpecifierExpression(timeUnit: TimeUnit, {isAxis}: {isAxis: boolean}): string { if (!timeUnit) { return undefined; } const timeUnitParts = getTimeUnitParts(timeUnit); + if (isAxis) { + if (timeUnitParts.includes('year') && !timeUnitParts.includes('week')) { + // If the timeUnit includes year (meaning it's a chronological timeUnit (aka datetime truncation), + // then the default axis format is actually pretty smart. + return undefined; + } + } + return `timeUnitSpecifier(${stringify(timeUnitParts)}, ${stringify(VEGALITE_TIMEFORMAT)})`; } @@ -355,7 +363,7 @@ export function formatExpression(timeUnit: TimeUnit, field: string, isUTCScale: return undefined; } - const expr = timeUnitSpecifierExpression(timeUnit); + const expr = timeUnitSpecifierExpression(timeUnit, {isAxis: false}); // We only use utcFormat for utc scale // For utc time units, the data is already converted as a part of timeUnit transform. diff --git a/test/compile/format.test.ts b/test/compile/format.test.ts index ada7be09f4..ef7691f3e2 100644 --- a/test/compile/format.test.ts +++ b/test/compile/format.test.ts @@ -105,13 +105,13 @@ describe('Format', () => { }); }); - it('omits the timeFormat when omitTimeFormatConfig and no specifiedFormat', () => { - const formatted = timeFormat({config: {timeFormat: '%y'}, omitTimeFormatConfig: true}); + it('omits the timeFormat when isAxis and no specifiedFormat', () => { + const formatted = timeFormat({config: {timeFormat: '%y'}, isAxis: true}); expect(formatted).toBeUndefined(); }); - it('returns the timeFormat when !omitTimeFormatConfig and no specifiedFormat', () => { - const formatted = timeFormat({config: {timeFormat: '%y'}, omitTimeFormatConfig: false}); + it('returns the timeFormat when !isAxis and no specifiedFormat', () => { + const formatted = timeFormat({config: {timeFormat: '%y'}, isAxis: false}); expect(formatted).toBe('%y'); }); });