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

Request type colors #1221

Merged
merged 12 commits into from
Jun 2, 2022
Merged

Request type colors #1221

merged 12 commits into from
Jun 2, 2022

Conversation

joshuayhwu
Copy link
Contributor

@joshuayhwu joshuayhwu commented Jun 1, 2022

Fixes #1064

Request Type and corresponding hex code available here are consistent according to the table here:

Any questions? See the getting started guide

@joshuayhwu joshuayhwu requested a review from nichhk June 1, 2022 21:08
Copy link
Member

@nichhk nichhk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this Josh!

Most of my comments are style nits. I think a linter would automatically fix most of them. Speaking of which, we should decide on a Python linter to use, and make sure that everyone installs it. We can also try to make it part of the "Checks" process.

EDIT: I see that we're already using flake8 for some of the codebase, but maybe just server/api? I'll open an issue for this.

server/dash/dashboards/neighborhood_recent.py Outdated Show resolved Hide resolved
color_discrete_sequence=DISCRETE_COLORS,
color_discrete_map = DISCRETE_COLORS_MAP,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -1,7 +1,9 @@
import textwrap


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete extra new line

server/dash/design.py Show resolved Hide resolved
server/dash/design.py Outdated Show resolved Hide resolved
@@ -33,6 +33,7 @@
y="counts",
color="type_name",
color_discrete_sequence=DISCRETE_COLORS,
color_discrete_map = DISCRETE_COLORS_MAP,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing

color_discrete_sequence=DISCRETE_COLORS,
color_discrete_map = DISCRETE_COLORS_MAP,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing

@@ -50,7 +51,9 @@
pie_df,
names="type_name",
values="counts",
color='type_name',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this file is using double quotes, so let's keep it consistent.

server/dash/design.py Show resolved Hide resolved
import dash_core_components as dcc
import dash_html_components as html
# from dash import Dash, html, dcc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete? It also looks like there are some other test-related lines to delete.

@joshuayhwu
Copy link
Contributor Author

Thanks for working on this Josh!

Most of my comments are style nits. I think a linter would automatically fix most of them. Speaking of which, we should decide on a Python linter to use, and make sure that everyone installs it. We can also try to make it part of the "Checks" process.

EDIT: I see that we're already using flake8 for some of the codebase, but maybe just server/api? I'll open an issue for this.

Thnks for the comprehensive feedback! I updated the code to make sure they stay consistent. I will work on the duplicate color file later. Apologies for the style inconsistencies!

Copy link
Member

@nichhk nichhk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple more requests. I'll approve the changes now so that you don't need to wait on me after fixing the changes. Thanks!

server/dash/design.py Show resolved Hide resolved
Comment on lines 93 to 96
#df3 = df3.groupby(['type_name'])['counts'].sum().to_frame()
#df3.index = df3.index.map(lambda x: '<br>'.join(textwrap.wrap(x, width=16)))
print(df3['type_name'])
print(" * TESTING IF CHANGES ARE ACTUALLY DEPLOYED ON DOCKER")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need these lines?

@joshuayhwu
Copy link
Contributor Author

Just a couple more requests. I'll approve the changes now so that you don't need to wait on me after fixing the changes. Thanks!

Thanks so much - apologies for missing that!

@joshuayhwu joshuayhwu merged commit 52936c0 into dev Jun 2, 2022
@joshuayhwu joshuayhwu deleted the requestTypeColors branch June 2, 2022 00:58
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.

Use Type colors in Dash reports
2 participants