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
When there are more than 5 lines, line 6 an up are invisible #783
Comments
Agreed, that would be a better expected result. It should also simply have a larger set of colors. |
However the README.md mentions something about this in the FAQ section.
So, I guess this has been done on purpose. However, taking the scope to around 10 different colors shouldn't cause much harm. I've found out where to work on this. If allowed can I file a related PR please ? @hamilton whatsay |
My vote would be to allow up to 10 colors and render any additional series in black. I agree that most charts shouldn't need/have more than 5 different colors in them, but otoh I don't think it's helpful to be overly restrictive here given the low effort involved. |
@wlach I've started work recently and realised that actually it would be of much help if you could tell me the exact colours you would want apart from steelblue for 6. I just need to insert these specific colour codes into the file. |
This sounds like a great PR. I'd say: 1.) Extend to 10 colors. You can fill in the remaining 5 from the link you provided. Frankly the ordering is not particularly important past the 5 we have now (which were from |
Ok @hamilton me right at work.
Maybe I'll file another one, improving the README for the same
I'll keep this in mind for sure |
@hamilton
I'm unable to identify the exact places in https://github.com/mozilla/metrics-graphics/blob/master/dist/metricsgraphics.js where the specific classes are being added to each path_line in the format
&
I've made a class called The colors that I've added are as shown below Only if you could guide me a bit on where to make the exact changes for |
Happy to help guide, but due to holidays I’ll be away from the computer for
a few days.
…On Sun, Dec 24, 2017 at 9:34 PM Shikhar Agnihotri ***@***.***> wrote:
@hamilton <https://github.com/hamilton>
I had implemented the colors for the first 10 lines easily.
However, when I'm trying to implement this,
Past 10, the lines should be black + they should have the appropriate
classes in-place. This places the onus on the user to fill in the colors if
necessary.
I'm unable to identify the exact places in
https://github.com/mozilla/metrics-graphics/blob/master/dist/metricsgraphics.js
where the specific classes are being added to each path_line in the format
mg-line${line_id}. I've already tried in the following places but in vain.
function mg_default_color_for_path(this_path, line_id) {
this_path.classed('mg-line' + (line_id) + '-color', true);
}
&
if (args.color === null) {
class_string += ' mg-line' + d.line_id + '-color';
}
return class_string;
} else {
class_string = 'mg-line' + d.line_id;
if (args.color === null) class_string += ' mg-line' + d.line_id + '-color';
return class_string;
}
- a couple of other places too. However, I'm not getting the expected
results.
I've made a class called mg-line-black which should be added to the class
string in case args.color is null and line_id>10
The colors that I've added are as shown below
[image: colorsmetrics]
<https://user-images.githubusercontent.com/25258877/34332051-714e9a08-e952-11e7-8b81-1a24d63a4538.png>
Only if you could guide me a bit on where to make the exact changes for mg-line
and legend also, it would complete the PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#783 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAF19ze11wk-vTgLBCQL8iqMIkOcGgleks5tDxfegaJpZM4RKf8w>
.
|
Well that's no problem @hamilton I'll wait up till after the new year. P.S. Merry Christmas 🎄 🎅 |
So @hamilton if you are back, do you mind answering this
|
@hamilton are you back ? |
@shikhar-scs I can probably help on this a bit, though I'm less experienced with the code in question than @hamilton. Could you post your work-to-date in a PR (referencing this issue)? Then we can iterate on this together. |
Hopefully we're good here now! |
Steps to reproduce
Download and open this HTML document
Actual result
The final 5 lines (in this case, the top-most 5 lines) are invisible. Hovering over them does cause a black circle to appear, however.
Expected result
All lines are colored. d3 has something that looks like it could help with this. As a last resort, if there are any lines that can't be assigned a color, having multiple black lines would be better than having insible lines.
The text was updated successfully, but these errors were encountered: