NZIPL · CVCE
Net Zero Industrial Policy Lab · Johns Hopkins SAIS REFERENCE & ARCHIVE

CVCE Archive

Reference material and superseded viewer formats kept for provenance: the team Claude Kit, the pipeline command reference, project documentation, earlier predicted-competitiveness studies, and the standalone ORBIS / sankey / dendrite viewers that the Explorer's module browser replaced.

Everything current lives on the Clean Value Chain Explorer →

Shared knowledge base maintained by Gilberto García-Vázquez. Loads automatically into Claude Code sessions — data source conventions, API patterns, design tokens, and hard-won gotchas so the team doesn't rediscover the same issues independently.

github: Gilix/nzipl-claude-kit
NZIPL Claude Kit
Clone the repo and open with Claude Code — CLAUDE.md loads automatically. Covers the full Lab toolkit: OEC and DataMexico API patterns, sprint structure, deliverable templates, design system, and running discoveries log.
Skills (invoke via /skill-name)
/nzipl-design /naics-hs-matching /gather-cleantech-greenfield /gather-ev-greenfield /audit-naics-hs /enrich-fdi
Known Gotchas
OEC API: HS6 ID padding — strip leading digits: str(id)[-6:]
OEC Cloudflare: Requires browser User-Agent header or gets 403
DataMexico /data: Silently drops manufacturing sectors 31-33 — use /stats/rca
BACI 2022: HS6 870839 (braking systems) missing — fall back to baci_a_02
FDI Markets: Investment totals include multi-phase projects — press releases cite initial phase only
Design system: Kit uses CICE theme (#56a360) — different from Atlas (#073309)
Data Sources & Auth
OEC: Bearer token + X-API-KEY + token param + User-Agent
DataMexico: economia.gob.mx/datamexico/api/ (legacy api.datamexico.org deprecated)
BACI / CVCE: ~/Documents/R/data/BACI/ — outside repo
BNEF: Pre-compiled JSON — no API
OSM: earth-osm — transmission lines, substations, generators
Glossary Highlights
Play · Play Cards · Constraint Maps
Binding constraint · Gating requirement
Ubiquity · Diversity · ECI · PCI

Reference for rebuilding atlases, rendering panels, and understanding the data cross-walk. All commands run from the project root.

Country & Global Atlases
Full Country Atlas (10 techs)
Rscript scripts/atlas/build_country_atlas.R \ --iso IND --name India Rscript scripts/atlas/build_country_atlas.R \ --iso BRA --name Brazil Rscript scripts/atlas/build_country_atlas.R \ --iso VNM --name Vietnam Rscript scripts/atlas/build_country_atlas.R \ --iso MEX --name Mexico
python3 scripts/render/inline_libs.py \ analysis/atlas/India_Atlas_of_the_Clean_Industrial_Base.html
Outputs to analysis/atlas/{Country}_Atlas_of_the_Clean_Industrial_Base.html · inline_libs.py embeds D3 + topojson + world atlas (offline-capable)
Single-Tech Sheet & Global Atlas
# Single tech × country sheet Rscript scripts/atlas/build_country_atlas.R \ --iso JPN --name Japan \ --tech Nuclear \ --outdir analysis/atlas/sheets python3 scripts/render/inline_libs.py \ analysis/atlas/sheets/Nuclear_Japan_*.html # Global Atlas (13 cases) Rscript scripts/atlas/build_global_atlas.R python3 scripts/render/inline_libs.py \ analysis/atlas/Global_Atlas_of_the_Clean_Industrial_Base.html
Sheets: analysis/atlas/sheets/{Tech}_{Country}_Atlas_*.html
Supported ISOs: IND BRA JPN KOR VNM MEX ESP (extend FLAG_MAP for others)
Module Panel Rendering
All 8 panels for a case
# 8 panels: radar, pc_scatterplot, trade_timeline, # trade_composition, tech_tree, sankey, # trade_map, activity_map, pc_scatter Rscript scripts/render/render_case_panels.R \ --iso IND --tech Solar Rscript scripts/render/render_case_panels.R \ --iso BRA --tech Batteries Rscript scripts/render/render_case_panels.R \ --iso KOR --tech "Nuclear"
Output: analysis/{module}/{Country}/{Tech}_{Country}_{module}.html
tech_tree: analysis/tech_tree/{Tech}_tech_tree.html (country-independent, skip if exists)
Specific panel & activity map refresh
# Single panel type only Rscript scripts/render/render_case_panels.R \ --iso JPN --tech Wind \ --panels activity_map # After expanding S&P firm data: # Rebuild activity maps for all countries for iso in IND BRA JPN KOR VNM MEX ESP; do for tech in Solar Nuclear Batteries ...; do Rscript scripts/render/render_case_panels.R \ --iso $iso --tech "$tech" \ --panels activity_map done done
--panels accepts comma-separated list: radar,sankey,trade_map
Data Pipeline & Cross-Product Concordance
Rebuild firm data (S&P)
# Expand to new countries in FOCAL list, # then rebuild activity maps Rscript scripts/build_data/08d_build_sp_firms.R # Current coverage: BRA IND JPN KOR VNM MEX ESP # 7 countries · 21,832 city-level rows # Geocoded via maps::world.cities
Source: data/sp/sp_company_naics_hs_cleaned.xlsx (gitignored, 62MB)
Output: data/sp/sp_firms_geocoded.parquet
Dataset scope
BACI trade1995–2024 · ~200 countries · HS6 · KUSD
Green dictionary605 HS6 codes × 10 techs · stage/role/shap_category
PC scores155 countries × 10 techs × 2003–2024
SHAP features402 HS6 × tech entries · 5 categories · global avg
EXIOBASE IO9,800×9,800 A-matrix · leontief + direct use shares
S&P firms21,832 rows · 7 countries · geocoded cities
Dendrite edges913 edges × 10 techs · HS6 value chain tree
HS revision windowHS92(1995) · HS96–HS22 non-overlapping
Cross-Product Concordance
HS6 classification hierarchy
HS6 → shap_categoryChemicals / Electronics / Machinery / Metals / Ind.Materials
HS6 → stageUpstream / Midstream / Downstream / Final Product
HS6 → roleRaw Mat. / Processed Mat. / Process Equip. / Product Comp. / Final Product
HS6 → NACE4via naics6_nace crosswalk (08c_build_naics_crosswalk.R)
HS6 → NAICS6S&P firm matching · NZIPL naics-hs-matching skill
HS6 → EXIOBASEexiobase_product · leontief_use_share · direct_use_share
Master file: data/green_dict/green_dictionary.csv (605 rows, 20 columns)
Capability radar pipeline
SHAP weightspc_features.csv → sum shap_mean_z by category → renorm (tech-specific, not country)
Country RCApc_rca.parquet · Balassa formula · country × tech × category × year
ClassificationWP-4 3×3: CRIT GAP / GAP / BUILD / STRENGTH / LOW PRIORITY
SHAP-RCA scatterproduct-level RCA (focal/world share ratio) × SHAP mean|z| per HS code
Macro featuresfdi_z · trade_z · tariff_z · gdp_z · industry_gdp_z · mfg_z (excluded from radar)

Project documentation plus older standalone viewer formats — ORBIS firm maps, sankey diagrams, and value chain dendrites. Superseded for most use cases by the Visual Module Browser on the Explorer.

Project Documentation
Predicted Competitiveness & Methodology — Archived

Earlier PC/ML material moved out of §03 for focus — the standalone competitiveness scatter, notes superseded by the capability-gap arc, and secondary methodology.

Combined View
ALL TECHS
Combined Firm Viewer — local only
All 10 technologies on one map — firm locations by stage · ORBIS. Not published: 128 MB exceeds the GitHub Pages file limit. Build locally at analysis/orbis/orbis_viewer_combined.html.