-
Notifications
You must be signed in to change notification settings - Fork 473
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
allow specification of line color in MG.data_graphic #503
Comments
…arily about moving away from using mg-line1-color as a selector. getting rid of the -color part of the class means that the selectors for rollovers are purely about selection, not color. This allows us to do things like color lines using a new argument: colors, which takes an array, and colors the lines as they are ordered by accessor or by placement in the data argument. This is primarily targeted toward #503, but required this refactoring and reworking so that nothing else breaks.
@almossawi Would love to get another set of eyes on this commit. The change is: 1.) we add new classes to line elements + rollovers so we are not selecting based on This required a pretty major refactoring of how we select elements in the rollovers for line charts, but I think it is worth it since it a. removes the conflation of color and rollover selections, class-wise, which makes the whole thing cleaner, and b. opens up coloring lines in the API itself, not just in CSS. I've pretty thoroughly tested it across voronoi, linked charts, single line charts, and aggregate rollovers, but have not against the custom_color_map logic, since I am less familiar with it. Added examples as well. At any rate, take a look and see what you think. Trying to curtail my agent-of-chaos status on this lib, but couldn't resist this change. |
@hamilton Wonderful. It looks great 👍 |
There are often cases where relying on CSS to determine line colors is not flexible enough. Being able to pass in an array of colors would be a useful option.
The text was updated successfully, but these errors were encountered: