diff --git a/README.md b/README.md index 1c2cd6dd..89cb87d9 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,7 @@ The credentials below are valid, so you can copy and use them to access a develo AUGUR_SCHEMA=augur_data AUGUR_USERNAME=eightknot 8KNOT_DEBUG=True + REDIS_PASSWORD=1234 ``` If you have a companion Augur front end application you'll need to set the following credentials in the env.list as well. @@ -220,6 +221,8 @@ To clean up the stopped containers, run: docker compose down ``` +The application should be available locally at 'http://localhost:8080' + --- ## Development Note diff --git a/docs/new_viz_guidance.md b/docs/new_viz_guidance.md index 5ba6af78..7a0fbbcc 100644 --- a/docs/new_viz_guidance.md +++ b/docs/new_viz_guidance.md @@ -25,7 +25,7 @@ individual visualizations are imported and further organized below. ### Visualization Template -[Visualization Template](https://github.com/oss-aspen/8Knot/blob/dev/pages/visualization_template/viz_template.py) gives you the outline to making your next visualization. +The [Visualization Template](https://github.com/oss-aspen/8Knot/blob/dev/pages/visualization_template/viz_template.py) takes you step-by-step through the process of creating a new visualization. ### Data and Queries @@ -35,14 +35,13 @@ Database are in the folder /queries/. These queries may be reused across multipl visualizations. When considering creating your own visualization, please see whether the available queries to our database instance are sufficient. -If the existing queries won't suffice, the most straight-forward way to create -your own is to copy one of the existing queries into the same directory with a -descriptive filename: +If the existing queries do not suffice: +1. Exhaust the possibility of making minor changes, such adding +new columns or aggregations, to existing queries. +2. If a completely new query is necessary, use the [Query Template](https://github.com/oss-aspen/8Knot/blob/dev/queries/query_template.py) +to build a new query. -e.g. "mv commits\_query.py ./comments\_query.py" - -Then, change as few things as possible in the newly created file to meet the -needs of your new query. Make sure to include comments. +Note: make sure to do a "docker compose down" before rebuilding to be able to access any new or edited queries. ### Importing your queries @@ -65,16 +64,7 @@ read through those files to understand what they're doing generally, but feel no responsibility to dive very deep if that isn't your area of interest. Instead, follow the format of other queries that are already available. -1. Import the query function you are going to use from /queries/ - -2. Copy the card-layout design pattern that we've architected in other -visualization's files, renaming component objects meaningfully and uniquely. - -3. Important: in the callback for your visualization, please make sure that it's -unique "Interval" component, the "repo-choices" id'ed component, and any other relevant -Dash components are Inputs. - -4. Use our Job Manager interface as shown in other visualization files. A common error +Use our Job Manager interface as shown in other visualization files and the visualization template. A common error is to copy the use of the manager from any other visualization callback and to not replace the query function short-hand reference. For instance, if another visualization used "commits\_query", named cmq as we described earlier, but you were intending to use diff --git a/pages/chaoss/visualizations/project_velocity.py b/pages/chaoss/visualizations/project_velocity.py index d1f2e3e0..87a2d0bd 100644 --- a/pages/chaoss/visualizations/project_velocity.py +++ b/pages/chaoss/visualizations/project_velocity.py @@ -280,8 +280,6 @@ def process_data( if end_date is not None: df = df[df.created_at <= end_date] - print(df.head()) - # df to hold value of unique contributors for each repo df_cntrbs = pd.DataFrame(df.groupby("repo_name")["cntrb_id"].nunique()).rename( columns={"cntrb_id": "num_unique_contributors"} diff --git a/pages/visualization_template/viz_template.py b/pages/visualization_template/viz_template.py index de632965..194021ff 100644 --- a/pages/visualization_template/viz_template.py +++ b/pages/visualization_template/viz_template.py @@ -15,7 +15,8 @@ import time """ -List of variables to change: +NOTE: VARIABLES TO CHANGE: + (1) PAGE (2) VIZ_ID (3) gc_VISUALIZATION @@ -29,12 +30,19 @@ (10) Comments before callbacks (11) QUERY_USED, QUERY_NAME, QUERY_INITIALS +NOTE: IMPORTING A VISUALIZATION INTO A PAGE +(1) Include the visualization file in the visualization folder for the respective page +(2) Import the visualization into the page_name.py file using "from .visualizations.visualization_file_name import gc_visualization_name" +(3) Add the card into a column in a row on the page + NOTE: ADDITIONAL DASH COMPONENTS FOR USER GRAPH CUSTOMIZATIONS If you add Dash components (ie dbc.Input, dbc.RadioItems, dcc.DatePickerRange...) the ids, html_for, and targets should be in the following format: f"component-identifier-{PAGE}-{VIZ_ID}" NOTE: If you change or add a new query, you need to do "docker system prune -af" before building again + +For more information, check out the new_vis_guidance.md """ @@ -59,7 +67,7 @@ dbc.PopoverBody("INSERT CONTEXT OF GRAPH HERE"), ], id=f"popover-{PAGE}-{VIZ_ID}", - target=f"popover-target-{PAGE}-{VIZ_ID}", # needs to be the same as dbc.Button id + target=f"popover-target-{PAGE}-{VIZ_ID}", placement="top", is_open=False, ),