Skip to content

Commit 0817806

Browse files
committed
update bar chart race to be shorter and limit to 5 vendors
1 parent 4be78d8 commit 0817806

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

markdown/cve_data_stories/vendor_cve_trends/05_visualizations.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jupyter:
1818

1919
## Bar Chart Race: Top 10 Vendors by CVE Count (2002–2024)
2020

21-
This script generates a dynamic bar chart race showcasing the top 10 vendors by CVE count over time (2002–2024). The visualization highlights trends and shifts in vulnerability disclosures across two decades in an engaging video format.
21+
This script generates a dynamic bar chart race showcasing the top 5 vendors by CVE count over time (2002–2024). The visualization highlights trends and shifts in vulnerability disclosures across two decades in an engaging video format.
2222

2323
---
2424

@@ -46,7 +46,7 @@ This script generates a dynamic bar chart race showcasing the top 10 vendors by
4646
- **Fallback Colors**: Vendors without defined colors are assigned visually distinct fallback colors from a predefined color palette (`tab20`).
4747

4848
5. **Generate the Bar Chart Race**:
49-
- Animates the top 10 vendors dynamically over time:
49+
- Animates the top 5 vendors dynamically over time:
5050
- Bars update their values and order based on cumulative CVE counts.
5151
- Customizable parameters enhance readability and aesthetics.
5252
- Saves the animation as an `.mp4` file for high-quality sharing.
@@ -87,7 +87,7 @@ This script generates a dynamic bar chart race showcasing the top 10 vendors by
8787

8888

8989

90-
```python jupyter={"is_executing": true}
90+
```python
9191
import os
9292
import warnings
9393

@@ -257,11 +257,11 @@ bar_chart_race(
257257
filename=output_file, # Path to save the output file (e.g., .mp4 or .gif)
258258
orientation="h", # Horizontal bar chart orientation
259259
sort="desc", # Sort bars in descending order by value
260-
n_bars=10, # Display the top 10 vendors at any given time
260+
n_bars=5, # Display the top 5 vendors at any given time
261261
fixed_order=False, # Dynamically adjust the order of bars based on value
262262
fixed_max=True, # Keep the maximum value on the y-axis consistent across all frames
263-
steps_per_period=20, # Number of steps (frames) per period for smoother transitions
264-
period_length=600, # Duration of each period in milliseconds (controls animation speed)
263+
steps_per_period=10, # Number of steps (frames) per period for smoother transitions
264+
period_length=400, # Duration of each period in milliseconds (controls animation speed)
265265
interpolate_period=True, # Smoothly interpolate values between periods
266266
label_bars=True, # Display values as labels inside the bars
267267
bar_size=0.85, # Adjust bar thickness (0.85 means bars take up 85% of the space)

notebooks/cve_data_stories/vendor_cve_trends/05_visualizations.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"source": [
1313
"## Bar Chart Race: Top 10 Vendors by CVE Count (2002–2024)\n",
1414
"\n",
15-
"This script generates a dynamic bar chart race showcasing the top 10 vendors by CVE count over time (2002–2024). The visualization highlights trends and shifts in vulnerability disclosures across two decades in an engaging video format.\n",
15+
"This script generates a dynamic bar chart race showcasing the top 5 vendors by CVE count over time (2002–2024). The visualization highlights trends and shifts in vulnerability disclosures across two decades in an engaging video format.\n",
1616
"\n",
1717
"---\n",
1818
"\n",
@@ -40,7 +40,7 @@
4040
" - **Fallback Colors**: Vendors without defined colors are assigned visually distinct fallback colors from a predefined color palette (`tab20`).\n",
4141
"\n",
4242
"5. **Generate the Bar Chart Race**:\n",
43-
" - Animates the top 10 vendors dynamically over time:\n",
43+
" - Animates the top 5 vendors dynamically over time:\n",
4444
" - Bars update their values and order based on cumulative CVE counts.\n",
4545
" - Customizable parameters enhance readability and aesthetics.\n",
4646
" - Saves the animation as an `.mp4` file for high-quality sharing.\n",
@@ -85,8 +85,8 @@
8585
{
8686
"metadata": {
8787
"ExecuteTime": {
88-
"end_time": "2025-01-05T13:10:58.590215Z",
89-
"start_time": "2025-01-05T13:03:34.083722Z"
88+
"end_time": "2025-01-05T13:39:15.508308Z",
89+
"start_time": "2025-01-05T13:36:46.755819Z"
9090
}
9191
},
9292
"cell_type": "code",
@@ -260,11 +260,11 @@
260260
" filename=output_file, # Path to save the output file (e.g., .mp4 or .gif)\n",
261261
" orientation=\"h\", # Horizontal bar chart orientation\n",
262262
" sort=\"desc\", # Sort bars in descending order by value\n",
263-
" n_bars=10, # Display the top 10 vendors at any given time\n",
263+
" n_bars=5, # Display the top 5 vendors at any given time\n",
264264
" fixed_order=False, # Dynamically adjust the order of bars based on value\n",
265265
" fixed_max=True, # Keep the maximum value on the y-axis consistent across all frames\n",
266-
" steps_per_period=20, # Number of steps (frames) per period for smoother transitions\n",
267-
" period_length=600, # Duration of each period in milliseconds (controls animation speed)\n",
266+
" steps_per_period=10, # Number of steps (frames) per period for smoother transitions\n",
267+
" period_length=400, # Duration of each period in milliseconds (controls animation speed)\n",
268268
" interpolate_period=True, # Smoothly interpolate values between periods\n",
269269
" label_bars=True, # Display values as labels inside the bars\n",
270270
" bar_size=0.85, # Adjust bar thickness (0.85 means bars take up 85% of the space)\n",

0 commit comments

Comments
 (0)