Skip to content

Add a line for the current Date #248

Answered by deejay-hub
TomassPasc asked this question in Q&A
Discussion options

You must be logged in to vote

You will need to redraw the line when the minimap zoom control is moved. You'll have to add the code to the timelineCanvas.redraw method.

timelineCanvas.selectAll('[class~=timeline-canvas-current-date]').remove();

            let cd = timelineCanvas.append('g')
                .attr('class', 'timeline-canvas-current-date')
                .attr('transform', 'translate(' + timelineCanvas.x(currentDate) + ')' );
            
            cd.append("line")
                .style("stroke", "steelblue")
                .style("stroke-width", "1px")
                .attr("y2", timelineHeight);

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by deejay-hub
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants