riksdagsmonitor 0.8.14 → 0.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/cia/dashboard-init.d.ts +26 -0
- package/dist/lib/cia/dashboard-init.d.ts.map +1 -0
- package/dist/lib/cia/dashboard-init.js +108 -0
- package/dist/lib/cia/dashboard-init.js.map +1 -0
- package/dist/lib/cia/data-loader.d.ts +408 -0
- package/dist/lib/cia/data-loader.d.ts.map +1 -0
- package/dist/lib/cia/data-loader.js +867 -0
- package/dist/lib/cia/data-loader.js.map +1 -0
- package/dist/lib/cia/election-predictions.d.ts +78 -0
- package/dist/lib/cia/election-predictions.d.ts.map +1 -0
- package/dist/lib/cia/election-predictions.js +259 -0
- package/dist/lib/cia/election-predictions.js.map +1 -0
- package/dist/lib/cia/i18n-translations.d.ts +111 -0
- package/dist/lib/cia/i18n-translations.d.ts.map +1 -0
- package/dist/lib/cia/i18n-translations.js +619 -0
- package/dist/lib/cia/i18n-translations.js.map +1 -0
- package/dist/lib/cia/visualizations.d.ts +64 -0
- package/dist/lib/cia/visualizations.d.ts.map +1 -0
- package/dist/lib/cia/visualizations.js +662 -0
- package/dist/lib/cia/visualizations.js.map +1 -0
- package/dist/lib/dashboards/anomaly-detection.d.ts +44 -0
- package/dist/lib/dashboards/anomaly-detection.d.ts.map +1 -0
- package/dist/lib/dashboards/anomaly-detection.js +1017 -0
- package/dist/lib/dashboards/anomaly-detection.js.map +1 -0
- package/dist/lib/dashboards/coalition-dashboard.d.ts +36 -0
- package/dist/lib/dashboards/coalition-dashboard.d.ts.map +1 -0
- package/dist/lib/dashboards/coalition-dashboard.js +629 -0
- package/dist/lib/dashboards/coalition-dashboard.js.map +1 -0
- package/dist/lib/dashboards/coalition-loader.d.ts +43 -0
- package/dist/lib/dashboards/coalition-loader.d.ts.map +1 -0
- package/dist/lib/dashboards/coalition-loader.js +665 -0
- package/dist/lib/dashboards/coalition-loader.js.map +1 -0
- package/dist/lib/dashboards/committees-dashboard.d.ts +23 -0
- package/dist/lib/dashboards/committees-dashboard.d.ts.map +1 -0
- package/dist/lib/dashboards/committees-dashboard.js +886 -0
- package/dist/lib/dashboards/committees-dashboard.js.map +1 -0
- package/dist/lib/dashboards/election-cycle.d.ts +62 -0
- package/dist/lib/dashboards/election-cycle.d.ts.map +1 -0
- package/dist/lib/dashboards/election-cycle.js +484 -0
- package/dist/lib/dashboards/election-cycle.js.map +1 -0
- package/dist/lib/dashboards/ministry-dashboard.d.ts +46 -0
- package/dist/lib/dashboards/ministry-dashboard.d.ts.map +1 -0
- package/dist/lib/dashboards/ministry-dashboard.js +1114 -0
- package/dist/lib/dashboards/ministry-dashboard.js.map +1 -0
- package/dist/lib/dashboards/party-dashboard.d.ts +56 -0
- package/dist/lib/dashboards/party-dashboard.d.ts.map +1 -0
- package/dist/lib/dashboards/party-dashboard.js +981 -0
- package/dist/lib/dashboards/party-dashboard.js.map +1 -0
- package/dist/lib/dashboards/politician-dashboard.d.ts +41 -0
- package/dist/lib/dashboards/politician-dashboard.d.ts.map +1 -0
- package/dist/lib/dashboards/politician-dashboard.js +611 -0
- package/dist/lib/dashboards/politician-dashboard.js.map +1 -0
- package/dist/lib/dashboards/pre-election.d.ts +64 -0
- package/dist/lib/dashboards/pre-election.d.ts.map +1 -0
- package/dist/lib/dashboards/pre-election.js +604 -0
- package/dist/lib/dashboards/pre-election.js.map +1 -0
- package/dist/lib/dashboards/risk-dashboard.d.ts +37 -0
- package/dist/lib/dashboards/risk-dashboard.d.ts.map +1 -0
- package/dist/lib/dashboards/risk-dashboard.js +863 -0
- package/dist/lib/dashboards/risk-dashboard.js.map +1 -0
- package/dist/lib/dashboards/seasonal-patterns.d.ts +24 -0
- package/dist/lib/dashboards/seasonal-patterns.d.ts.map +1 -0
- package/dist/lib/dashboards/seasonal-patterns.js +535 -0
- package/dist/lib/dashboards/seasonal-patterns.js.map +1 -0
- package/dist/lib/dashboards/stats-loader.d.ts +35 -0
- package/dist/lib/dashboards/stats-loader.d.ts.map +1 -0
- package/dist/lib/dashboards/stats-loader.js +145 -0
- package/dist/lib/dashboards/stats-loader.js.map +1 -0
- package/dist/lib/shared/chart-factory.d.ts.map +1 -0
- package/dist/lib/shared/chart-factory.js.map +1 -0
- package/dist/lib/shared/data-loader.d.ts.map +1 -0
- package/dist/lib/shared/data-loader.js.map +1 -0
- package/dist/lib/shared/dom-utils.d.ts.map +1 -0
- package/dist/lib/shared/dom-utils.js.map +1 -0
- package/dist/lib/shared/error-boundary.d.ts.map +1 -0
- package/dist/lib/shared/error-boundary.js.map +1 -0
- package/dist/lib/shared/fallback-ui.d.ts.map +1 -0
- package/dist/lib/shared/fallback-ui.js.map +1 -0
- package/dist/lib/shared/index.d.ts.map +1 -0
- package/dist/lib/shared/index.js.map +1 -0
- package/dist/lib/shared/logger.d.ts.map +1 -0
- package/dist/lib/shared/logger.js.map +1 -0
- package/dist/lib/shared/register-globals.d.ts +14 -0
- package/dist/lib/shared/register-globals.d.ts.map +1 -0
- package/dist/lib/shared/register-globals.js +21 -0
- package/dist/lib/shared/register-globals.js.map +1 -0
- package/dist/lib/shared/theme.d.ts.map +1 -0
- package/dist/lib/shared/theme.js.map +1 -0
- package/dist/lib/shared/types.d.ts.map +1 -0
- package/dist/lib/shared/types.js.map +1 -0
- package/dist/lib/ui/back-to-top.d.ts +13 -0
- package/dist/lib/ui/back-to-top.d.ts.map +1 -0
- package/dist/lib/ui/back-to-top.js +48 -0
- package/dist/lib/ui/back-to-top.js.map +1 -0
- package/dist/scripts/ai-analysis/coalition-detector.d.ts +28 -0
- package/dist/scripts/ai-analysis/coalition-detector.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/coalition-detector.js +242 -0
- package/dist/scripts/ai-analysis/coalition-detector.js.map +1 -0
- package/dist/scripts/ai-analysis/dashboard-analyzer.d.ts +73 -0
- package/dist/scripts/ai-analysis/dashboard-analyzer.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/dashboard-analyzer.js +511 -0
- package/dist/scripts/ai-analysis/dashboard-analyzer.js.map +1 -0
- package/dist/scripts/ai-analysis/document-analyzer.d.ts +196 -0
- package/dist/scripts/ai-analysis/document-analyzer.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/document-analyzer.js +1001 -0
- package/dist/scripts/ai-analysis/document-analyzer.js.map +1 -0
- package/dist/scripts/ai-analysis/domains/index.d.ts +15 -0
- package/dist/scripts/ai-analysis/domains/index.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/domains/index.js +494 -0
- package/dist/scripts/ai-analysis/domains/index.js.map +1 -0
- package/dist/scripts/ai-analysis/helpers.d.ts +43 -0
- package/dist/scripts/ai-analysis/helpers.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/helpers.js +79 -0
- package/dist/scripts/ai-analysis/helpers.js.map +1 -0
- package/dist/scripts/ai-analysis/index.d.ts +15 -0
- package/dist/scripts/ai-analysis/index.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/index.js +14 -0
- package/dist/scripts/ai-analysis/index.js.map +1 -0
- package/dist/scripts/ai-analysis/pipeline.d.ts +41 -0
- package/dist/scripts/ai-analysis/pipeline.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/pipeline.js +208 -0
- package/dist/scripts/ai-analysis/pipeline.js.map +1 -0
- package/dist/scripts/ai-analysis/political-significance.d.ts +63 -0
- package/dist/scripts/ai-analysis/political-significance.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/political-significance.js +227 -0
- package/dist/scripts/ai-analysis/political-significance.js.map +1 -0
- package/dist/scripts/ai-analysis/quality-assessor.d.ts +104 -0
- package/dist/scripts/ai-analysis/quality-assessor.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/quality-assessor.js +554 -0
- package/dist/scripts/ai-analysis/quality-assessor.js.map +1 -0
- package/dist/scripts/ai-analysis/swot/index.d.ts +56 -0
- package/dist/scripts/ai-analysis/swot/index.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/swot/index.js +360 -0
- package/dist/scripts/ai-analysis/swot/index.js.map +1 -0
- package/dist/scripts/ai-analysis/swot/placeholders.d.ts +30 -0
- package/dist/scripts/ai-analysis/swot/placeholders.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/swot/placeholders.js +381 -0
- package/dist/scripts/ai-analysis/swot/placeholders.js.map +1 -0
- package/dist/scripts/ai-analysis/types.d.ts +333 -0
- package/dist/scripts/ai-analysis/types.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/types.js +19 -0
- package/dist/scripts/ai-analysis/types.js.map +1 -0
- package/dist/scripts/ai-analysis/visualisation/index.d.ts +15 -0
- package/dist/scripts/ai-analysis/visualisation/index.d.ts.map +1 -0
- package/dist/scripts/ai-analysis/visualisation/index.js +179 -0
- package/dist/scripts/ai-analysis/visualisation/index.js.map +1 -0
- package/dist/scripts/analysis-framework/cross-reference.d.ts +35 -0
- package/dist/scripts/analysis-framework/cross-reference.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/cross-reference.js +290 -0
- package/dist/scripts/analysis-framework/cross-reference.js.map +1 -0
- package/dist/scripts/analysis-framework/index.d.ts +79 -0
- package/dist/scripts/analysis-framework/index.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/index.js +133 -0
- package/dist/scripts/analysis-framework/index.js.map +1 -0
- package/dist/scripts/analysis-framework/lenses/citizen.d.ts +29 -0
- package/dist/scripts/analysis-framework/lenses/citizen.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/lenses/citizen.js +220 -0
- package/dist/scripts/analysis-framework/lenses/citizen.js.map +1 -0
- package/dist/scripts/analysis-framework/lenses/economic.d.ts +29 -0
- package/dist/scripts/analysis-framework/lenses/economic.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/lenses/economic.js +227 -0
- package/dist/scripts/analysis-framework/lenses/economic.js.map +1 -0
- package/dist/scripts/analysis-framework/lenses/government.d.ts +32 -0
- package/dist/scripts/analysis-framework/lenses/government.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/lenses/government.js +265 -0
- package/dist/scripts/analysis-framework/lenses/government.js.map +1 -0
- package/dist/scripts/analysis-framework/lenses/international.d.ts +29 -0
- package/dist/scripts/analysis-framework/lenses/international.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/lenses/international.js +248 -0
- package/dist/scripts/analysis-framework/lenses/international.js.map +1 -0
- package/dist/scripts/analysis-framework/lenses/media.d.ts +29 -0
- package/dist/scripts/analysis-framework/lenses/media.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/lenses/media.js +211 -0
- package/dist/scripts/analysis-framework/lenses/media.js.map +1 -0
- package/dist/scripts/analysis-framework/lenses/opposition.d.ts +29 -0
- package/dist/scripts/analysis-framework/lenses/opposition.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/lenses/opposition.js +234 -0
- package/dist/scripts/analysis-framework/lenses/opposition.js.map +1 -0
- package/dist/scripts/analysis-framework/methodology-types.d.ts +309 -0
- package/dist/scripts/analysis-framework/methodology-types.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/methodology-types.js +38 -0
- package/dist/scripts/analysis-framework/methodology-types.js.map +1 -0
- package/dist/scripts/analysis-framework/political-classification.d.ts +58 -0
- package/dist/scripts/analysis-framework/political-classification.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/political-classification.js +414 -0
- package/dist/scripts/analysis-framework/political-classification.js.map +1 -0
- package/dist/scripts/analysis-framework/political-risk-assessment.d.ts +74 -0
- package/dist/scripts/analysis-framework/political-risk-assessment.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/political-risk-assessment.js +656 -0
- package/dist/scripts/analysis-framework/political-risk-assessment.js.map +1 -0
- package/dist/scripts/analysis-framework/political-threat-analysis.d.ts +65 -0
- package/dist/scripts/analysis-framework/political-threat-analysis.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/political-threat-analysis.js +553 -0
- package/dist/scripts/analysis-framework/political-threat-analysis.js.map +1 -0
- package/dist/scripts/analysis-framework/significance-scorer.d.ts +62 -0
- package/dist/scripts/analysis-framework/significance-scorer.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/significance-scorer.js +196 -0
- package/dist/scripts/analysis-framework/significance-scorer.js.map +1 -0
- package/dist/scripts/analysis-framework/types.d.ts +138 -0
- package/dist/scripts/analysis-framework/types.d.ts.map +1 -0
- package/dist/scripts/analysis-framework/types.js +12 -0
- package/dist/scripts/analysis-framework/types.js.map +1 -0
- package/dist/scripts/analysis-reader.d.ts +240 -0
- package/dist/scripts/analysis-reader.d.ts.map +1 -0
- package/dist/scripts/analysis-reader.js +495 -0
- package/dist/scripts/analysis-reader.js.map +1 -0
- package/dist/scripts/article-quality-enhancer.d.ts +148 -0
- package/dist/scripts/article-quality-enhancer.d.ts.map +1 -0
- package/dist/scripts/article-quality-enhancer.js +430 -0
- package/dist/scripts/article-quality-enhancer.js.map +1 -0
- package/dist/scripts/article-template/constants.d.ts +104 -0
- package/dist/scripts/article-template/constants.d.ts.map +1 -0
- package/dist/scripts/article-template/constants.js +225 -0
- package/dist/scripts/article-template/constants.js.map +1 -0
- package/dist/scripts/article-template/helpers.d.ts +83 -0
- package/dist/scripts/article-template/helpers.d.ts.map +1 -0
- package/dist/scripts/article-template/helpers.js +236 -0
- package/dist/scripts/article-template/helpers.js.map +1 -0
- package/dist/scripts/article-template/index.d.ts +39 -0
- package/dist/scripts/article-template/index.d.ts.map +1 -0
- package/dist/scripts/article-template/index.js +37 -0
- package/dist/scripts/article-template/index.js.map +1 -0
- package/dist/scripts/article-template/registry.d.ts +64 -0
- package/dist/scripts/article-template/registry.d.ts.map +1 -0
- package/dist/scripts/article-template/registry.js +405 -0
- package/dist/scripts/article-template/registry.js.map +1 -0
- package/dist/scripts/article-template/template.d.ts +18 -0
- package/dist/scripts/article-template/template.d.ts.map +1 -0
- package/dist/scripts/article-template/template.js +359 -0
- package/dist/scripts/article-template/template.js.map +1 -0
- package/dist/scripts/article-template/types.d.ts +90 -0
- package/dist/scripts/article-template/types.d.ts.map +1 -0
- package/dist/scripts/article-template/types.js +96 -0
- package/dist/scripts/article-template/types.js.map +1 -0
- package/dist/scripts/article-template.d.ts +18 -0
- package/dist/scripts/article-template.d.ts.map +1 -0
- package/dist/scripts/article-template.js +18 -0
- package/dist/scripts/article-template.js.map +1 -0
- package/dist/scripts/catalog-downloaded-data.d.ts +66 -0
- package/dist/scripts/catalog-downloaded-data.d.ts.map +1 -0
- package/dist/scripts/catalog-downloaded-data.js +239 -0
- package/dist/scripts/catalog-downloaded-data.js.map +1 -0
- package/dist/scripts/check-cia-schema-updates.d.ts +186 -0
- package/dist/scripts/check-cia-schema-updates.d.ts.map +1 -0
- package/dist/scripts/check-cia-schema-updates.js +363 -0
- package/dist/scripts/check-cia-schema-updates.js.map +1 -0
- package/dist/scripts/data-transformers/calendar.d.ts +16 -0
- package/dist/scripts/data-transformers/calendar.d.ts.map +1 -0
- package/dist/scripts/data-transformers/calendar.js +137 -0
- package/dist/scripts/data-transformers/calendar.js.map +1 -0
- package/dist/scripts/data-transformers/constants/committee-names.d.ts +15 -0
- package/dist/scripts/data-transformers/constants/committee-names.d.ts.map +1 -0
- package/dist/scripts/data-transformers/constants/committee-names.js +30 -0
- package/dist/scripts/data-transformers/constants/committee-names.js.map +1 -0
- package/dist/scripts/data-transformers/constants/content-labels-part1.d.ts +11 -0
- package/dist/scripts/data-transformers/constants/content-labels-part1.d.ts.map +1 -0
- package/dist/scripts/data-transformers/constants/content-labels-part1.js +900 -0
- package/dist/scripts/data-transformers/constants/content-labels-part1.js.map +1 -0
- package/dist/scripts/data-transformers/constants/content-labels-part2.d.ts +11 -0
- package/dist/scripts/data-transformers/constants/content-labels-part2.d.ts.map +1 -0
- package/dist/scripts/data-transformers/constants/content-labels-part2.js +900 -0
- package/dist/scripts/data-transformers/constants/content-labels-part2.js.map +1 -0
- package/dist/scripts/data-transformers/constants/content-labels.d.ts +13 -0
- package/dist/scripts/data-transformers/constants/content-labels.d.ts.map +1 -0
- package/dist/scripts/data-transformers/constants/content-labels.js +18 -0
- package/dist/scripts/data-transformers/constants/content-labels.js.map +1 -0
- package/dist/scripts/data-transformers/constants/index.d.ts +15 -0
- package/dist/scripts/data-transformers/constants/index.d.ts.map +1 -0
- package/dist/scripts/data-transformers/constants/index.js +15 -0
- package/dist/scripts/data-transformers/constants/index.js.map +1 -0
- package/dist/scripts/data-transformers/constants/locale-map.d.ts +13 -0
- package/dist/scripts/data-transformers/constants/locale-map.d.ts.map +1 -0
- package/dist/scripts/data-transformers/constants/locale-map.js +17 -0
- package/dist/scripts/data-transformers/constants/locale-map.js.map +1 -0
- package/dist/scripts/data-transformers/constants.d.ts +14 -0
- package/dist/scripts/data-transformers/constants.d.ts.map +1 -0
- package/dist/scripts/data-transformers/constants.js +14 -0
- package/dist/scripts/data-transformers/constants.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/ai-mindmap-analyzer.d.ts +64 -0
- package/dist/scripts/data-transformers/content-generators/ai-mindmap-analyzer.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/ai-mindmap-analyzer.js +805 -0
- package/dist/scripts/data-transformers/content-generators/ai-mindmap-analyzer.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/ai-swot-analyzer.d.ts +89 -0
- package/dist/scripts/data-transformers/content-generators/ai-swot-analyzer.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/ai-swot-analyzer.js +667 -0
- package/dist/scripts/data-transformers/content-generators/ai-swot-analyzer.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/cia-overview-section.d.ts +50 -0
- package/dist/scripts/data-transformers/content-generators/cia-overview-section.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/cia-overview-section.js +310 -0
- package/dist/scripts/data-transformers/content-generators/cia-overview-section.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/committee.d.ts +12 -0
- package/dist/scripts/data-transformers/content-generators/committee.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/committee.js +247 -0
- package/dist/scripts/data-transformers/content-generators/committee.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/dashboard-section.d.ts +124 -0
- package/dist/scripts/data-transformers/content-generators/dashboard-section.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/dashboard-section.js +564 -0
- package/dist/scripts/data-transformers/content-generators/dashboard-section.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/economic-dashboard-section.d.ts +82 -0
- package/dist/scripts/data-transformers/content-generators/economic-dashboard-section.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/economic-dashboard-section.js +321 -0
- package/dist/scripts/data-transformers/content-generators/economic-dashboard-section.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/generic.d.ts +12 -0
- package/dist/scripts/data-transformers/content-generators/generic.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/generic.js +295 -0
- package/dist/scripts/data-transformers/content-generators/generic.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/index.d.ts +56 -0
- package/dist/scripts/data-transformers/content-generators/index.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/index.js +45 -0
- package/dist/scripts/data-transformers/content-generators/index.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/interpellations.d.ts +12 -0
- package/dist/scripts/data-transformers/content-generators/interpellations.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/interpellations.js +124 -0
- package/dist/scripts/data-transformers/content-generators/interpellations.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/mindmap-section.d.ts +137 -0
- package/dist/scripts/data-transformers/content-generators/mindmap-section.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/mindmap-section.js +286 -0
- package/dist/scripts/data-transformers/content-generators/mindmap-section.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/month-ahead.d.ts +17 -0
- package/dist/scripts/data-transformers/content-generators/month-ahead.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/month-ahead.js +212 -0
- package/dist/scripts/data-transformers/content-generators/month-ahead.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/monthly-review.d.ts +17 -0
- package/dist/scripts/data-transformers/content-generators/monthly-review.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/monthly-review.js +173 -0
- package/dist/scripts/data-transformers/content-generators/monthly-review.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/motions.d.ts +12 -0
- package/dist/scripts/data-transformers/content-generators/motions.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/motions.js +158 -0
- package/dist/scripts/data-transformers/content-generators/motions.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/newsworthiness.d.ts +52 -0
- package/dist/scripts/data-transformers/content-generators/newsworthiness.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/newsworthiness.js +244 -0
- package/dist/scripts/data-transformers/content-generators/newsworthiness.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/propositions.d.ts +12 -0
- package/dist/scripts/data-transformers/content-generators/propositions.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/propositions.js +263 -0
- package/dist/scripts/data-transformers/content-generators/propositions.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/sankey-section.d.ts +92 -0
- package/dist/scripts/data-transformers/content-generators/sankey-section.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/sankey-section.js +257 -0
- package/dist/scripts/data-transformers/content-generators/sankey-section.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/shared.d.ts +81 -0
- package/dist/scripts/data-transformers/content-generators/shared.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/shared.js +913 -0
- package/dist/scripts/data-transformers/content-generators/shared.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/stakeholder-swot-section.d.ts +83 -0
- package/dist/scripts/data-transformers/content-generators/stakeholder-swot-section.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/stakeholder-swot-section.js +219 -0
- package/dist/scripts/data-transformers/content-generators/stakeholder-swot-section.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/swot-section.d.ts +50 -0
- package/dist/scripts/data-transformers/content-generators/swot-section.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/swot-section.js +177 -0
- package/dist/scripts/data-transformers/content-generators/swot-section.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators/week-ahead.d.ts +12 -0
- package/dist/scripts/data-transformers/content-generators/week-ahead.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators/week-ahead.js +332 -0
- package/dist/scripts/data-transformers/content-generators/week-ahead.js.map +1 -0
- package/dist/scripts/data-transformers/content-generators.d.ts +15 -0
- package/dist/scripts/data-transformers/content-generators.d.ts.map +1 -0
- package/dist/scripts/data-transformers/content-generators.js +14 -0
- package/dist/scripts/data-transformers/content-generators.js.map +1 -0
- package/dist/scripts/data-transformers/document-analysis.d.ts +58 -0
- package/dist/scripts/data-transformers/document-analysis.d.ts.map +1 -0
- package/dist/scripts/data-transformers/document-analysis.js +396 -0
- package/dist/scripts/data-transformers/document-analysis.js.map +1 -0
- package/dist/scripts/data-transformers/helpers.d.ts +144 -0
- package/dist/scripts/data-transformers/helpers.d.ts.map +1 -0
- package/dist/scripts/data-transformers/helpers.js +408 -0
- package/dist/scripts/data-transformers/helpers.js.map +1 -0
- package/dist/scripts/data-transformers/index.d.ts +45 -0
- package/dist/scripts/data-transformers/index.d.ts.map +1 -0
- package/dist/scripts/data-transformers/index.js +66 -0
- package/dist/scripts/data-transformers/index.js.map +1 -0
- package/dist/scripts/data-transformers/metadata.d.ts +42 -0
- package/dist/scripts/data-transformers/metadata.d.ts.map +1 -0
- package/dist/scripts/data-transformers/metadata.js +385 -0
- package/dist/scripts/data-transformers/metadata.js.map +1 -0
- package/dist/scripts/data-transformers/policy-analysis.d.ts +105 -0
- package/dist/scripts/data-transformers/policy-analysis.d.ts.map +1 -0
- package/dist/scripts/data-transformers/policy-analysis.js +686 -0
- package/dist/scripts/data-transformers/policy-analysis.js.map +1 -0
- package/dist/scripts/data-transformers/risk-analysis.d.ts +104 -0
- package/dist/scripts/data-transformers/risk-analysis.d.ts.map +1 -0
- package/dist/scripts/data-transformers/risk-analysis.js +279 -0
- package/dist/scripts/data-transformers/risk-analysis.js.map +1 -0
- package/dist/scripts/data-transformers/types.d.ts +260 -0
- package/dist/scripts/data-transformers/types.d.ts.map +1 -0
- package/dist/scripts/data-transformers/types.js +11 -0
- package/dist/scripts/data-transformers/types.js.map +1 -0
- package/dist/scripts/data-transformers.d.ts +23 -0
- package/dist/scripts/data-transformers.d.ts.map +1 -0
- package/dist/scripts/data-transformers.js +35 -0
- package/dist/scripts/data-transformers.js.map +1 -0
- package/dist/scripts/deep-inspection/index.d.ts +55 -0
- package/dist/scripts/deep-inspection/index.d.ts.map +1 -0
- package/dist/scripts/deep-inspection/index.js +66 -0
- package/dist/scripts/deep-inspection/index.js.map +1 -0
- package/dist/scripts/detect-swedish-leakage.d.ts +69 -0
- package/dist/scripts/detect-swedish-leakage.d.ts.map +1 -0
- package/dist/scripts/detect-swedish-leakage.js +417 -0
- package/dist/scripts/detect-swedish-leakage.js.map +1 -0
- package/dist/scripts/editorial-framework.d.ts +121 -0
- package/dist/scripts/editorial-framework.d.ts.map +1 -0
- package/dist/scripts/editorial-framework.js +364 -0
- package/dist/scripts/editorial-framework.js.map +1 -0
- package/dist/scripts/editorial-pillars.d.ts +43 -0
- package/dist/scripts/editorial-pillars.d.ts.map +1 -0
- package/dist/scripts/editorial-pillars.js +215 -0
- package/dist/scripts/editorial-pillars.js.map +1 -0
- package/dist/scripts/extract-news-metadata.d.ts +12 -0
- package/dist/scripts/extract-news-metadata.d.ts.map +1 -0
- package/dist/scripts/extract-news-metadata.js +107 -0
- package/dist/scripts/extract-news-metadata.js.map +1 -0
- package/dist/scripts/extract-vocabulary.d.ts +15 -0
- package/dist/scripts/extract-vocabulary.d.ts.map +1 -0
- package/dist/scripts/extract-vocabulary.js +255 -0
- package/dist/scripts/extract-vocabulary.js.map +1 -0
- package/dist/scripts/fix-article-navigation.d.ts +37 -0
- package/dist/scripts/fix-article-navigation.d.ts.map +1 -0
- package/dist/scripts/fix-article-navigation.js +198 -0
- package/dist/scripts/fix-article-navigation.js.map +1 -0
- package/dist/scripts/fix-keywords-localization.d.ts +18 -0
- package/dist/scripts/fix-keywords-localization.d.ts.map +1 -0
- package/dist/scripts/fix-keywords-localization.js +270 -0
- package/dist/scripts/fix-keywords-localization.js.map +1 -0
- package/dist/scripts/fix-old-articles-branding.d.ts +17 -0
- package/dist/scripts/fix-old-articles-branding.d.ts.map +1 -0
- package/dist/scripts/fix-old-articles-branding.js +229 -0
- package/dist/scripts/fix-old-articles-branding.js.map +1 -0
- package/dist/scripts/generate-news-backport.d.ts +16 -0
- package/dist/scripts/generate-news-backport.d.ts.map +1 -0
- package/dist/scripts/generate-news-backport.js +379 -0
- package/dist/scripts/generate-news-backport.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/ai-analysis-pipeline.d.ts +124 -0
- package/dist/scripts/generate-news-enhanced/ai-analysis-pipeline.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/ai-analysis-pipeline.js +529 -0
- package/dist/scripts/generate-news-enhanced/ai-analysis-pipeline.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/analysis-cache.d.ts +59 -0
- package/dist/scripts/generate-news-enhanced/analysis-cache.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/analysis-cache.js +116 -0
- package/dist/scripts/generate-news-enhanced/analysis-cache.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/analysis-labels.d.ts +58 -0
- package/dist/scripts/generate-news-enhanced/analysis-labels.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/analysis-labels.js +144 -0
- package/dist/scripts/generate-news-enhanced/analysis-labels.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/config.d.ts +57 -0
- package/dist/scripts/generate-news-enhanced/config.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/config.js +286 -0
- package/dist/scripts/generate-news-enhanced/config.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/generators.d.ts +119 -0
- package/dist/scripts/generate-news-enhanced/generators.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/generators.js +2108 -0
- package/dist/scripts/generate-news-enhanced/generators.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/helpers.d.ts +123 -0
- package/dist/scripts/generate-news-enhanced/helpers.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/helpers.js +438 -0
- package/dist/scripts/generate-news-enhanced/helpers.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/index.d.ts +19 -0
- package/dist/scripts/generate-news-enhanced/index.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/index.js +221 -0
- package/dist/scripts/generate-news-enhanced/index.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/swot-analyzer.d.ts +35 -0
- package/dist/scripts/generate-news-enhanced/swot-analyzer.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/swot-analyzer.js +1179 -0
- package/dist/scripts/generate-news-enhanced/swot-analyzer.js.map +1 -0
- package/dist/scripts/generate-news-enhanced/types.d.ts +34 -0
- package/dist/scripts/generate-news-enhanced/types.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced/types.js +9 -0
- package/dist/scripts/generate-news-enhanced/types.js.map +1 -0
- package/dist/scripts/generate-news-enhanced.d.ts +25 -0
- package/dist/scripts/generate-news-enhanced.d.ts.map +1 -0
- package/dist/scripts/generate-news-enhanced.js +37 -0
- package/dist/scripts/generate-news-enhanced.js.map +1 -0
- package/dist/scripts/generate-news-indexes/constants.d.ts +20 -0
- package/dist/scripts/generate-news-indexes/constants.d.ts.map +1 -0
- package/dist/scripts/generate-news-indexes/constants.js +308 -0
- package/dist/scripts/generate-news-indexes/constants.js.map +1 -0
- package/dist/scripts/generate-news-indexes/helpers.d.ts +73 -0
- package/dist/scripts/generate-news-indexes/helpers.d.ts.map +1 -0
- package/dist/scripts/generate-news-indexes/helpers.js +352 -0
- package/dist/scripts/generate-news-indexes/helpers.js.map +1 -0
- package/dist/scripts/generate-news-indexes/index.d.ts +20 -0
- package/dist/scripts/generate-news-indexes/index.d.ts.map +1 -0
- package/dist/scripts/generate-news-indexes/index.js +75 -0
- package/dist/scripts/generate-news-indexes/index.js.map +1 -0
- package/dist/scripts/generate-news-indexes/template.d.ts +25 -0
- package/dist/scripts/generate-news-indexes/template.d.ts.map +1 -0
- package/dist/scripts/generate-news-indexes/template.js +644 -0
- package/dist/scripts/generate-news-indexes/template.js.map +1 -0
- package/dist/scripts/generate-news-indexes/types.d.ts +96 -0
- package/dist/scripts/generate-news-indexes/types.d.ts.map +1 -0
- package/dist/scripts/generate-news-indexes/types.js +9 -0
- package/dist/scripts/generate-news-indexes/types.js.map +1 -0
- package/dist/scripts/generate-news-indexes.d.ts +20 -0
- package/dist/scripts/generate-news-indexes.d.ts.map +1 -0
- package/dist/scripts/generate-news-indexes.js +19 -0
- package/dist/scripts/generate-news-indexes.js.map +1 -0
- package/dist/scripts/generate-rss.d.ts +48 -0
- package/dist/scripts/generate-rss.d.ts.map +1 -0
- package/dist/scripts/generate-rss.js +299 -0
- package/dist/scripts/generate-rss.js.map +1 -0
- package/dist/scripts/generate-sitemap-html.d.ts +79 -0
- package/dist/scripts/generate-sitemap-html.d.ts.map +1 -0
- package/dist/scripts/generate-sitemap-html.js +878 -0
- package/dist/scripts/generate-sitemap-html.js.map +1 -0
- package/dist/scripts/generate-sitemap.d.ts +23 -0
- package/dist/scripts/generate-sitemap.d.ts.map +1 -0
- package/dist/scripts/generate-sitemap.js +476 -0
- package/dist/scripts/generate-sitemap.js.map +1 -0
- package/dist/scripts/generate-types-from-cia-schemas.d.ts +176 -0
- package/dist/scripts/generate-types-from-cia-schemas.d.ts.map +1 -0
- package/dist/scripts/generate-types-from-cia-schemas.js +318 -0
- package/dist/scripts/generate-types-from-cia-schemas.js.map +1 -0
- package/dist/scripts/government-role-validator.d.ts +65 -0
- package/dist/scripts/government-role-validator.d.ts.map +1 -0
- package/dist/scripts/government-role-validator.js +217 -0
- package/dist/scripts/government-role-validator.js.map +1 -0
- package/dist/scripts/html-utils.d.ts +17 -0
- package/dist/scripts/html-utils.d.ts.map +1 -0
- package/dist/scripts/html-utils.js +29 -0
- package/dist/scripts/html-utils.js.map +1 -0
- package/dist/scripts/load-cia-stats.d.ts +89 -0
- package/dist/scripts/load-cia-stats.d.ts.map +1 -0
- package/dist/scripts/load-cia-stats.js +400 -0
- package/dist/scripts/load-cia-stats.js.map +1 -0
- package/dist/scripts/mcp-client/client.d.ts +73 -0
- package/dist/scripts/mcp-client/client.d.ts.map +1 -0
- package/dist/scripts/mcp-client/client.js +526 -0
- package/dist/scripts/mcp-client/client.js.map +1 -0
- package/dist/scripts/mcp-client/document-types.d.ts +23 -0
- package/dist/scripts/mcp-client/document-types.d.ts.map +1 -0
- package/dist/scripts/mcp-client/document-types.js +62 -0
- package/dist/scripts/mcp-client/document-types.js.map +1 -0
- package/dist/scripts/mcp-client/index.d.ts +34 -0
- package/dist/scripts/mcp-client/index.d.ts.map +1 -0
- package/dist/scripts/mcp-client/index.js +67 -0
- package/dist/scripts/mcp-client/index.js.map +1 -0
- package/dist/scripts/mcp-client/transport.d.ts +32 -0
- package/dist/scripts/mcp-client/transport.d.ts.map +1 -0
- package/dist/scripts/mcp-client/transport.js +102 -0
- package/dist/scripts/mcp-client/transport.js.map +1 -0
- package/dist/scripts/mcp-client.d.ts +18 -0
- package/dist/scripts/mcp-client.d.ts.map +1 -0
- package/dist/scripts/mcp-client.js +18 -0
- package/dist/scripts/mcp-client.js.map +1 -0
- package/dist/scripts/mcp-query-cli.d.ts +25 -0
- package/dist/scripts/mcp-query-cli.d.ts.map +1 -0
- package/dist/scripts/mcp-query-cli.js +66 -0
- package/dist/scripts/mcp-query-cli.js.map +1 -0
- package/dist/scripts/news-types/breaking-news.d.ts +178 -0
- package/dist/scripts/news-types/breaking-news.d.ts.map +1 -0
- package/dist/scripts/news-types/breaking-news.js +428 -0
- package/dist/scripts/news-types/breaking-news.js.map +1 -0
- package/dist/scripts/news-types/committee-reports.d.ts +212 -0
- package/dist/scripts/news-types/committee-reports.d.ts.map +1 -0
- package/dist/scripts/news-types/committee-reports.js +404 -0
- package/dist/scripts/news-types/committee-reports.js.map +1 -0
- package/dist/scripts/news-types/month-ahead.d.ts +71 -0
- package/dist/scripts/news-types/month-ahead.d.ts.map +1 -0
- package/dist/scripts/news-types/month-ahead.js +392 -0
- package/dist/scripts/news-types/month-ahead.js.map +1 -0
- package/dist/scripts/news-types/monthly-review.d.ts +61 -0
- package/dist/scripts/news-types/monthly-review.d.ts.map +1 -0
- package/dist/scripts/news-types/monthly-review.js +417 -0
- package/dist/scripts/news-types/monthly-review.js.map +1 -0
- package/dist/scripts/news-types/motions.d.ts +214 -0
- package/dist/scripts/news-types/motions.d.ts.map +1 -0
- package/dist/scripts/news-types/motions.js +447 -0
- package/dist/scripts/news-types/motions.js.map +1 -0
- package/dist/scripts/news-types/propositions.d.ts +204 -0
- package/dist/scripts/news-types/propositions.d.ts.map +1 -0
- package/dist/scripts/news-types/propositions.js +401 -0
- package/dist/scripts/news-types/propositions.js.map +1 -0
- package/dist/scripts/news-types/week-ahead.d.ts +231 -0
- package/dist/scripts/news-types/week-ahead.d.ts.map +1 -0
- package/dist/scripts/news-types/week-ahead.js +441 -0
- package/dist/scripts/news-types/week-ahead.js.map +1 -0
- package/dist/scripts/news-types/weekly-review/analysis.d.ts +47 -0
- package/dist/scripts/news-types/weekly-review/analysis.d.ts.map +1 -0
- package/dist/scripts/news-types/weekly-review/analysis.js +276 -0
- package/dist/scripts/news-types/weekly-review/analysis.js.map +1 -0
- package/dist/scripts/news-types/weekly-review/data-loader.d.ts +51 -0
- package/dist/scripts/news-types/weekly-review/data-loader.d.ts.map +1 -0
- package/dist/scripts/news-types/weekly-review/data-loader.js +298 -0
- package/dist/scripts/news-types/weekly-review/data-loader.js.map +1 -0
- package/dist/scripts/news-types/weekly-review/generator.d.ts +18 -0
- package/dist/scripts/news-types/weekly-review/generator.d.ts.map +1 -0
- package/dist/scripts/news-types/weekly-review/generator.js +284 -0
- package/dist/scripts/news-types/weekly-review/generator.js.map +1 -0
- package/dist/scripts/news-types/weekly-review/index.d.ts +20 -0
- package/dist/scripts/news-types/weekly-review/index.d.ts.map +1 -0
- package/dist/scripts/news-types/weekly-review/index.js +23 -0
- package/dist/scripts/news-types/weekly-review/index.js.map +1 -0
- package/dist/scripts/news-types/weekly-review/types.d.ts +72 -0
- package/dist/scripts/news-types/weekly-review/types.d.ts.map +1 -0
- package/dist/scripts/news-types/weekly-review/types.js +20 -0
- package/dist/scripts/news-types/weekly-review/types.js.map +1 -0
- package/dist/scripts/news-types/weekly-review/validation.d.ts +10 -0
- package/dist/scripts/news-types/weekly-review/validation.d.ts.map +1 -0
- package/dist/scripts/news-types/weekly-review/validation.js +95 -0
- package/dist/scripts/news-types/weekly-review/validation.js.map +1 -0
- package/dist/scripts/news-types/weekly-review.d.ts +15 -0
- package/dist/scripts/news-types/weekly-review.d.ts.map +1 -0
- package/dist/scripts/news-types/weekly-review.js +14 -0
- package/dist/scripts/news-types/weekly-review.js.map +1 -0
- package/dist/scripts/party-variants.d.ts +23 -0
- package/dist/scripts/party-variants.d.ts.map +1 -0
- package/dist/scripts/party-variants.js +50 -0
- package/dist/scripts/party-variants.js.map +1 -0
- package/dist/scripts/pipeline/index.d.ts +19 -0
- package/dist/scripts/pipeline/index.d.ts.map +1 -0
- package/dist/scripts/pipeline/index.js +17 -0
- package/dist/scripts/pipeline/index.js.map +1 -0
- package/dist/scripts/pipeline/orchestrator.d.ts +56 -0
- package/dist/scripts/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/scripts/pipeline/orchestrator.js +147 -0
- package/dist/scripts/pipeline/orchestrator.js.map +1 -0
- package/dist/scripts/pipeline/types.d.ts +117 -0
- package/dist/scripts/pipeline/types.d.ts.map +1 -0
- package/dist/scripts/pipeline/types.js +13 -0
- package/dist/scripts/pipeline/types.js.map +1 -0
- package/dist/scripts/pipeline/validation.d.ts +66 -0
- package/dist/scripts/pipeline/validation.d.ts.map +1 -0
- package/dist/scripts/pipeline/validation.js +129 -0
- package/dist/scripts/pipeline/validation.js.map +1 -0
- package/dist/scripts/populate-analysis-data.d.ts +41 -0
- package/dist/scripts/populate-analysis-data.d.ts.map +1 -0
- package/dist/scripts/populate-analysis-data.js +255 -0
- package/dist/scripts/populate-analysis-data.js.map +1 -0
- package/dist/scripts/pre-article-analysis/data-downloader.d.ts +80 -0
- package/dist/scripts/pre-article-analysis/data-downloader.d.ts.map +1 -0
- package/dist/scripts/pre-article-analysis/data-downloader.js +230 -0
- package/dist/scripts/pre-article-analysis/data-downloader.js.map +1 -0
- package/dist/scripts/pre-article-analysis/data-persistence.d.ts +141 -0
- package/dist/scripts/pre-article-analysis/data-persistence.d.ts.map +1 -0
- package/dist/scripts/pre-article-analysis/data-persistence.js +345 -0
- package/dist/scripts/pre-article-analysis/data-persistence.js.map +1 -0
- package/dist/scripts/pre-article-analysis/markdown-serializer.d.ts +95 -0
- package/dist/scripts/pre-article-analysis/markdown-serializer.d.ts.map +1 -0
- package/dist/scripts/pre-article-analysis/markdown-serializer.js +648 -0
- package/dist/scripts/pre-article-analysis/markdown-serializer.js.map +1 -0
- package/dist/scripts/pre-article-analysis/pdf-converter.d.ts +58 -0
- package/dist/scripts/pre-article-analysis/pdf-converter.d.ts.map +1 -0
- package/dist/scripts/pre-article-analysis/pdf-converter.js +142 -0
- package/dist/scripts/pre-article-analysis/pdf-converter.js.map +1 -0
- package/dist/scripts/pre-article-analysis.d.ts +41 -0
- package/dist/scripts/pre-article-analysis.d.ts.map +1 -0
- package/dist/scripts/pre-article-analysis.js +578 -0
- package/dist/scripts/pre-article-analysis.js.map +1 -0
- package/dist/scripts/scb-client.d.ts +104 -0
- package/dist/scripts/scb-client.d.ts.map +1 -0
- package/dist/scripts/scb-client.js +286 -0
- package/dist/scripts/scb-client.js.map +1 -0
- package/dist/scripts/scb-context.d.ts +88 -0
- package/dist/scripts/scb-context.d.ts.map +1 -0
- package/dist/scripts/scb-context.js +307 -0
- package/dist/scripts/scb-context.js.map +1 -0
- package/dist/scripts/shared/version.d.ts +9 -0
- package/dist/scripts/shared/version.d.ts.map +1 -0
- package/dist/scripts/shared/version.js +28 -0
- package/dist/scripts/shared/version.js.map +1 -0
- package/dist/scripts/statistical-claims-detector.d.ts +119 -0
- package/dist/scripts/statistical-claims-detector.d.ts.map +1 -0
- package/dist/scripts/statistical-claims-detector.js +391 -0
- package/dist/scripts/statistical-claims-detector.js.map +1 -0
- package/dist/scripts/sync-cia-schemas.d.ts +52 -0
- package/dist/scripts/sync-cia-schemas.d.ts.map +1 -0
- package/dist/scripts/sync-cia-schemas.js +195 -0
- package/dist/scripts/sync-cia-schemas.js.map +1 -0
- package/dist/scripts/translation-dictionary.d.ts +45 -0
- package/dist/scripts/translation-dictionary.d.ts.map +1 -0
- package/dist/scripts/translation-dictionary.js +3642 -0
- package/dist/scripts/translation-dictionary.js.map +1 -0
- package/dist/scripts/types/article.d.ts +362 -0
- package/dist/scripts/types/article.d.ts.map +1 -0
- package/dist/scripts/types/article.js +6 -0
- package/dist/scripts/types/article.js.map +1 -0
- package/dist/scripts/types/content.d.ts +167 -0
- package/dist/scripts/types/content.d.ts.map +1 -0
- package/dist/scripts/types/content.js +6 -0
- package/dist/scripts/types/content.js.map +1 -0
- package/dist/scripts/types/editorial.d.ts +17 -0
- package/dist/scripts/types/editorial.d.ts.map +1 -0
- package/dist/scripts/types/editorial.js +6 -0
- package/dist/scripts/types/editorial.js.map +1 -0
- package/dist/scripts/types/language.d.ts +7 -0
- package/dist/scripts/types/language.d.ts.map +1 -0
- package/dist/scripts/types/language.js +6 -0
- package/dist/scripts/types/language.js.map +1 -0
- package/dist/scripts/types/mcp.d.ts +117 -0
- package/dist/scripts/types/mcp.d.ts.map +1 -0
- package/dist/scripts/types/mcp.js +6 -0
- package/dist/scripts/types/mcp.js.map +1 -0
- package/dist/scripts/types/party.d.ts +9 -0
- package/dist/scripts/types/party.d.ts.map +1 -0
- package/dist/scripts/types/party.js +6 -0
- package/dist/scripts/types/party.js.map +1 -0
- package/dist/scripts/types/validation.d.ts +136 -0
- package/dist/scripts/types/validation.d.ts.map +1 -0
- package/dist/scripts/types/validation.js +6 -0
- package/dist/scripts/types/validation.js.map +1 -0
- package/dist/scripts/types/workflow.d.ts +78 -0
- package/dist/scripts/types/workflow.d.ts.map +1 -0
- package/dist/scripts/types/workflow.js +6 -0
- package/dist/scripts/types/workflow.js.map +1 -0
- package/dist/scripts/update-stats-from-cia.d.ts +44 -0
- package/dist/scripts/update-stats-from-cia.d.ts.map +1 -0
- package/dist/scripts/update-stats-from-cia.js +310 -0
- package/dist/scripts/update-stats-from-cia.js.map +1 -0
- package/dist/scripts/validate-against-cia-schemas.d.ts +126 -0
- package/dist/scripts/validate-against-cia-schemas.d.ts.map +1 -0
- package/dist/scripts/validate-against-cia-schemas.js +299 -0
- package/dist/scripts/validate-against-cia-schemas.js.map +1 -0
- package/dist/scripts/validate-cross-references.d.ts +49 -0
- package/dist/scripts/validate-cross-references.d.ts.map +1 -0
- package/dist/scripts/validate-cross-references.js +183 -0
- package/dist/scripts/validate-cross-references.js.map +1 -0
- package/dist/scripts/validate-file-ownership.d.ts +68 -0
- package/dist/scripts/validate-file-ownership.d.ts.map +1 -0
- package/dist/scripts/validate-file-ownership.js +135 -0
- package/dist/scripts/validate-file-ownership.js.map +1 -0
- package/dist/scripts/validate-news-translations.d.ts +27 -0
- package/dist/scripts/validate-news-translations.d.ts.map +1 -0
- package/dist/scripts/validate-news-translations.js +258 -0
- package/dist/scripts/validate-news-translations.js.map +1 -0
- package/dist/scripts/validate-translations.d.ts +162 -0
- package/dist/scripts/validate-translations.d.ts.map +1 -0
- package/dist/scripts/validate-translations.js +378 -0
- package/dist/scripts/validate-translations.js.map +1 -0
- package/dist/scripts/workflow-state-coordinator.d.ts +354 -0
- package/dist/scripts/workflow-state-coordinator.d.ts.map +1 -0
- package/dist/scripts/workflow-state-coordinator.js +876 -0
- package/dist/scripts/workflow-state-coordinator.js.map +1 -0
- package/dist/scripts/world-bank-client.d.ts +122 -0
- package/dist/scripts/world-bank-client.d.ts.map +1 -0
- package/dist/scripts/world-bank-client.js +192 -0
- package/dist/scripts/world-bank-client.js.map +1 -0
- package/dist/scripts/world-bank-context.d.ts +88 -0
- package/dist/scripts/world-bank-context.d.ts.map +1 -0
- package/dist/scripts/world-bank-context.js +331 -0
- package/dist/scripts/world-bank-context.js.map +1 -0
- package/package.json +31 -6
- package/dist/lib/chart-factory.d.ts.map +0 -1
- package/dist/lib/chart-factory.js.map +0 -1
- package/dist/lib/data-loader.d.ts.map +0 -1
- package/dist/lib/data-loader.js.map +0 -1
- package/dist/lib/dom-utils.d.ts.map +0 -1
- package/dist/lib/dom-utils.js.map +0 -1
- package/dist/lib/error-boundary.d.ts.map +0 -1
- package/dist/lib/error-boundary.js.map +0 -1
- package/dist/lib/fallback-ui.d.ts.map +0 -1
- package/dist/lib/fallback-ui.js.map +0 -1
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/logger.d.ts.map +0 -1
- package/dist/lib/logger.js.map +0 -1
- package/dist/lib/theme.d.ts.map +0 -1
- package/dist/lib/theme.js.map +0 -1
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js.map +0 -1
- /package/dist/lib/{chart-factory.d.ts → shared/chart-factory.d.ts} +0 -0
- /package/dist/lib/{chart-factory.js → shared/chart-factory.js} +0 -0
- /package/dist/lib/{data-loader.d.ts → shared/data-loader.d.ts} +0 -0
- /package/dist/lib/{data-loader.js → shared/data-loader.js} +0 -0
- /package/dist/lib/{dom-utils.d.ts → shared/dom-utils.d.ts} +0 -0
- /package/dist/lib/{dom-utils.js → shared/dom-utils.js} +0 -0
- /package/dist/lib/{error-boundary.d.ts → shared/error-boundary.d.ts} +0 -0
- /package/dist/lib/{error-boundary.js → shared/error-boundary.js} +0 -0
- /package/dist/lib/{fallback-ui.d.ts → shared/fallback-ui.d.ts} +0 -0
- /package/dist/lib/{fallback-ui.js → shared/fallback-ui.js} +0 -0
- /package/dist/lib/{index.d.ts → shared/index.d.ts} +0 -0
- /package/dist/lib/{index.js → shared/index.js} +0 -0
- /package/dist/lib/{logger.d.ts → shared/logger.d.ts} +0 -0
- /package/dist/lib/{logger.js → shared/logger.js} +0 -0
- /package/dist/lib/{theme.d.ts → shared/theme.d.ts} +0 -0
- /package/dist/lib/{theme.js → shared/theme.js} +0 -0
- /package/dist/lib/{types.d.ts → shared/types.d.ts} +0 -0
- /package/dist/lib/{types.js → shared/types.js} +0 -0
|
@@ -0,0 +1,886 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Analytics/CommitteeIntelligence
|
|
3
|
+
* @category Analytics
|
|
4
|
+
*
|
|
5
|
+
* @title Committee Performance & Network Analytics Dashboard - Organizational Intelligence
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* Interactive visualization and analysis of Swedish Riksdag committee structure,
|
|
9
|
+
* productivity, and decision patterns. Committees are where legislative power
|
|
10
|
+
* actually accumulates and policy details get hammered out.
|
|
11
|
+
*
|
|
12
|
+
* @author Hack23 AB
|
|
13
|
+
* @license Apache-2.0
|
|
14
|
+
|
|
15
|
+
*
|
|
16
|
+
* @intelligence Committee Performance & Network Analytics — organizational intelligence analyzing Swedish Riksdag committee structure, productivity patterns, and decision-making networks. Committees are where legislative power accumulates and policy details are negotiated.
|
|
17
|
+
*
|
|
18
|
+
* @business Institutional analysis product — committee analytics serve researchers (legislative studies), journalists (committee coverage), and corporate affairs teams (regulatory tracking). Unique data product differentiating from vote-only parliamentary trackers.
|
|
19
|
+
*
|
|
20
|
+
* @marketing Expert audience engagement — committee analysis content attracts high-value audiences: policy researchers, lobbyists, and legislative affairs professionals. This audience has high conversion potential for premium analytics and API subscriptions.
|
|
21
|
+
* */
|
|
22
|
+
import { logger, showDataSourceDisclaimer } from '../shared/index.js';
|
|
23
|
+
/* ------------------------------------------------------------------ */
|
|
24
|
+
/* Global library references (loaded via <script> tags) */
|
|
25
|
+
/* ------------------------------------------------------------------ */
|
|
26
|
+
const d3 = globalThis.d3;
|
|
27
|
+
const Chart = globalThis.Chart;
|
|
28
|
+
const Papa = globalThis.Papa;
|
|
29
|
+
/* ------------------------------------------------------------------ */
|
|
30
|
+
/* Configuration */
|
|
31
|
+
/* ------------------------------------------------------------------ */
|
|
32
|
+
const CONFIG = {
|
|
33
|
+
dataUrls: {
|
|
34
|
+
productivityMatrix: [
|
|
35
|
+
'cia-data/distribution_committee_productivity_matrix.csv',
|
|
36
|
+
'https://raw.githubusercontent.com/Hack23/cia/master/service.data.impl/sample-data/distribution_committee_productivity_matrix.csv',
|
|
37
|
+
],
|
|
38
|
+
committeeDecisions: [
|
|
39
|
+
'cia-data/view_riksdagen_committee_decisions.csv',
|
|
40
|
+
'https://raw.githubusercontent.com/Hack23/cia/master/service.data.impl/sample-data/view_riksdagen_committee_decisions_sample.csv',
|
|
41
|
+
],
|
|
42
|
+
annualDocuments: [
|
|
43
|
+
'cia-data/distribution_annual_committee_documents.csv',
|
|
44
|
+
'https://raw.githubusercontent.com/Hack23/cia/master/service.data.impl/sample-data/distribution_annual_committee_documents.csv',
|
|
45
|
+
],
|
|
46
|
+
ballotSummary: [
|
|
47
|
+
'cia-data/view_riksdagen_committee_ballot_decision_party_summary.csv',
|
|
48
|
+
'https://raw.githubusercontent.com/Hack23/cia/master/service.data.impl/sample-data/view_riksdagen_committee_ballot_decision_party_summary_sample.csv',
|
|
49
|
+
],
|
|
50
|
+
seasonalPatterns: [
|
|
51
|
+
'cia-data/percentile_seasonal_activity_patterns.csv',
|
|
52
|
+
'https://raw.githubusercontent.com/Hack23/cia/master/service.data.impl/sample-data/percentile_seasonal_activity_patterns.csv',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
cache: {
|
|
56
|
+
enabled: true,
|
|
57
|
+
ttl: 24 * 60 * 60 * 1000, // 24 hours
|
|
58
|
+
prefix: 'riksdag_committee_',
|
|
59
|
+
},
|
|
60
|
+
committees: [
|
|
61
|
+
{ code: 'AU', name: 'Foreign Affairs Committee', nameLocalized: { sv: 'Utrikesutskottet', en: 'Foreign Affairs Committee' }, color: '#1e88e5', domain: 'Foreign Policy' },
|
|
62
|
+
{ code: 'CU', name: 'Civil Affairs Committee', nameLocalized: { sv: 'Civilutskottet', en: 'Civil Affairs Committee' }, color: '#43a047', domain: 'Civil Law' },
|
|
63
|
+
{ code: 'FiU', name: 'Finance Committee', nameLocalized: { sv: 'Finansutskottet', en: 'Finance Committee' }, color: '#fb8c00', domain: 'Economics' },
|
|
64
|
+
{ code: 'FöU', name: 'Defense Committee', nameLocalized: { sv: 'Försvarsutskottet', en: 'Defense Committee' }, color: '#e53935', domain: 'National Security' },
|
|
65
|
+
{ code: 'JuU', name: 'Justice Committee', nameLocalized: { sv: 'Justitieutskottet', en: 'Justice Committee' }, color: '#8e24aa', domain: 'Justice' },
|
|
66
|
+
{ code: 'KU', name: 'Constitutional Committee', nameLocalized: { sv: 'Konstitutionsutskottet', en: 'Constitutional Committee' }, color: '#3949ab', domain: 'Constitution' },
|
|
67
|
+
{ code: 'KrU', name: 'Cultural Affairs Committee', nameLocalized: { sv: 'Kulturutskottet', en: 'Cultural Affairs Committee' }, color: '#00acc1', domain: 'Culture' },
|
|
68
|
+
{ code: 'MjU', name: 'Environment Committee', nameLocalized: { sv: 'Miljö- och jordbruksutskottet', en: 'Environment Committee' }, color: '#7cb342', domain: 'Environment' },
|
|
69
|
+
{ code: 'NU', name: 'Business Committee', nameLocalized: { sv: 'Näringsutskottet', en: 'Business Committee' }, color: '#ff6f00', domain: 'Business' },
|
|
70
|
+
{ code: 'SkU', name: 'Taxation Committee', nameLocalized: { sv: 'Skatteutskottet', en: 'Taxation Committee' }, color: '#d32f2f', domain: 'Taxation' },
|
|
71
|
+
{ code: 'SoU', name: 'Social Insurance Committee', nameLocalized: { sv: 'Socialförsäkringsutskottet', en: 'Social Insurance Committee' }, color: '#c2185b', domain: 'Social Welfare' },
|
|
72
|
+
{ code: 'TU', name: 'Transport Committee', nameLocalized: { sv: 'Trafikutskottet', en: 'Transport Committee' }, color: '#0097a7', domain: 'Transportation' },
|
|
73
|
+
{ code: 'UbU', name: 'Education Committee', nameLocalized: { sv: 'Utbildningsutskottet', en: 'Education Committee' }, color: '#5e35b1', domain: 'Education' },
|
|
74
|
+
{ code: 'UFöU', name: 'Foreign Defense Committee', nameLocalized: { sv: 'Utrikes- och försvarsutskottet', en: 'Foreign Defense Committee' }, color: '#f57c00', domain: 'Security Policy' },
|
|
75
|
+
{ code: 'UU', name: 'Foreign Affairs Sub-Committee', nameLocalized: { sv: 'Utrikesutskottets underutskott', en: 'Foreign Affairs Sub-Committee' }, color: '#1565c0', domain: 'Foreign Policy' },
|
|
76
|
+
],
|
|
77
|
+
dimensions: {
|
|
78
|
+
network: { width: 1200, height: 700 },
|
|
79
|
+
heatmap: { width: 1200, height: 600 },
|
|
80
|
+
chart: { aspectRatio: 2 },
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
/* ------------------------------------------------------------------ */
|
|
84
|
+
/* DataManager */
|
|
85
|
+
/* ------------------------------------------------------------------ */
|
|
86
|
+
class DataManager {
|
|
87
|
+
constructor() {
|
|
88
|
+
}
|
|
89
|
+
/** Fetch CSV data with caching & fallback URLs. */
|
|
90
|
+
async fetchData(key, url) {
|
|
91
|
+
if (CONFIG.cache.enabled) {
|
|
92
|
+
const cached = this.getCached(key);
|
|
93
|
+
if (cached) {
|
|
94
|
+
logger.info(`[DataManager] Using cached data for ${key}`);
|
|
95
|
+
return cached;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const urls = Array.isArray(url) ? url : [url];
|
|
99
|
+
let lastError = null;
|
|
100
|
+
for (let i = 0; i < urls.length; i++) {
|
|
101
|
+
const currentUrl = urls[i];
|
|
102
|
+
try {
|
|
103
|
+
logger.info(`[DataManager] Fetching ${key} from ${currentUrl}`);
|
|
104
|
+
const response = await fetch(currentUrl);
|
|
105
|
+
if (!response.ok) {
|
|
106
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
107
|
+
}
|
|
108
|
+
const csvText = await response.text();
|
|
109
|
+
if (typeof Papa === 'undefined') {
|
|
110
|
+
throw new Error('Papa Parse library not loaded');
|
|
111
|
+
}
|
|
112
|
+
const parsed = Papa.parse(csvText, {
|
|
113
|
+
header: true,
|
|
114
|
+
dynamicTyping: true,
|
|
115
|
+
skipEmptyLines: true,
|
|
116
|
+
});
|
|
117
|
+
if (parsed.errors.length > 0) {
|
|
118
|
+
logger.warn(`[DataManager] CSV parsing warnings for ${key}:`, parsed.errors);
|
|
119
|
+
}
|
|
120
|
+
const data = parsed.data;
|
|
121
|
+
if (CONFIG.cache.enabled) {
|
|
122
|
+
this.setCached(key, data);
|
|
123
|
+
}
|
|
124
|
+
logger.info(`[DataManager] Successfully loaded ${key} from ${i === 0 ? 'local' : 'remote'} source`);
|
|
125
|
+
return data;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
logger.warn(`[DataManager] Failed to fetch ${key} from ${currentUrl}:`, error.message);
|
|
129
|
+
lastError = error;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
logger.error(`[DataManager] All sources failed for ${key}`);
|
|
133
|
+
throw lastError || new Error(`Failed to fetch ${key} from any source`);
|
|
134
|
+
}
|
|
135
|
+
/** Read from localStorage cache. */
|
|
136
|
+
getCached(key) {
|
|
137
|
+
const cacheKey = CONFIG.cache.prefix + key;
|
|
138
|
+
try {
|
|
139
|
+
const cached = localStorage.getItem(cacheKey);
|
|
140
|
+
if (!cached)
|
|
141
|
+
return null;
|
|
142
|
+
const { data, timestamp } = JSON.parse(cached);
|
|
143
|
+
const age = Date.now() - timestamp;
|
|
144
|
+
if (age < CONFIG.cache.ttl) {
|
|
145
|
+
return data;
|
|
146
|
+
}
|
|
147
|
+
localStorage.removeItem(cacheKey);
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
try {
|
|
152
|
+
localStorage.removeItem(cacheKey);
|
|
153
|
+
}
|
|
154
|
+
catch { /* ignore */ }
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/** Write to localStorage cache. */
|
|
159
|
+
setCached(key, data) {
|
|
160
|
+
const cacheKey = CONFIG.cache.prefix + key;
|
|
161
|
+
const cacheData = { data, timestamp: Date.now() };
|
|
162
|
+
try {
|
|
163
|
+
localStorage.setItem(cacheKey, JSON.stringify(cacheData));
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
logger.warn(`[DataManager] Failed to cache ${key}:`, error);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/** Load all five committee data sources in parallel. */
|
|
170
|
+
async loadAllData() {
|
|
171
|
+
try {
|
|
172
|
+
const [productivityMatrix, committeeDecisions, annualDocuments, ballotSummary, seasonalPatterns,] = await Promise.all([
|
|
173
|
+
this.fetchData('productivityMatrix', CONFIG.dataUrls.productivityMatrix),
|
|
174
|
+
this.fetchData('committeeDecisions', CONFIG.dataUrls.committeeDecisions),
|
|
175
|
+
this.fetchData('annualDocuments', CONFIG.dataUrls.annualDocuments),
|
|
176
|
+
this.fetchData('ballotSummary', CONFIG.dataUrls.ballotSummary),
|
|
177
|
+
this.fetchData('seasonalPatterns', CONFIG.dataUrls.seasonalPatterns),
|
|
178
|
+
]);
|
|
179
|
+
return { productivityMatrix, committeeDecisions, annualDocuments, ballotSummary, seasonalPatterns };
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
logger.error('[DataManager] Failed to load all data:', error);
|
|
183
|
+
throw error;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/* ------------------------------------------------------------------ */
|
|
188
|
+
/* D3.js Network Diagram */
|
|
189
|
+
/* ------------------------------------------------------------------ */
|
|
190
|
+
class NetworkDiagram {
|
|
191
|
+
containerId;
|
|
192
|
+
data;
|
|
193
|
+
svg;
|
|
194
|
+
simulation;
|
|
195
|
+
constructor(containerId, data) {
|
|
196
|
+
this.containerId = containerId;
|
|
197
|
+
this.data = data;
|
|
198
|
+
this.svg = null;
|
|
199
|
+
this.simulation = null;
|
|
200
|
+
}
|
|
201
|
+
/** Render force-directed network diagram. */
|
|
202
|
+
render() {
|
|
203
|
+
const container = document.getElementById(this.containerId);
|
|
204
|
+
if (!container) {
|
|
205
|
+
logger.error(`[NetworkDiagram] Container ${this.containerId} not found`);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
container.innerHTML = '';
|
|
209
|
+
const containerWidth = container.clientWidth;
|
|
210
|
+
const width = Math.min(containerWidth, CONFIG.dimensions.network.width);
|
|
211
|
+
const height = Math.min(width * 0.6, CONFIG.dimensions.network.height);
|
|
212
|
+
this.svg = d3
|
|
213
|
+
.select(container)
|
|
214
|
+
.append('svg')
|
|
215
|
+
.attr('width', width)
|
|
216
|
+
.attr('height', height)
|
|
217
|
+
.attr('role', 'img')
|
|
218
|
+
.attr('aria-label', 'Committee network connections diagram')
|
|
219
|
+
.attr('viewBox', `0 0 ${width} ${height}`)
|
|
220
|
+
.style('background', 'var(--card-bg)');
|
|
221
|
+
const { nodes, links } = this.processNetworkData();
|
|
222
|
+
this.simulation = d3
|
|
223
|
+
.forceSimulation(nodes)
|
|
224
|
+
.force('link', d3.forceLink(links).id((d) => d.id).distance(100))
|
|
225
|
+
.force('charge', d3.forceManyBody().strength(-400))
|
|
226
|
+
.force('center', d3.forceCenter(width / 2, height / 2))
|
|
227
|
+
.force('collision', d3.forceCollide().radius((d) => d.radius + 10));
|
|
228
|
+
const link = this.svg
|
|
229
|
+
.append('g')
|
|
230
|
+
.attr('class', 'links')
|
|
231
|
+
.selectAll('line')
|
|
232
|
+
.data(links)
|
|
233
|
+
.enter()
|
|
234
|
+
.append('line')
|
|
235
|
+
.attr('stroke', 'var(--border-color)')
|
|
236
|
+
.attr('stroke-width', (d) => Math.sqrt(d.value) * 2)
|
|
237
|
+
.attr('stroke-opacity', 0.6);
|
|
238
|
+
const node = this.svg
|
|
239
|
+
.append('g')
|
|
240
|
+
.attr('class', 'nodes')
|
|
241
|
+
.selectAll('g')
|
|
242
|
+
.data(nodes)
|
|
243
|
+
.enter()
|
|
244
|
+
.append('g')
|
|
245
|
+
.attr('tabindex', '0')
|
|
246
|
+
.attr('role', 'button')
|
|
247
|
+
.attr('aria-label', (d) => `${d.name} committee with ${d.productivity} productivity score`)
|
|
248
|
+
.call(d3
|
|
249
|
+
.drag()
|
|
250
|
+
.on('start', (event) => this.dragStarted(event))
|
|
251
|
+
.on('drag', (event) => this.dragged(event))
|
|
252
|
+
.on('end', (event) => this.dragEnded(event)));
|
|
253
|
+
node
|
|
254
|
+
.append('circle')
|
|
255
|
+
.attr('r', (d) => d.radius)
|
|
256
|
+
.attr('fill', (d) => d.color)
|
|
257
|
+
.attr('stroke', 'var(--card-bg)')
|
|
258
|
+
.attr('stroke-width', 2);
|
|
259
|
+
node
|
|
260
|
+
.append('text')
|
|
261
|
+
.attr('dy', 4)
|
|
262
|
+
.attr('text-anchor', 'middle')
|
|
263
|
+
.attr('font-size', '12px')
|
|
264
|
+
.attr('font-weight', 'bold')
|
|
265
|
+
.attr('fill', 'var(--text-color)')
|
|
266
|
+
.text((d) => d.code);
|
|
267
|
+
node
|
|
268
|
+
.append('title')
|
|
269
|
+
.text((d) => `${d.name}\nProductivity: ${d.productivity}\nDecisions: ${d.decisions}`);
|
|
270
|
+
this.simulation.on('tick', () => {
|
|
271
|
+
link
|
|
272
|
+
.attr('x1', (d) => d.source.x)
|
|
273
|
+
.attr('y1', (d) => d.source.y)
|
|
274
|
+
.attr('x2', (d) => d.target.x)
|
|
275
|
+
.attr('y2', (d) => d.target.y);
|
|
276
|
+
node.attr('transform', (d) => `translate(${d.x},${d.y})`);
|
|
277
|
+
});
|
|
278
|
+
this.addLegend(width, height);
|
|
279
|
+
this.updateAccessibleTable(nodes, links);
|
|
280
|
+
}
|
|
281
|
+
/** Build nodes & links from productivity data. */
|
|
282
|
+
processNetworkData() {
|
|
283
|
+
const prodLookup = {};
|
|
284
|
+
const decisionsLookup = {};
|
|
285
|
+
if (this.data?.productivityMatrix) {
|
|
286
|
+
for (const row of this.data.productivityMatrix) {
|
|
287
|
+
const code = row.committee_code || '';
|
|
288
|
+
if (code && !prodLookup[code]) {
|
|
289
|
+
const level = (row.productivity_level || '').toUpperCase();
|
|
290
|
+
prodLookup[code] =
|
|
291
|
+
level === 'HIGHLY_PRODUCTIVE' ? 95 :
|
|
292
|
+
level === 'PRODUCTIVE' ? 80 :
|
|
293
|
+
level === 'MODERATELY_PRODUCTIVE' ? 65 : 50;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (this.data?.annualDocuments) {
|
|
298
|
+
for (const row of this.data.annualDocuments) {
|
|
299
|
+
const code = row.committee || '';
|
|
300
|
+
const count = parseInt(row.doc_count) || 0;
|
|
301
|
+
if (code) {
|
|
302
|
+
decisionsLookup[code] = (decisionsLookup[code] || 0) + count;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
const nodes = CONFIG.committees.map((committee) => {
|
|
307
|
+
const productivity = prodLookup[committee.code] || 70;
|
|
308
|
+
const decisions = decisionsLookup[committee.code] || 50;
|
|
309
|
+
return {
|
|
310
|
+
id: committee.code,
|
|
311
|
+
code: committee.code,
|
|
312
|
+
name: committee.name,
|
|
313
|
+
color: committee.color,
|
|
314
|
+
productivity,
|
|
315
|
+
decisions,
|
|
316
|
+
radius: 15 + (productivity / 100) * 20,
|
|
317
|
+
};
|
|
318
|
+
});
|
|
319
|
+
const links = [];
|
|
320
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
321
|
+
for (let j = i + 1; j < nodes.length; j++) {
|
|
322
|
+
const prodDiff = Math.abs(nodes[i].productivity - nodes[j].productivity);
|
|
323
|
+
if (prodDiff < 20) {
|
|
324
|
+
links.push({
|
|
325
|
+
source: nodes[i].id,
|
|
326
|
+
target: nodes[j].id,
|
|
327
|
+
value: 10 - prodDiff / 2,
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return { nodes, links };
|
|
333
|
+
}
|
|
334
|
+
/** SVG legend for the network diagram. */
|
|
335
|
+
addLegend(_width, height) {
|
|
336
|
+
const legend = this.svg
|
|
337
|
+
.append('g')
|
|
338
|
+
.attr('class', 'legend')
|
|
339
|
+
.attr('transform', `translate(20, ${height - 80})`);
|
|
340
|
+
legend
|
|
341
|
+
.append('text')
|
|
342
|
+
.attr('x', 0)
|
|
343
|
+
.attr('y', 0)
|
|
344
|
+
.attr('font-size', '12px')
|
|
345
|
+
.attr('font-weight', 'bold')
|
|
346
|
+
.attr('fill', 'var(--text-color)')
|
|
347
|
+
.text('Node size = Productivity score');
|
|
348
|
+
legend
|
|
349
|
+
.append('text')
|
|
350
|
+
.attr('x', 0)
|
|
351
|
+
.attr('y', 20)
|
|
352
|
+
.attr('font-size', '12px')
|
|
353
|
+
.attr('fill', 'var(--text-secondary)')
|
|
354
|
+
.text('Link width = Relationship strength');
|
|
355
|
+
}
|
|
356
|
+
/** Build accessible HTML table from nodes and links. */
|
|
357
|
+
updateAccessibleTable(nodes, links) {
|
|
358
|
+
const table = document.getElementById('committeeNetworkTable');
|
|
359
|
+
if (!table)
|
|
360
|
+
return;
|
|
361
|
+
let html = '<caption>Committee Network Connections</caption>';
|
|
362
|
+
html += '<thead><tr><th>Committee</th><th>Productivity</th><th>Decisions</th><th>Connections</th></tr></thead>';
|
|
363
|
+
html += '<tbody>';
|
|
364
|
+
for (const node of nodes) {
|
|
365
|
+
const connections = links.filter((l) => {
|
|
366
|
+
const sourceId = typeof l.source === 'string' ? l.source : l.source?.id;
|
|
367
|
+
const targetId = typeof l.target === 'string' ? l.target : l.target?.id;
|
|
368
|
+
return sourceId === node.id || targetId === node.id;
|
|
369
|
+
}).length;
|
|
370
|
+
html += `<tr>
|
|
371
|
+
<td>${node.name} (${node.code})</td>
|
|
372
|
+
<td>${node.productivity.toFixed(1)}</td>
|
|
373
|
+
<td>${node.decisions}</td>
|
|
374
|
+
<td>${connections}</td>
|
|
375
|
+
</tr>`;
|
|
376
|
+
}
|
|
377
|
+
html += '</tbody>';
|
|
378
|
+
table.innerHTML = html;
|
|
379
|
+
}
|
|
380
|
+
/* Drag handlers */
|
|
381
|
+
dragStarted(event) {
|
|
382
|
+
if (!event.active)
|
|
383
|
+
this.simulation.alphaTarget(0.3).restart();
|
|
384
|
+
event.subject.fx = event.subject.x;
|
|
385
|
+
event.subject.fy = event.subject.y;
|
|
386
|
+
}
|
|
387
|
+
dragged(event) {
|
|
388
|
+
event.subject.fx = event.x;
|
|
389
|
+
event.subject.fy = event.y;
|
|
390
|
+
}
|
|
391
|
+
dragEnded(event) {
|
|
392
|
+
if (!event.active)
|
|
393
|
+
this.simulation.alphaTarget(0);
|
|
394
|
+
event.subject.fx = null;
|
|
395
|
+
event.subject.fy = null;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
/* ------------------------------------------------------------------ */
|
|
399
|
+
/* D3.js Productivity Heat Map */
|
|
400
|
+
/* ------------------------------------------------------------------ */
|
|
401
|
+
class ProductivityHeatMap {
|
|
402
|
+
containerId;
|
|
403
|
+
data;
|
|
404
|
+
svg;
|
|
405
|
+
constructor(containerId, data) {
|
|
406
|
+
this.containerId = containerId;
|
|
407
|
+
this.data = data;
|
|
408
|
+
this.svg = null;
|
|
409
|
+
}
|
|
410
|
+
/** Render the productivity heat map. */
|
|
411
|
+
render() {
|
|
412
|
+
const container = document.getElementById(this.containerId);
|
|
413
|
+
if (!container) {
|
|
414
|
+
logger.error(`[ProductivityHeatMap] Container ${this.containerId} not found`);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
container.innerHTML = '';
|
|
418
|
+
const containerWidth = container.clientWidth;
|
|
419
|
+
const width = Math.min(containerWidth, CONFIG.dimensions.heatmap.width);
|
|
420
|
+
const height = Math.min(width * 0.5, CONFIG.dimensions.heatmap.height);
|
|
421
|
+
const margin = { top: 80, right: 100, bottom: 60, left: 150 };
|
|
422
|
+
const innerWidth = width - margin.left - margin.right;
|
|
423
|
+
const innerHeight = height - margin.top - margin.bottom;
|
|
424
|
+
this.svg = d3
|
|
425
|
+
.select(container)
|
|
426
|
+
.append('svg')
|
|
427
|
+
.attr('width', width)
|
|
428
|
+
.attr('height', height)
|
|
429
|
+
.attr('role', 'img')
|
|
430
|
+
.attr('aria-label', 'Committee productivity matrix over time')
|
|
431
|
+
.attr('viewBox', `0 0 ${width} ${height}`)
|
|
432
|
+
.style('background', 'var(--card-bg)');
|
|
433
|
+
const g = this.svg
|
|
434
|
+
.append('g')
|
|
435
|
+
.attr('transform', `translate(${margin.left},${margin.top})`);
|
|
436
|
+
const { matrix, years, committees } = this.processHeatMapData();
|
|
437
|
+
const xScale = d3.scaleBand().domain(years).range([0, innerWidth]).padding(0.05);
|
|
438
|
+
const yScale = d3.scaleBand().domain(committees).range([0, innerHeight]).padding(0.05);
|
|
439
|
+
const colorScale = d3.scaleSequential(d3.interpolateRdYlGn).domain([0, 100]);
|
|
440
|
+
g.selectAll('rect')
|
|
441
|
+
.data(matrix)
|
|
442
|
+
.enter()
|
|
443
|
+
.append('rect')
|
|
444
|
+
.attr('x', (d) => xScale(d.year))
|
|
445
|
+
.attr('y', (d) => yScale(d.committee))
|
|
446
|
+
.attr('width', xScale.bandwidth())
|
|
447
|
+
.attr('height', yScale.bandwidth())
|
|
448
|
+
.attr('fill', (d) => colorScale(d.value))
|
|
449
|
+
.attr('stroke', 'var(--card-bg)')
|
|
450
|
+
.attr('stroke-width', 1)
|
|
451
|
+
.attr('tabindex', '0')
|
|
452
|
+
.attr('role', 'button')
|
|
453
|
+
.attr('aria-label', (d) => `${d.committee} in ${d.year}: ${d.value.toFixed(1)} productivity`)
|
|
454
|
+
.on('mouseover', function () {
|
|
455
|
+
d3.select(this).attr('stroke', 'var(--accent-color)').attr('stroke-width', 2);
|
|
456
|
+
})
|
|
457
|
+
.on('mouseout', function () {
|
|
458
|
+
d3.select(this).attr('stroke', 'var(--card-bg)').attr('stroke-width', 1);
|
|
459
|
+
})
|
|
460
|
+
.append('title')
|
|
461
|
+
.text((d) => `${d.committee} (${d.year})\nProductivity: ${d.value.toFixed(1)}`);
|
|
462
|
+
// X axis
|
|
463
|
+
g.append('g')
|
|
464
|
+
.attr('class', 'x-axis')
|
|
465
|
+
.attr('transform', `translate(0,${innerHeight})`)
|
|
466
|
+
.call(d3.axisBottom(xScale))
|
|
467
|
+
.selectAll('text')
|
|
468
|
+
.attr('fill', 'var(--text-color)');
|
|
469
|
+
// Y axis
|
|
470
|
+
g.append('g')
|
|
471
|
+
.attr('class', 'y-axis')
|
|
472
|
+
.call(d3.axisLeft(yScale))
|
|
473
|
+
.selectAll('text')
|
|
474
|
+
.attr('fill', 'var(--text-color)');
|
|
475
|
+
// Title
|
|
476
|
+
this.svg
|
|
477
|
+
.append('text')
|
|
478
|
+
.attr('x', width / 2)
|
|
479
|
+
.attr('y', 40)
|
|
480
|
+
.attr('text-anchor', 'middle')
|
|
481
|
+
.attr('font-size', '16px')
|
|
482
|
+
.attr('font-weight', 'bold')
|
|
483
|
+
.attr('fill', 'var(--text-color)')
|
|
484
|
+
.text('Committee Productivity Over Time (2020-2026)');
|
|
485
|
+
this.addColorLegend(g, colorScale, innerWidth, innerHeight);
|
|
486
|
+
this.updateAccessibleTable(matrix);
|
|
487
|
+
}
|
|
488
|
+
/** Convert productivity data into a flat matrix of cells. */
|
|
489
|
+
processHeatMapData() {
|
|
490
|
+
const committees = CONFIG.committees.map((c) => c.code);
|
|
491
|
+
const dataLookup = {};
|
|
492
|
+
if (this.data?.productivityMatrix) {
|
|
493
|
+
for (const row of this.data.productivityMatrix) {
|
|
494
|
+
const code = row.committee_code || '';
|
|
495
|
+
const year = row.year || '';
|
|
496
|
+
if (code && year) {
|
|
497
|
+
const level = (row.productivity_level || '').toUpperCase();
|
|
498
|
+
const value = level === 'HIGHLY_PRODUCTIVE' ? 90 :
|
|
499
|
+
level === 'PRODUCTIVE' ? 75 :
|
|
500
|
+
level === 'MODERATELY_PRODUCTIVE' ? 55 :
|
|
501
|
+
level === 'INACTIVE' ? 15 : 40;
|
|
502
|
+
dataLookup[`${code}_${year}`] = value;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
const yearSet = new Set();
|
|
507
|
+
if (this.data?.productivityMatrix) {
|
|
508
|
+
for (const row of this.data.productivityMatrix) {
|
|
509
|
+
if (row.year)
|
|
510
|
+
yearSet.add(String(row.year));
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
const years = yearSet.size > 0
|
|
514
|
+
? Array.from(yearSet).sort()
|
|
515
|
+
: ['2020', '2021', '2022', '2023', '2024', '2025', '2026'];
|
|
516
|
+
const matrix = [];
|
|
517
|
+
for (const committee of committees) {
|
|
518
|
+
for (const year of years) {
|
|
519
|
+
matrix.push({
|
|
520
|
+
committee,
|
|
521
|
+
year,
|
|
522
|
+
value: dataLookup[`${committee}_${year}`] || 50,
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return { matrix, years, committees };
|
|
527
|
+
}
|
|
528
|
+
/** Add a gradient color legend below the heatmap. */
|
|
529
|
+
addColorLegend(g, _colorScale, innerWidth, innerHeight) {
|
|
530
|
+
const legendWidth = 200;
|
|
531
|
+
const legendHeight = 15;
|
|
532
|
+
const legend = g
|
|
533
|
+
.append('g')
|
|
534
|
+
.attr('class', 'legend')
|
|
535
|
+
.attr('transform', `translate(${innerWidth - legendWidth}, ${innerHeight + 40})`);
|
|
536
|
+
const defs = this.svg.append('defs');
|
|
537
|
+
const gradient = defs
|
|
538
|
+
.append('linearGradient')
|
|
539
|
+
.attr('id', 'productivity-gradient')
|
|
540
|
+
.attr('x1', '0%')
|
|
541
|
+
.attr('x2', '100%');
|
|
542
|
+
gradient.append('stop').attr('offset', '0%').attr('stop-color', d3.interpolateRdYlGn(0));
|
|
543
|
+
gradient.append('stop').attr('offset', '50%').attr('stop-color', d3.interpolateRdYlGn(0.5));
|
|
544
|
+
gradient.append('stop').attr('offset', '100%').attr('stop-color', d3.interpolateRdYlGn(1));
|
|
545
|
+
legend.append('rect').attr('width', legendWidth).attr('height', legendHeight).style('fill', 'url(#productivity-gradient)');
|
|
546
|
+
legend.append('text').attr('x', 0).attr('y', -5).attr('font-size', '12px').attr('fill', 'var(--text-color)').text('Low');
|
|
547
|
+
legend.append('text').attr('x', legendWidth).attr('y', -5).attr('text-anchor', 'end').attr('font-size', '12px').attr('fill', 'var(--text-color)').text('High');
|
|
548
|
+
}
|
|
549
|
+
/** Accessible HTML table fallback. */
|
|
550
|
+
updateAccessibleTable(matrix) {
|
|
551
|
+
const table = document.getElementById('productivityMatrixTable');
|
|
552
|
+
if (!table)
|
|
553
|
+
return;
|
|
554
|
+
const years = [...new Set(matrix.map((d) => d.year))];
|
|
555
|
+
const committees = [...new Set(matrix.map((d) => d.committee))];
|
|
556
|
+
let html = '<caption>Committee Productivity Matrix (2020-2026)</caption>';
|
|
557
|
+
html += '<thead><tr><th>Committee</th>';
|
|
558
|
+
for (const year of years) {
|
|
559
|
+
html += `<th>${year}</th>`;
|
|
560
|
+
}
|
|
561
|
+
html += '</tr></thead><tbody>';
|
|
562
|
+
for (const committee of committees) {
|
|
563
|
+
html += `<tr><td>${committee}</td>`;
|
|
564
|
+
for (const year of years) {
|
|
565
|
+
const cell = matrix.find((d) => d.committee === committee && d.year === year);
|
|
566
|
+
html += `<td>${cell ? cell.value.toFixed(1) : 'N/A'}</td>`;
|
|
567
|
+
}
|
|
568
|
+
html += '</tr>';
|
|
569
|
+
}
|
|
570
|
+
html += '</tbody>';
|
|
571
|
+
table.innerHTML = html;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
/* ------------------------------------------------------------------ */
|
|
575
|
+
/* Chart.js Visualizations */
|
|
576
|
+
/* ------------------------------------------------------------------ */
|
|
577
|
+
class ChartJSVisualizations {
|
|
578
|
+
charts;
|
|
579
|
+
constructor() {
|
|
580
|
+
this.charts = {};
|
|
581
|
+
}
|
|
582
|
+
/** Render all Chart.js panels. */
|
|
583
|
+
renderAll(data) {
|
|
584
|
+
this.renderCommitteeComparison(data);
|
|
585
|
+
this.renderDecisionEffectiveness(data);
|
|
586
|
+
this.renderSeasonalPatterns(data);
|
|
587
|
+
}
|
|
588
|
+
/** Committee comparison bar chart. */
|
|
589
|
+
renderCommitteeComparison(data) {
|
|
590
|
+
const canvas = document.getElementById('committeeComparisonChart');
|
|
591
|
+
if (!canvas) {
|
|
592
|
+
logger.error('[ChartJS] committeeComparisonChart canvas not found');
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
const ctx = canvas.getContext('2d');
|
|
596
|
+
const labels = CONFIG.committees.map((c) => c.code);
|
|
597
|
+
const prodLookup = {};
|
|
598
|
+
if (data?.productivityMatrix) {
|
|
599
|
+
for (const row of data.productivityMatrix) {
|
|
600
|
+
const code = row.committee_code || '';
|
|
601
|
+
if (code && !prodLookup[code]) {
|
|
602
|
+
const level = (row.productivity_level || '').toUpperCase();
|
|
603
|
+
prodLookup[code] =
|
|
604
|
+
level === 'HIGHLY_PRODUCTIVE' ? 90 :
|
|
605
|
+
level === 'PRODUCTIVE' ? 75 :
|
|
606
|
+
level === 'MODERATELY_PRODUCTIVE' ? 55 :
|
|
607
|
+
level === 'INACTIVE' ? 15 : 40;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
const productivity = labels.map((code) => prodLookup[code] || 50);
|
|
612
|
+
const colors = CONFIG.committees.map((c) => c.color);
|
|
613
|
+
if (this.charts.comparison) {
|
|
614
|
+
this.charts.comparison.destroy();
|
|
615
|
+
}
|
|
616
|
+
const textColor = getComputedStyle(document.documentElement).getPropertyValue('--text-color');
|
|
617
|
+
const borderColor = getComputedStyle(document.documentElement).getPropertyValue('--border-color');
|
|
618
|
+
this.charts.comparison = new Chart(ctx, {
|
|
619
|
+
type: 'bar',
|
|
620
|
+
data: {
|
|
621
|
+
labels,
|
|
622
|
+
datasets: [
|
|
623
|
+
{
|
|
624
|
+
label: 'Productivity Score',
|
|
625
|
+
data: productivity,
|
|
626
|
+
backgroundColor: colors,
|
|
627
|
+
borderColor: colors,
|
|
628
|
+
borderWidth: 2,
|
|
629
|
+
},
|
|
630
|
+
],
|
|
631
|
+
},
|
|
632
|
+
options: {
|
|
633
|
+
responsive: true,
|
|
634
|
+
maintainAspectRatio: true,
|
|
635
|
+
aspectRatio: 2,
|
|
636
|
+
plugins: {
|
|
637
|
+
title: { display: true, text: 'Committee Productivity Comparison', color: textColor, font: { size: 16, weight: 'bold' } },
|
|
638
|
+
legend: { display: false },
|
|
639
|
+
tooltip: { callbacks: { label: (context) => `Productivity: ${context.parsed.y.toFixed(1)}` } },
|
|
640
|
+
},
|
|
641
|
+
scales: {
|
|
642
|
+
y: { beginAtZero: true, max: 100, title: { display: true, text: 'Productivity Score (0-100)', color: textColor }, ticks: { color: textColor }, grid: { color: borderColor } },
|
|
643
|
+
x: { title: { display: true, text: 'Committee', color: textColor }, ticks: { color: textColor }, grid: { color: borderColor } },
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
/** Decision effectiveness stacked bar chart. */
|
|
649
|
+
renderDecisionEffectiveness(data) {
|
|
650
|
+
const canvas = document.getElementById('decisionEffectivenessChart');
|
|
651
|
+
if (!canvas) {
|
|
652
|
+
logger.error('[ChartJS] decisionEffectivenessChart canvas not found');
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
const ctx = canvas.getContext('2d');
|
|
656
|
+
const yearSet = new Set();
|
|
657
|
+
if (data?.annualDocuments) {
|
|
658
|
+
for (const row of data.annualDocuments) {
|
|
659
|
+
if (row.year)
|
|
660
|
+
yearSet.add(String(row.year));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
const allYears = yearSet.size > 0 ? Array.from(yearSet).sort() : ['2020', '2021', '2022', '2023', '2024', '2025', '2026'];
|
|
664
|
+
const labels = allYears.slice(-7);
|
|
665
|
+
const yearDocCounts = {};
|
|
666
|
+
if (data?.annualDocuments) {
|
|
667
|
+
for (const row of data.annualDocuments) {
|
|
668
|
+
const year = String(row.year);
|
|
669
|
+
const count = parseInt(row.doc_count) || 0;
|
|
670
|
+
yearDocCounts[year] = (yearDocCounts[year] || 0) + count;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
const approved = labels.map((year) => {
|
|
674
|
+
const total = yearDocCounts[year] || 100;
|
|
675
|
+
return Math.min(100, total > 0 ? 70 : 0);
|
|
676
|
+
});
|
|
677
|
+
const rejected = labels.map((year) => {
|
|
678
|
+
const total = yearDocCounts[year] || 100;
|
|
679
|
+
return total > 0 ? 20 : 0;
|
|
680
|
+
});
|
|
681
|
+
const pending = labels.map((_, i) => Math.max(0, 100 - approved[i] - rejected[i]));
|
|
682
|
+
if (this.charts.effectiveness) {
|
|
683
|
+
this.charts.effectiveness.destroy();
|
|
684
|
+
}
|
|
685
|
+
const textColor = getComputedStyle(document.documentElement).getPropertyValue('--text-color');
|
|
686
|
+
const gridColor = getComputedStyle(document.documentElement).getPropertyValue('--border-color');
|
|
687
|
+
this.charts.effectiveness = new Chart(ctx, {
|
|
688
|
+
type: 'bar',
|
|
689
|
+
data: {
|
|
690
|
+
labels,
|
|
691
|
+
datasets: [
|
|
692
|
+
{ label: 'Approved', data: approved, backgroundColor: '#7cb342', borderColor: '#7cb342', borderWidth: 1 },
|
|
693
|
+
{ label: 'Rejected', data: rejected, backgroundColor: '#e53935', borderColor: '#e53935', borderWidth: 1 },
|
|
694
|
+
{ label: 'Pending', data: pending, backgroundColor: '#fb8c00', borderColor: '#fb8c00', borderWidth: 1 },
|
|
695
|
+
],
|
|
696
|
+
},
|
|
697
|
+
options: {
|
|
698
|
+
responsive: true,
|
|
699
|
+
maintainAspectRatio: true,
|
|
700
|
+
aspectRatio: 2,
|
|
701
|
+
plugins: {
|
|
702
|
+
title: { display: true, text: 'Decision Outcomes by Year', color: textColor, font: { size: 16, weight: 'bold' } },
|
|
703
|
+
legend: { labels: { color: textColor } },
|
|
704
|
+
tooltip: { callbacks: { label: (context) => `${context.dataset.label}: ${context.parsed.y.toFixed(1)}%` } },
|
|
705
|
+
},
|
|
706
|
+
scales: {
|
|
707
|
+
x: { stacked: true, title: { display: true, text: 'Year', color: textColor }, ticks: { color: textColor }, grid: { color: gridColor } },
|
|
708
|
+
y: { stacked: true, beginAtZero: true, max: 100, title: { display: true, text: 'Percentage (%)', color: textColor }, ticks: { color: textColor }, grid: { color: gridColor } },
|
|
709
|
+
},
|
|
710
|
+
},
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
/** Seasonal activity line chart. */
|
|
714
|
+
renderSeasonalPatterns(data) {
|
|
715
|
+
const canvas = document.getElementById('seasonalPatternsChart');
|
|
716
|
+
if (!canvas) {
|
|
717
|
+
logger.error('[ChartJS] seasonalPatternsChart canvas not found');
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
const ctx = canvas.getContext('2d');
|
|
721
|
+
const labels = ['Q1', 'Q2', 'Q3', 'Q4'];
|
|
722
|
+
const yearQuarterData = {};
|
|
723
|
+
if (data?.seasonalPatterns) {
|
|
724
|
+
for (const row of data.seasonalPatterns) {
|
|
725
|
+
const year = String(row.year || '');
|
|
726
|
+
const quarter = parseInt(row.quarter) || 0;
|
|
727
|
+
if (year && quarter >= 1 && quarter <= 4) {
|
|
728
|
+
if (!yearQuarterData[year])
|
|
729
|
+
yearQuarterData[year] = {};
|
|
730
|
+
yearQuarterData[year][quarter] = parseFloat(row.median || row.total_ballots || row.value || 0);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
const availableYears = Object.keys(yearQuarterData).sort().slice(-3);
|
|
735
|
+
const yearColors = ['#1e88e5', '#43a047', '#fb8c00'];
|
|
736
|
+
const datasets = availableYears.length > 0
|
|
737
|
+
? availableYears.map((year, idx) => ({
|
|
738
|
+
label: year,
|
|
739
|
+
data: [1, 2, 3, 4].map((q) => yearQuarterData[year][q] || 0),
|
|
740
|
+
borderColor: yearColors[idx % yearColors.length],
|
|
741
|
+
backgroundColor: yearColors[idx % yearColors.length] + '1A',
|
|
742
|
+
tension: 0.4,
|
|
743
|
+
}))
|
|
744
|
+
: [
|
|
745
|
+
{ label: '2024', data: [0, 0, 0, 0], borderColor: '#1e88e5', backgroundColor: 'rgba(30, 136, 229, 0.1)', tension: 0.4 },
|
|
746
|
+
{ label: '2025', data: [0, 0, 0, 0], borderColor: '#43a047', backgroundColor: 'rgba(67, 160, 71, 0.1)', tension: 0.4 },
|
|
747
|
+
{ label: '2026', data: [0, 0, 0, 0], borderColor: '#fb8c00', backgroundColor: 'rgba(251, 140, 0, 0.1)', tension: 0.4 },
|
|
748
|
+
];
|
|
749
|
+
if (this.charts.seasonal) {
|
|
750
|
+
this.charts.seasonal.destroy();
|
|
751
|
+
}
|
|
752
|
+
const textColor = getComputedStyle(document.documentElement).getPropertyValue('--text-color');
|
|
753
|
+
const gridColor = getComputedStyle(document.documentElement).getPropertyValue('--border-color');
|
|
754
|
+
this.charts.seasonal = new Chart(ctx, {
|
|
755
|
+
type: 'line',
|
|
756
|
+
data: { labels, datasets },
|
|
757
|
+
options: {
|
|
758
|
+
responsive: true,
|
|
759
|
+
maintainAspectRatio: true,
|
|
760
|
+
aspectRatio: 3,
|
|
761
|
+
plugins: {
|
|
762
|
+
title: { display: true, text: 'Quarterly Activity Patterns (2023-2025)', color: textColor, font: { size: 16, weight: 'bold' } },
|
|
763
|
+
legend: { labels: { color: textColor } },
|
|
764
|
+
tooltip: { callbacks: { label: (context) => `${context.dataset.label}: ${context.parsed.y} activity score` } },
|
|
765
|
+
},
|
|
766
|
+
scales: {
|
|
767
|
+
y: { beginAtZero: true, max: 100, title: { display: true, text: 'Activity Score', color: textColor }, ticks: { color: textColor }, grid: { color: gridColor } },
|
|
768
|
+
x: { title: { display: true, text: 'Quarter', color: textColor }, ticks: { color: textColor }, grid: { color: gridColor } },
|
|
769
|
+
},
|
|
770
|
+
},
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
/** Destroy all Chart.js instances. */
|
|
774
|
+
destroy() {
|
|
775
|
+
for (const key of Object.keys(this.charts)) {
|
|
776
|
+
if (this.charts[key] && typeof this.charts[key].destroy === 'function') {
|
|
777
|
+
this.charts[key].destroy();
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
this.charts = {};
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
/* ------------------------------------------------------------------ */
|
|
784
|
+
/* Loading / Error helpers */
|
|
785
|
+
/* ------------------------------------------------------------------ */
|
|
786
|
+
function showLoadingIndicator() {
|
|
787
|
+
const dashboard = document.getElementById('committee-dashboard');
|
|
788
|
+
if (!dashboard)
|
|
789
|
+
return;
|
|
790
|
+
const existing = document.getElementById('committee-loading');
|
|
791
|
+
if (existing)
|
|
792
|
+
existing.remove();
|
|
793
|
+
const indicator = document.createElement('div');
|
|
794
|
+
indicator.id = 'committee-loading';
|
|
795
|
+
indicator.className = 'loading-indicator';
|
|
796
|
+
indicator.setAttribute('role', 'status');
|
|
797
|
+
indicator.setAttribute('aria-live', 'polite');
|
|
798
|
+
const spinner = document.createElement('div');
|
|
799
|
+
spinner.className = 'spinner';
|
|
800
|
+
indicator.appendChild(spinner);
|
|
801
|
+
const text = document.createElement('p');
|
|
802
|
+
text.textContent = 'Loading committee data...';
|
|
803
|
+
indicator.appendChild(text);
|
|
804
|
+
dashboard.insertBefore(indicator, dashboard.firstChild);
|
|
805
|
+
}
|
|
806
|
+
function hideLoadingIndicator() {
|
|
807
|
+
const indicator = document.getElementById('committee-loading');
|
|
808
|
+
if (indicator)
|
|
809
|
+
indicator.remove();
|
|
810
|
+
}
|
|
811
|
+
function showErrorMessage(message) {
|
|
812
|
+
const dashboard = document.getElementById('committee-dashboard');
|
|
813
|
+
if (!dashboard)
|
|
814
|
+
return;
|
|
815
|
+
const error = document.createElement('div');
|
|
816
|
+
error.className = 'error-message';
|
|
817
|
+
error.setAttribute('role', 'alert');
|
|
818
|
+
const heading = document.createElement('h3');
|
|
819
|
+
heading.textContent = '\u26a0\ufe0f Error Loading Committee Dashboard';
|
|
820
|
+
error.appendChild(heading);
|
|
821
|
+
const messageParagraph = document.createElement('p');
|
|
822
|
+
messageParagraph.textContent = message;
|
|
823
|
+
error.appendChild(messageParagraph);
|
|
824
|
+
const supportParagraph = document.createElement('p');
|
|
825
|
+
supportParagraph.textContent = 'Please refresh the page or contact support if the issue persists.';
|
|
826
|
+
error.appendChild(supportParagraph);
|
|
827
|
+
dashboard.insertBefore(error, dashboard.firstChild);
|
|
828
|
+
hideLoadingIndicator();
|
|
829
|
+
}
|
|
830
|
+
/* ------------------------------------------------------------------ */
|
|
831
|
+
/* Dashboard Initialization */
|
|
832
|
+
/* ------------------------------------------------------------------ */
|
|
833
|
+
let visualizationInstances = null;
|
|
834
|
+
let isInitializing = false;
|
|
835
|
+
async function initializeDashboard() {
|
|
836
|
+
const dashboardRoot = document.getElementById('committee-dashboard');
|
|
837
|
+
if (!dashboardRoot) {
|
|
838
|
+
logger.info('[CommitteeDashboard] Skipping initialization: #committee-dashboard container not found.');
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
if (isInitializing) {
|
|
842
|
+
logger.info('[CommitteeDashboard] Already initializing, skipping duplicate call');
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
isInitializing = true;
|
|
846
|
+
logger.info('[CommitteeDashboard] Initializing...');
|
|
847
|
+
try {
|
|
848
|
+
if (typeof d3 === 'undefined')
|
|
849
|
+
throw new Error('D3.js not loaded. Please include D3.js library.');
|
|
850
|
+
if (typeof Chart === 'undefined')
|
|
851
|
+
throw new Error('Chart.js not loaded. Please include Chart.js library.');
|
|
852
|
+
if (typeof Papa === 'undefined')
|
|
853
|
+
throw new Error('Papa Parse not loaded. Please include Papa Parse library.');
|
|
854
|
+
showLoadingIndicator();
|
|
855
|
+
const dataManager = new DataManager();
|
|
856
|
+
const data = await dataManager.loadAllData();
|
|
857
|
+
logger.info('[CommitteeDashboard] Data loaded successfully');
|
|
858
|
+
showDataSourceDisclaimer(dashboardRoot, 'live');
|
|
859
|
+
if (visualizationInstances?.charts) {
|
|
860
|
+
visualizationInstances.charts.destroy();
|
|
861
|
+
}
|
|
862
|
+
const network = new NetworkDiagram('committeeNetwork', data);
|
|
863
|
+
network.render();
|
|
864
|
+
const heatmap = new ProductivityHeatMap('productivityMatrix', data);
|
|
865
|
+
heatmap.render();
|
|
866
|
+
const charts = new ChartJSVisualizations();
|
|
867
|
+
charts.renderAll(data);
|
|
868
|
+
visualizationInstances = { network, heatmap, charts };
|
|
869
|
+
hideLoadingIndicator();
|
|
870
|
+
logger.info('[CommitteeDashboard] Initialization complete');
|
|
871
|
+
}
|
|
872
|
+
catch (error) {
|
|
873
|
+
logger.error('[CommitteeDashboard] Initialization failed:', error);
|
|
874
|
+
showErrorMessage(error.message);
|
|
875
|
+
}
|
|
876
|
+
finally {
|
|
877
|
+
isInitializing = false;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
/* ------------------------------------------------------------------ */
|
|
881
|
+
/* Public API */
|
|
882
|
+
/* ------------------------------------------------------------------ */
|
|
883
|
+
export async function init() {
|
|
884
|
+
await initializeDashboard();
|
|
885
|
+
}
|
|
886
|
+
//# sourceMappingURL=committees-dashboard.js.map
|