Skip to content

Commit

Permalink
Plotly yellow star (#7)
Browse files Browse the repository at this point in the history
* add code for html legend and title

* uncomments init

* add function and data for graph 3.5

* improve map1.4 with seastemik color and countries

* add data for 4.4 and 5.1

* update config.py for graph 3.5 and correct 2.1 and 2.3

* udpated data and functions for map 2.4

* uncomment init

* add graph 5.1 and functions

* function and graphs 4.4

* fix: error name for maps

* fix: fn arguments

* fix: code formatting

* fix: black vulnerability

---------

Co-authored-by: gmguarino <[email protected]>
  • Loading branch information
sarahrieubland and gmguarino authored Apr 22, 2024
1 parent f67de55 commit b71d930
Show file tree
Hide file tree
Showing 23 changed files with 4,311 additions and 3,608 deletions.
4 changes: 4 additions & 0 deletions data/carbon_bombs_pie_chart_5.1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Scopes,Emissions (tons CO2eq)
Scope 1 - Direct emissions,"1213215,63"
Scope 2 - Electricity (location based),"392005,14"
Scope 3 - Indirect emissions,"14798276,7"
14 changes: 14 additions & 0 deletions data/escapes_marine_cages_3.5.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Company,n_escape,production (t),n_salmon_produced,escape_rate
AquaChile,0,138000,34500000,"0,00%"
Australis Seafood,0,75000,18750000,"0,00%"
Bakkafrost,607355,91000,22750000,"2,67%"
Blumar,96043,53000,13250000,"0,72%"
Camanchaca,134363,45000,11250000,"1,19%"
Cermaq,113167,171000,42750000,"0,26%"
Grieg Seafood,33946,88000,22000000,"0,15%"
Leroy,10956,152000,38000000,"0,03%"
MOWI,1069079,472000,118000000,"0,91%"
Multiexport,0,77000,19250000,"0,00%"
Nova Sea,26,58000,14500000,"0,00%"
SalMar,1977137,194000,48500000,"4,08%"
Salmones Austral,0,35000,8750000,"0,00%"
126 changes: 126 additions & 0 deletions data/mortality_rates_4.4.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
Year,Company,Area,Mortality_rate
2022,Bakkafrost,Faroes,"4,91"
2021,Bakkafrost,Faroes,"8,24"
2020,Bakkafrost,Faroes,"10,29"
2019,Bakkafrost,Faroes,"4,57"
2018,Bakkafrost,Faroes,"11,56"
2017,Bakkafrost,Faroes,"8,96"
2022,Bakkafrost,Scotland,"23,16"
2021,Bakkafrost,Scotland,"21,71"
2020,Bakkafrost,Scotland,"11,43"
2022,Grieg Seafood,Rogaland,8
2021,Grieg Seafood,Rogaland,8
2020,Grieg Seafood,Rogaland,10
2019,Grieg Seafood,Rogaland,7
2018,Grieg Seafood,Rogaland,8
2017,Grieg Seafood,Rogaland,9
2016,Grieg Seafood,Rogaland,7
2022,Grieg Seafood,Finnmark,9
2021,Grieg Seafood,Finnmark,5
2020,Grieg Seafood,Finnmark,8
2019,Grieg Seafood,Finnmark,4
2018,Grieg Seafood,Finnmark,4
2017,Grieg Seafood,Finnmark,5
2016,Grieg Seafood,Finnmark,6
2022,Grieg Seafood,British Columbia,9
2021,Grieg Seafood,British Columbia,10
2020,Grieg Seafood,British Columbia,8
2019,Grieg Seafood,British Columbia,12
2018,Grieg Seafood,British Columbia,12
2017,Grieg Seafood,British Columbia,7
2016,Grieg Seafood,British Columbia,10
2019,Grieg Seafood,Shetland,11
2018,Grieg Seafood,Shetland,17
2017,Grieg Seafood,Shetland,11
2016,Grieg Seafood,Shetland,17
2019,Multiexport,NA,"10,8"
2018,Multiexport,NA,"9,7"
2017,Multiexport,NA,"8,3"
2022,Blumar,NA,"7,26"
2021,Blumar,NA,"2,73"
2020,Blumar,NA,"7,44"
2019,Blumar,NA,"3,34"
2018,Blumar,NA,"3,95"
2017,Blumar,NA,4
2016,Blumar,NA,"7,13"
2015,Blumar,NA,5
2014,Blumar,NA,"4,18"
2022,Cermaq,NA,"6,2"
2021,Cermaq,NA,"5,2"
2020,Cermaq,NA,"5,7"
2019,Cermaq,NA,0
2018,Cermaq,NA,"5,5"
2017,Cermaq,NA,"5,3"
2016,Cermaq,NA,7
2015,Cermaq,NA,"6,3"
2014,Cermaq,NA,"6,8"
2013,Cermaq,NA,"6,4"
2012,Cermaq,NA,"7,3"
2011,Cermaq,NA,"8,4"
2022,Camanchaca,NA,"4,6"
2021,Camanchaca,NA,"15,7"
2020,Camanchaca,NA,"8,6"
2019,Camanchaca,NA,"4,8"
2018,Camanchaca,NA,"2,8"
2017,Camanchaca,NA,"3,2"
2016,Camanchaca,NA,"17,8"
2015,Camanchaca,NA,"6,6"
2014,Camanchaca,NA,"3,1"
2013,Camanchaca,NA,"4,7"
2022,Nova Sea,NA,"4,18"
2021,Nova Sea,NA,"2,74"
2020,Nova Sea,NA,"2,65"
2019,Nova Sea,NA,"2,95"
2018,Nova Sea,NA,"3,91"
2017,Nova Sea,NA,"2,8"
2016,Nova Sea,NA,"2,9"
2015,Nova Sea,NA,"3,21"
2022,Salmones Austral,NA,"5,73"
2021,Salmones Austral,NA,"2,55"
2020,Salmones Austral,NA,"2,67"
2019,Salmones Austral,NA,"2,1"
2018,Salmones Austral,NA,"1,8"
2022,Australis Seafood,NA,"3,23"
2021,Australis Seafood,NA,"3,13"
2020,Australis Seafood,NA,"2,93"
2019,Australis Seafood,NA,"3,62"
2018,Australis Seafood,NA,"3,98"
2017,Australis Seafood,NA,"3,5"
2016,Australis Seafood,NA,"4,16"
2022,AquaChile,NA,"6,74"
2021,AquaChile,NA,"9,2"
2020,AquaChile,NA,"9,29"
2022,MOWI,NA,"9,1886638"
2021,MOWI,NA,"9,1886638"
2020,MOWI,NA,"14,5315492"
2019,MOWI,NA,"16,5868032"
2018,MOWI,NA,"14,5315492"
2017,MOWI,NA,"18,596662"
2016,MOWI,NA,"19,5848542"
2015,MOWI,NA,"15,5649083"
2014,MOWI,NA,"11,3615128"
2013,MOWI,NA,"9,1886638"
2012,MOWI,NA,"9,1886638"
2022,Salmar,Norway,"5,4"
2021,Salmar,Norway,5
2020,Salmar,Norway,"4,4"
2019,Salmar,Norway,"4,7"
2018,Salmar,Norway,"5,9"
2017,Salmar,Norway,"6,2"
2016,Salmar,Norway,"11,8"
2015,Salmar,Norway,"10,8"
2014,Salmar,Norway,"10,1"
2013,Salmar,Norway,"12,9"
2022,Salmar,Iceland,"10,3"
2021,Salmar,Iceland,"6,7"
2020,Salmar,Iceland,"9,5"
2019,Salmar,Iceland,"8,8"
2022,Leroy Seafood,NA,"7,5"
2021,Leroy Seafood,NA,"7,5"
2020,Leroy Seafood,NA,"7,8"
2019,Leroy Seafood,NA,"6,6"
2018,Leroy Seafood,NA,"6,1"
2017,Leroy Seafood,NA,"8,2"
2016,Leroy Seafood,NA,"7,8"
2015,Leroy Seafood,NA,7
2014,Leroy Seafood,NA,"7,4"
222 changes: 111 additions & 111 deletions data/ras_projects_for_map_2.4.csv

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions pinkbombs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from .graphs.viz import make_area_chart, make_area_single_chart
from .graphs.viz import make_area_order_chart, make_bar_chart
from .graphs.viz import make_color_bar_chart, make_color_bar_chart2, make_simple_bar_chart
from .graphs.viz import make_animated_bubble_map
from .graphs.viz import make_color_bar_chart, make_color_bar_chart2
from .graphs.viz import make_animated_bubble_map, make_treemap_chart
from .graphs.viz import make_simple_bar_chart, make_simple_pie_chart
from .graphs.viz import make_simple_box_chart
from .graphs.maps_viz import make_ras_bubble_map

from .router import api
Expand Down
51 changes: 43 additions & 8 deletions pinkbombs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"Tons",
"Country",
"Flag",
"\% of total",
"% of total",
"Top 10 countries producing salmon (2021)",
"Tonnes of farmed salmon produced",
"Country",
Expand Down Expand Up @@ -61,7 +61,6 @@
"Revenues 2022",
"Employees 2022",
[
"Country",
"Commercial name",
"Creation date",
"Headquarters",
Expand All @@ -87,12 +86,6 @@
"Revenues 2022 dollars",
"Employees 2022",
[
"Commercial name",
"Creation date",
"Headquarters",
"Website",
"Revenues 2022 dollars",
"Employees 2022",
"Number of projects",
"Countries of projects",
"Note",
Expand Down Expand Up @@ -120,6 +113,48 @@
"Antibiotics usage (tonnes)",
],
},
"escapes-rates": {
"filename": "escapes_marine_cages_3.5.csv",
"function": pb.make_treemap_chart,
"parser": pd.read_csv,
"arguments": [
"n_escape",
"n_salmon_produced",
"escape_rate",
"production (t)",
"Company",
"More than 4 millions fish escaped since 2018",
],
},
"mortality-rates": {
"filename": "mortality_rates_4.4.csv",
"function": pb.make_simple_box_chart,
"parser": pd.read_csv,
"arguments": [
"Company",
"Mortality_rate",
"Mortality rate by Companies",
"Company",
],
},
"carbon-bomb": {
"filename": "carbon_bombs_pie_chart_5.1.csv",
"function": pb.make_simple_pie_chart,
"parser": pd.read_csv,
"arguments": [
"Scopes",
"Emissions (tons CO2eq)",
"Distribution of Emissions",
{
'Emissions (tons CO2eq)': ':,.0f'
},
[
'#f4e8d7',
'#151c97',
'#f8ef50'
]
],
},
}

MAPS = {
Expand Down
Loading

0 comments on commit b71d930

Please sign in to comment.