AxisBottom = (g, scale) =>
g
.selectAll('.x-axis-bottom')
.data(['x-axis-bottom'])
.join('g')
.attr('class', d => d)
.attr("transform", `translate(${0}, ${height - margin.bottom})`)
.call(
d3
.axisBottom()
.scale(scale)
.tickSize(5)
.tickPadding(2)
.tickSizeOuter(0)
.ticks(d3.timeHour.every(6))
.tickFormat(function(d) {
var hours;
hours = d.getHours();
if (hours === 12) {
return '🌞';
} else if (hours === 0) {
} else {
return d3.timeFormat('%-I%p')(d);
}
})
)
.call(g => {
g.selectAll('text')
.filter(function(d, i) {
if (d3.select(this).text() === '12AM') {
d3.select(d3.select(this).node().parentNode).remove();
}
})
.remove();
})