Repository: d3fc/d3fc

Issue #1167: Axis with skipped weekends doesn't have any ticks
Created: 2018-08-13T09:54:11Z
When updating teh examples to v14 as per #1109 - the following example shows a regression:
http://blockbuilder.org/ColinEberhardt/0a5cc7ca6c256dcd6ef1e2e7ffa468d4
When weekends are skipped, no tick marks are rendered

Duplicate issue #1101: Timezone breaks the time scale rendering (fc.scaleDiscontinuous)
Created: 2018-03-29T11:26:26Z
Found an annoying problem with the time scale axis. If the start of the range is specified in one timezone and the end in another - no labels on the axis.
let x = fc.scaleDiscontinuous(d3.scaleTime()) .discontinuityProvider(fc.discontinuitySkipWeekends()) .rangeRound([0, width])
Then
x.domain([timeAxisStart, timeAxisEnd])
This combination of dates breaks the axis:
Wed Feb 14 2018 00:00:00 GMT+0000 (GMT Standard Time)
Tue Mar 27 2018 00:00:00 GMT+0100 (GMT Daylight Time)
But if we have - fine:
Wed Feb 14 2018 00:00:00 GMT+0000 (GMT Standard Time)
Tue Mar 23 2018 00:00:00 GMT+0000 (GMT Daylight Time)
Tried various combinations adjusting the timezone, for example:
Wed Feb 14 2018 00:00:00 GMT+0000 (GMT Standard Time)
Tue Mar 27 2018 01:00:00 GMT+0100 (GMT Daylight Time)
Still doesn't work. Ended up reverting back to standard d3 timescale:
let x = d3.scaleTime().rangeRound([0, width])

Closing comment (2018-08-23T13:44:09Z): Code based reproduction -
fc.scaleDiscontinuous(d3.scaleTime())
  .discontinuityProvider(fc.discontinuitySkipWeekends())
  .rangeRound([0, 100])
  .domain([new Date(Date.parse('Wed Feb 14 2018 00:00:00 GMT+0000')), new Date(Date.parse('Tue Mar 27 2018 00:00:00 GMT+0100'))])
  .ticks()
// -> []

fc.scaleDiscontinuous(d3.scaleTime())
  .discontinuityProvider(fc.discontinuitySkipWeekends())
  .rangeRound([0, 100])
  .domain([new Date(Date.parse('Wed Feb 14 2018 00:00:00 GMT+0000')), new Date(Date.parse('Tue Mar 23 2018 00:00:00 GMT+0000'))])
  .ticks()
// -> (14) [Thu Feb 15 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Mon Feb 19 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Wed Feb 21 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Fri Feb 23 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Tue Feb 27 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Thu Mar 01 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Mon Mar 05 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Wed Mar 07 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Fri Mar 09 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Tue Mar 13 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Thu Mar 15 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Mon Mar 19 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Wed Mar 21 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Fri Mar 23 2018 00:00:00 GMT+0000 (Greenwich Mean Time)]

d3.scaleTime()
  .rangeRound([0, 100])
  .domain([new Date(Date.parse('Wed Feb 14 2018 00:00:00 GMT+0000')), new Date(Date.parse('Tue Mar 27 2018 00:00:00 GMT+0100'))])
  .ticks()
// -> (6) [Sun Feb 18 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Sun Feb 25 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Sun Mar 04 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Sun Mar 11 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Sun Mar 18 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Sun Mar 25 2018 00:00:00 GMT+0000 (Greenwich Mean Time)]
I think timezones (despite their flaws!) are not at fault here. I think the underlying timestamps are just happening to hit boundaries in the automatic tick calculation logic. You can fix this by manually specifying a tick interval outside of the range of the discontinuities -
fc.scaleDiscontinuous(d3.scaleTime())
  .discontinuityProvider(fc.discontinuitySkipWeekends())
  .rangeRound([0, 100])
  .domain([new Date(Date.parse('Wed Feb 14 2018 00:00:00 GMT+0000')), new Date(Date.parse('Tue Mar 27 2018 00:00:00 GMT+0100'))])
  .ticks(d3.timeDay.filter(d => d.getDay() === 1))
// -> (6) [Mon Feb 19 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Mon Feb 26 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Mon Mar 05 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Mon Mar 12 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Mon Mar 19 2018 00:00:00 GMT+0000 (Greenwich Mean Time), Mon Mar 26 2018 00:00:00 GMT+0100 (British Summer Time)]
Closing as a duplicate of  #1167.