2026-09-09 — Weapon plot colour/dropped-points fixes; widget toolbars hidden
Repos touched: PROJ_activeattack_graphics (b6cc205), PROJ_activeattack_website (a7f60a2 figures, 1f5b89b bob.md + orientation log). Both pushed to main with Peter’s explicit approval; site redeployed via GitHub Actions at 20:09 UTC and verified live.
What Peter asked for
- On the Casualties tab, the Fatalities/Wounded by Weapon Type graphic had an arrow annotation (the Waukesha 2021 vehicle case, wounded > 60) shaded like a pistol instead of a vehicle.
- Remove the download and fullscreen icons from the top-right of the bicolor map widget; the page has its own download buttons and Peter dislikes the icons’ behaviour. Extended on request to all four interactive widgets.
Diagnosis
- Arrow colour.
fatality_weap_palis an unnamed 5-colour vector (make_color_blend_multi()returns positional colours). Thegeom_segment_interactivearrow layer’s data contain only the two over-ceiling cases (Las Vegas 2017, Waukesha 2021), so itsscale_color_manualsaw two factor levels and assigned the first two palette colours positionally. Waukesha got the pistol colour; Las Vegas happened to get rifle, correctly, by luck. Confirmed by decoding the girafe SVG: Waukesha<line>stroke#C97578= pistol dot fill, vehicle dots are#697BC8. - Dropped points (found while fixing the above).
geom_jitter_interactivejittered x as well as y (y is already jittered by hand intoweapon_primary_jitter). Withscale_x_continuous(limits = c(0, ceiling), expand = c(0,0)), any zero-count event jittered below 0 was removed: 95 rows from the fatalities panel (of 205 events with 0 killed) and 71 from the wounded panel (of 130 with 0 wounded). Which points vanished depended on RNG state, so Hunter’s Windows render and Peter’s Mac render disagreed on dot counts. Pre-existing bug, present on the live site since the plot was created. - Toolbar icons. ggiraph ≥ 0.9 moved the download-PNG and fullscreen buttons into the
misctoolbar group;opts_toolbar(saveaspng = FALSE)no longer hides them. Fix ishidden = c("selection", "zoom", "misc").
Changes
PROJ_activeattack_graphics/code/plots_cartesian.R, generate_weapon_plot(): - weapon_pal <- setNames(fatality_weap_pal[seq_along(weapon_lvls)], weapon_lvls) with a stopifnot length guard; all three scale calls use it. - Both geom_jitter_interactive → geom_point_interactive. - opts_toolbar(saveaspng = FALSE, hidden = c("selection", "zoom", "misc")) here and in generate_kill_yr_plot(), generate_wound_killed_plot().
PROJ_activeattack_graphics/code/0_packages.R, create_interactive_map(): same opts_toolbar change.
Regenerated: bivar_kill_weapon.{html,png}, bivar_kill_year.html, bivar_wound_kill.html, bicol_map_attackxkilled.html. Static PNGs whose content did not change (bivar_kill_yr.png, bivar_wound_kill.png, bicol_map_attackxkilled.png) were restored/left at Hunter’s versions to avoid byte churn. Rendered with scratch scripts that evaluate only the affected blocks of plots_cartesian.R / plots_geospatial.R (not the full scripts, which also rebuild the gif/mp4).
Copied to PROJ_activeattack_website/www/ (byte-identical, cmp-verified). 0_set_up.R could not be sourced from Rscript because the repo’s renv activates and has no pacman; used plain cp instead — equivalent to update_aa_graphics().
Verification
- Decoded girafe JSON → SVG for all four widgets:
"hidden":["selection","zoom","misc","saveaspng"], zero external_files/refs, sizes 0.46–0.74 MB (self-contained). - Weapon widget: 1,254 circles = 2 × 628 events − 2 (the two > 60-wounded arrow cases, excluded from the wounded axis by design); 628 distinct
data-ids. Both arrow strokes match their row’s dot fill. - Viewed regenerated PNG: zero columns solid at x = 0 in both panels; vehicle arrow blue.
- Live after deploy: same checks against
https://activeattackdata.org/www/*.htmlpass.
Environment notes
- Peter’s Mac: R 4.5.1, ggplot2 4.0.3, ggiraph 0.9.1; Hunter rendered with ggiraph 0.9.6. Widgets from either work; bytes differ. Neither
DATA_aanor graphics has a lockfile. saveWidget(selfcontained = TRUE)leaves a sibling<name>_files/dir behind each run. Those dirs have been tracked in the graphics repo since 2024-11 and now hold both 0.8.10 and 0.9.4 ggiraph libs (~2 MB dead weight) plus a trackedoutput/.DS_Store. My render’sgirafe-binding-0.9.1leftovers were deleted before commit. Untracking the folders is a deletion → needs Peter’s approval.pacmanauto-installedtidytexton first run (was missing locally).ghCLI is not installed; deploy verified by fetchingorigin/gh-pagesand curling the live widgets.
Open items (carried on bob.md)
- Untrack
output/*_files/+output/.DS_Storein graphics; makesave_girafe_widget()delete the sibling dir after saving. - Fact-sheet numbers hand-typed; compute from data during the overhaul.
- Orphaned files in website
data/andwww/. - Pin package versions across the three repos (R runner 4.2.0 / lock 4.3.3 / Mac 4.5.1; ggiraph 0.9.1 vs 0.9.6).
- Remove defunct
PROJ_activeattack_app(local + GitHub) — needs explicit approval. - Visual overhaul before December 2026 ALERRT conference.
Victims-roster item from the orientation log is closed: Hunter added the 2025 memorial list (62 names, total 1,447) and regenerated the scroll; deployed 19:07 UTC.