Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I draw dynamic line on the control #64

Closed
xiangjian opened this issue Feb 24, 2016 · 1 comment
Closed

How can I draw dynamic line on the control #64

xiangjian opened this issue Feb 24, 2016 · 1 comment

Comments

@xiangjian
Copy link

I want to use this event to make a video playback control? I would like to add this control function
When the progress of the video player during playback may occur on the controls to play.

How can I draw dynamic line on the control
image

@jpetitcolas
Copy link
Contributor

It is not supported by EventDrops, and won't be, as it is a very specific feature. However, you can do it by hand, adding a vertical line over the chart, and moving it using some D3.js. Something like:

        const drawCurrentTimeLine = (container, height, date) => {
            const timeline = d3.select(container)
                .selectAll('.timeline')
                .data([{ date }]);

            timeline.enter()
                .append('line')
                .attr({
                    class: 'timeline',
                    y1: 0,
                    y2: height,
                    x1: d => d.date,
                    x2: d => d.date,
                });

            timeline.attr({
                x1: d => d.date,
                x2: d => d.date,
            });
        };

This code has not been tested, and would probably need more work to achieve your purpose. But that's a good start in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants