-
Notifications
You must be signed in to change notification settings - Fork 80
Heatmap graph styling pr #1102
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
Heatmap graph styling pr #1102
Changes from all commits
e66c6f3
a4ae00e
a016dce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,13 @@ | ||
| from dash import html, dcc, callback | ||
| import dash | ||
|
Check warning on line 2 in 8Knot/pages/codebase/visualizations/cntrb_file_heatmap.py
|
||
| import dash_bootstrap_components as dbc | ||
| import dash_mantine_components as dmc | ||
| from dash.dependencies import Input, Output, State | ||
| import plotly.graph_objects as go | ||
|
Check warning on line 6 in 8Knot/pages/codebase/visualizations/cntrb_file_heatmap.py
|
||
| import pandas as pd | ||
| import logging | ||
| from dateutil.relativedelta import * # type: ignore | ||
| import plotly.express as px | ||
| from pages.utils.graph_utils import get_graph_time_values, color_seq | ||
| from pages.utils.graph_utils import create_heatmap_figure, get_graph_time_values, color_seq | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
| from queries.contributors_query import contributors_query as cnq | ||
| from queries.cntrb_per_file_query import cntrb_per_file_query as cpfq | ||
| from queries.repo_files_query import repo_files_query as rfq | ||
|
|
@@ -16,7 +15,7 @@ | |
| from pages.utils.job_utils import nodata_graph | ||
| import pages.utils.preprocessing_utils as preproc_u | ||
| import time | ||
| from dash.exceptions import PreventUpdate | ||
|
Check warning on line 18 in 8Knot/pages/codebase/visualizations/cntrb_file_heatmap.py
|
||
| import app | ||
| import cache_manager.cache_facade as cf | ||
|
|
||
|
|
@@ -332,18 +331,7 @@ | |
|
|
||
|
|
||
| def create_figure(df: pd.DataFrame): | ||
| fig = px.imshow( | ||
| df, | ||
| labels=dict(x="Time", y="Directory Entries", color="Contributors"), | ||
| color_continuous_scale=px.colors.sequential.deep, | ||
| ) | ||
|
|
||
| fig["layout"]["yaxis"]["tickmode"] = "linear" | ||
| fig["layout"]["height"] = 700 | ||
| fig["layout"]["coloraxis_colorbar_x"] = -0.15 | ||
| fig["layout"]["yaxis"]["side"] = "right" | ||
|
|
||
| return fig | ||
| return create_heatmap_figure(df, color_label="Contributors") | ||
|
|
||
|
|
||
| def df_file_clean(df_file: pd.DataFrame, df_file_cntbs: pd.DataFrame, bot_switch): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,13 @@ | ||
| from dash import html, dcc, callback | ||
| import dash | ||
|
Check warning on line 2 in 8Knot/pages/codebase/visualizations/reviewer_file_heatmap.py
|
||
| import dash_bootstrap_components as dbc | ||
| import dash_mantine_components as dmc | ||
| from dash.dependencies import Input, Output, State | ||
| import plotly.graph_objects as go | ||
|
Check warning on line 6 in 8Knot/pages/codebase/visualizations/reviewer_file_heatmap.py
|
||
| import pandas as pd | ||
| import logging | ||
| from dateutil.relativedelta import * # type: ignore | ||
| import plotly.express as px | ||
| from pages.utils.graph_utils import get_graph_time_values, color_seq | ||
| from pages.utils.graph_utils import create_heatmap_figure, get_graph_time_values, color_seq | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
| from queries.contributors_query import contributors_query as cnq | ||
| from queries.cntrb_per_file_query import cntrb_per_file_query as cpfq | ||
| from queries.repo_files_query import repo_files_query as rfq | ||
|
|
@@ -332,18 +331,7 @@ | |
|
|
||
|
|
||
| def create_figure(df: pd.DataFrame): | ||
| fig = px.imshow( | ||
| df, | ||
| labels=dict(x="Time", y="Directory Entries", color="Contributors"), | ||
| color_continuous_scale=px.colors.sequential.deep, | ||
| ) | ||
|
|
||
| fig["layout"]["yaxis"]["tickmode"] = "linear" | ||
| fig["layout"]["height"] = 700 | ||
| fig["layout"]["coloraxis_colorbar_x"] = -0.15 | ||
| fig["layout"]["yaxis"]["side"] = "right" | ||
|
|
||
| return fig | ||
| return create_heatmap_figure(df, color_label="Contributors") | ||
|
|
||
|
|
||
| def df_file_clean(df_file: pd.DataFrame, df_file_cntbs: pd.DataFrame, bot_switch): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pylint] reported by reviewdog 🐶
W0611: Unused get_graph_time_values imported from pages.utils.graph_utils (unused-import)