Skip to content

Commit

Permalink
Add emissions pies (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaFu authored Aug 8, 2024
1 parent fb0e2f1 commit 956de5b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/json/data_emissions_pie_bonds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"key":"Oil&Gas","value":54737.5969764129,"exploded":true,"key_translation":"Oil & Gas"},{"key":"Power","value":43.1590625319064,"exploded":true,"key_translation":"Power"},{"key":"Steel","value":70144.005711152,"exploded":true,"key_translation":"Steel"},{"key":"Consumer Services","value":224.440769185614,"exploded":false,"key_translation":"Consumer Services"},{"key":"Finance","value":137.544612489455,"exploded":false,"key_translation":"Finance"},{"key":"Producer Manufacturing","value":4130.70516695656,"exploded":false,"key_translation":"Producer Manufacturing"},{"key":"Technology Services","value":466.363712558927,"exploded":false,"key_translation":"Technology Services"}]
1 change: 1 addition & 0 deletions src/json/data_emissions_pie_equity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"key":"Automotive","value":58188.6818096151,"exploded":true,"key_translation":"Automotive"},{"key":"Aviation","value":2517.93265754763,"exploded":true,"key_translation":"Aviation"},{"key":"Cement","value":23184.4440558877,"exploded":true,"key_translation":"Cement"},{"key":"Coal","value":131901.481868615,"exploded":true,"key_translation":"Coal"},{"key":"Oil&Gas","value":29755.9108737074,"exploded":true,"key_translation":"Oil&Gas"},{"key":"Power","value":83778.4606796421,"exploded":true,"key_translation":"Power"},{"key":"Steel","value":14601.1782469639,"exploded":true,"key_translation":"Steel"},{"key":"Commercial Services","value":12.8408766088981,"exploded":false,"key_translation":"Commercial Services"},{"key":"Communications","value":7.01709450176636,"exploded":false,"key_translation":"Communications"},{"key":"Consumer Durables","value":4.47741673685176,"exploded":false,"key_translation":"Consumer Durables"},{"key":"Consumer Non-Durables","value":206.22283747492,"exploded":false,"key_translation":"Consumer Non-Durables"},{"key":"Consumer Services","value":398.380651524164,"exploded":false,"key_translation":"Consumer Services"},{"key":"Distribution Services","value":278.591991162377,"exploded":false,"key_translation":"Distribution Services"},{"key":"Electronic Technology","value":9.23637154915783,"exploded":false,"key_translation":"Electronic Technology"},{"key":"Energy Minerals","value":2622.29535811187,"exploded":false,"key_translation":"Energy Minerals"},{"key":"Finance","value":1422.95817812435,"exploded":false,"key_translation":"Finance"},{"key":"HDV","value":2530.47599027769,"exploded":false,"key_translation":"HDV"},{"key":"Health Services","value":3.3590250177838,"exploded":false,"key_translation":"Health Services"},{"key":"Health Technology","value":9.54966262278655,"exploded":false,"key_translation":"Health Technology"},{"key":"Industrial Services","value":2417.31268828854,"exploded":false,"key_translation":"Industrial Services"},{"key":"Non-Energy Minerals","value":5.97043409585789,"exploded":false,"key_translation":"Non-Energy Minerals"},{"key":"Process Industries","value":4719.37230802991,"exploded":false,"key_translation":"Process Industries"},{"key":"Producer Manufacturing","value":1387.2542935833,"exploded":false,"key_translation":"Producer Manufacturing"},{"key":"Retail Trade","value":319.59588712392,"exploded":false,"key_translation":"Retail Trade"},{"key":"Shipping","value":550.692465936229,"exploded":false,"key_translation":"Shipping"},{"key":"Technology Services","value":9.51164394263711,"exploded":false,"key_translation":"Technology Services"},{"key":"Transportation","value":0.732543504746695,"exploded":false,"key_translation":"Transportation"}]
46 changes: 36 additions & 10 deletions src/routes/portfolio_view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@
<script>
import { onMount } from 'svelte';
import tableData from '../json/data_included_table.json';
import bondsPie from '../json/data_value_pie_bonds.json';
import equityPie from '../json/data_value_pie_equity.json';
import bondsValuePieData from '../json/data_value_pie_bonds.json';
import equityValuePieData from '../json/data_value_pie_equity.json';
import bondsEmissionsPieData from '../json/data_emissions_pie_bonds.json';
import equityEmissionsPieData from '../json/data_emissions_pie_equity.json';
import mapData from '../json/data_map.json';
import { PieExploded } from '../js/PieExploded2.js';
import { choropleth } from '../js/map.js'
onMount(() => {
function fetchCompanyBubble() {
new PieExploded(document.querySelector('#bubbleBonds'), bondsPie, undefined, {
function fetchValuePie() {
new PieExploded(document.querySelector('#valuePieBonds'), bondsValuePieData, undefined, {
default_class: 'Corporate Bonds'
});
new PieExploded(document.querySelector('#bubbleEquity'), equityPie, undefined, {
new PieExploded(document.querySelector('#valuePieEquity'), equityValuePieData, undefined, {
default_class: 'Listed Equity'
});
}
function fetchEmissionsPie() {
new PieExploded(document.querySelector('#emissionsPieBonds'), bondsEmissionsPieData, undefined, {
default_class: 'Corporate Bonds'
});
new PieExploded(document.querySelector('#emissionsPieEquity'), equityEmissionsPieData, undefined, {
default_class: 'Listed Equity'
});
}
Expand All @@ -27,7 +38,8 @@
});
}
fetchCompanyBubble();
fetchValuePie();
fetchEmissionsPie();
fetchMap();
});
</script>
Expand Down Expand Up @@ -95,12 +107,26 @@
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
<div class="card p-4 w-full h-1/2 justify-top">
Coverage of listed equity portion of the portfolio
<div id="bubbleBonds"></div>
Value coverage of listed equity portion of the portfolio
<div id="valuePieBonds"></div>
</div>
<div class="card p-4 w-full h-1/2 justify-bottom">
Coverage of corporate bonds' portion of the portfolio
<div id="bubbleEquity"></div>
Value coverage of corporate bonds' portion of the portfolio
<div id="valuePieEquity"></div>
</div>
</div>
</div>
<div class="h-screen flex flex-row gap-x-4">
<div class="card p-4 w-full h-full">
<div class="flex flex-row">
<div class="card p-4 basis-1/2 h-full justify-left">
Emissions coverage of listed equity portion of the portfolio
<div id="emissionsPieBonds"></div>
</div>
<div class="card p-4 basis-1/2 h-full justify-right">
Emissions coverage of corporate bonds' portion of the portfolio
<div id="emissionsPieEquity"></div>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 956de5b

Please sign in to comment.