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

please make line chart drawDots optional #689

Closed
davisford opened this issue Aug 28, 2014 · 12 comments
Closed

please make line chart drawDots optional #689

davisford opened this issue Aug 28, 2014 · 12 comments

Comments

@davisford
Copy link
Contributor

If you turn the brush off on a line chart, it will create an extra group with dots and when you mouseover the dot it will show itself and show x/y lines back to the axes.

I want to do something similar, but not quite the same, and now I must either fork and turn this off, or else, remove it post render.

I think this behavior would be better served if it were configurable -- just like brushOn( ), add dotsOn( ) function to opt-in to this behavior.

@gordonwoodhull
Copy link
Contributor

Davis filed a new PR: #735. Will merge for 2.0

@mtraynham
Copy link
Contributor

I was working with this a bit @gordonwoodhull. I think that PR doesn't satisfy all the cases as the Brush for line charts is drawn on the DOM after the chart body and therefore intercepts the pointer events on the dots.

@gordonwoodhull
Copy link
Contributor

Right, #735 only controls whether the dots will show when the brush is off. You are looking for the ability to turn the dots on when the brush is also on?

@mtraynham
Copy link
Contributor

Yeah, I locally changed some of the CSS to turn off pointer events on the lines/areas that get generated, but the brush is still on top of the dots. The weirder part is that a composite chart, generates the child g on redraw, so after someone filters a different chart, the sub charts come to the top and the dots are interactive with brushing.

@gordonwoodhull
Copy link
Contributor

No doubt, that's a more difficult problem, which is likely why the design has been either/or up until now.

@gordonwoodhull
Copy link
Contributor

It might also be confusing to have little dots interfering with the brush action? I'm not sure.

@mtraynham
Copy link
Contributor

The brush remains in drag mode when you hover on the dots, so it's not terri-bad. I don't think there's a right answer here, so I'm not going to create a PR. In the mean time, I can work around it in this case with a .on('postRender',..., select the composite sub charts and move them in front of the brush, but also disabling pointer events on the lines/areas.

@gordonwoodhull
Copy link
Contributor

How did you turn the dots on, though? I thought #735 only provided a way to turn them off when the brush is off.

@mtraynham
Copy link
Contributor

Ha, ok, good question. Still using composite chart here... the child charts all have brushes, so in the composite chart's chart function, I return a new line chart with brushing always set to false. May seem a bit hacky, but I wanted the composite chart to delegate the brushing, not the children.

            child.brushOn = function () {
                if (!arguments.length) {
                    return false;
                }
                return this;
            };

@gordonwoodhull
Copy link
Contributor

Wow. The leaky abstraction that is dc.js.

@mtraynham
Copy link
Contributor

You saw nothing! Carry on... 😄

@gordonwoodhull
Copy link
Contributor

This was implemented in #735; continuing discussion of the opposite feature in #1152.

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

3 participants