Skip to content

Commit

Permalink
Merge branch 'dev' into add-openshift-defs
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesKunstle authored Aug 29, 2023
2 parents 0aba3ae + 676ebac commit a43e7bf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
26 changes: 8 additions & 18 deletions docs/new_viz_guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions pages/chaoss/visualizations/project_velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
12 changes: 10 additions & 2 deletions pages/visualization_template/viz_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import time

"""
List of variables to change:
NOTE: VARIABLES TO CHANGE:
(1) PAGE
(2) VIZ_ID
(3) gc_VISUALIZATION
Expand All @@ -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
"""


Expand All @@ -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,
),
Expand Down

0 comments on commit a43e7bf

Please sign in to comment.