Skip to content

Commit

Permalink
Trigger plot drawing and selectors update only after Go! is clicked (#…
Browse files Browse the repository at this point in the history
…174)

* Trigger plot drawing and selectors update only after button is clicked

* Company-level: update plots and selectors after go

* Fix wrong variable name emission intensity

* Fix wrong sector name emission intensity
  • Loading branch information
MonikaFu authored Jan 14, 2025
1 parent 9905962 commit 7baaed9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
9 changes: 3 additions & 6 deletions src/routes/company_view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@
fetchExposureStats();
if (checkDataAvailability()) {
showAnalysisHideAlert();
updateScenarioSourceSelector();
updateScenarioSelector();
updateAllocationMethodSelector();
fetchCompanyBubble();
fetchCompanyTechmix();
} else {
Expand Down Expand Up @@ -334,13 +337,7 @@
setValuesSectorSelectors();
setValuesAssetClassSelector();
updateScenarioSourceSelector();
updateScenarioSelector();
updateAllocationMethodSelector();
addEventListeners();
fetchExposureStats();
fetchCompanyBubble();
fetchCompanyTechmix();
});
</script>

Expand Down
18 changes: 7 additions & 11 deletions src/routes/sector_view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
let filteredEmissionsData = emissionsData
.filter((d) => d.asset_class == selectedClass)
.filter((d) => d.ald_sector == selectedSector);
.filter((d) => d.sector == selectedSector);
let check = [filteredTechmixData, filteredVolTrajData, filteredEmissionsData].some(
(x) => x.length != 0
Expand Down Expand Up @@ -212,7 +212,7 @@
let filteredEmissionsData = emissionsData
.filter((d) => d.asset_class == selectedClass)
.filter((d) => d.ald_sector == selectedSector);
.filter((d) => d.sector == selectedSector);
let allocationsEmissions = new Set(
d3.map(filteredEmissionsData, (d) => d.allocation_translation).keys()
);
Expand Down Expand Up @@ -324,6 +324,11 @@
fetchExposureStats();
if (checkDataAvailability()) {
showAnalysisHideAlert();
updateScenarioSourceSelector();
updateScenarioSelector();
updateAllocationMethodSelector();
updateEquityMarketSelector();
updateBenchmarkSelector();
fetchTrajectoryAlignmentIfApplicable();
fetchTechmix();
fetchEmissionIntensityPlot();
Expand Down Expand Up @@ -399,16 +404,7 @@
setValuesAssetClassSelector();
fetchExposureStats();
if (checkDataAvailability()) {
showAnalysisHideAlert();
updateScenarioSourceSelector();
updateScenarioSelector();
updateAllocationMethodSelector();
updateEquityMarketSelector();
updateBenchmarkSelector();
addEventListeners();
fetchTechmix();
fetchTrajectoryAlignmentIfApplicable();
fetchEmissionIntensityPlot();
} else {
handleNoDataForAssetSectorCombination();
}
Expand Down

0 comments on commit 7baaed9

Please sign in to comment.