Skip to content

Adding a color information to distinguish duplicate queries #721

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

Merged
merged 1 commit into from
Feb 25, 2016

Conversation

ewjoachim
Copy link
Contributor

This pull request simply adds a color element to distinguish between each duplicated request, as a follow-up to the conversation on #719

This is what it would look like
There's a colored rectangle next to each "Duplicated x times" line

I would simply like to add a note : the SQL panel uses several techniques to generate different colors, and I feel that it would be quite simpler if it was done using import colorsys (from the standard lib) which provides conversion functions from HSV (which allows selecting a color with full saturation and full value, varying only the hue from 0 to 1 instead of making convoluted operations with RGB) (As a side I'd even add that CSS supports HSL (HSL is most like HSV) input directly for most browser except IE <= 8.)

I'd be happy to redo the code for that part too, but I'm waiting for your input on that.

@aaugustin
Copy link
Contributor

That commit looks reasonable to me.

If you want to refactor color handling, please open another pull request. I don't feel a strong urge to fix something that isn't broken, but if it allows removing some code, why not.

You could have a look at existing algorithms for generating contrasting colorschemes. I don't know if the current version implements a common algorithm or reinvented that wheel.

@ewjoachim
Copy link
Contributor Author

It's been a few months, now, and I'm not sure what we're waiting for... Is there something I can do to help ?

aaugustin added a commit that referenced this pull request Feb 25, 2016
Adding a color information to distinguish duplicate queries
@aaugustin aaugustin merged commit 0ed1538 into django-commons:master Feb 25, 2016
ryneeverett pushed a commit to ryneeverett/django-debug-toolbar that referenced this pull request Oct 2, 2016
…lors

Adding a color information to distinguish duplicate queries
@ewjoachim ewjoachim deleted the duplicate_sql_colors branch January 20, 2020 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants