Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63d1b7b
commit 280cb50
Showing
11 changed files
with
652 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
def recurse_mass(d): | ||
|
||
to_return = {} | ||
#cum_impact = 0 | ||
|
||
for k, v in d.items(): | ||
if k == 'amount' and d['tag'] == 'biosphere': | ||
#print (k, -v) | ||
to_return[k] = -v | ||
|
||
elif k == 'technosphere': | ||
#print('technosphere') | ||
for e in v: | ||
#print (e['activity']) | ||
#cum_impact += e['impact'] | ||
#if 'cum_impact' in e.keys(): | ||
# cum_impact += e['cum_impact'] | ||
|
||
if k in to_return.keys(): | ||
to_return[k].append(recurse_mass(e)) | ||
else: | ||
to_return[k] = [recurse_mass(e)] | ||
|
||
elif k in['biosphere', 'impact']: | ||
pass | ||
|
||
elif k == 'activity': | ||
#print (k,v) | ||
#activity_list = v.split('(') | ||
activity = v['name'] # activity_list[0].strip() | ||
unit = v['unit'] # activity_list[1].split(',')[0] | ||
#print(activity, unit) | ||
to_return['activity'] = str(activity) | ||
to_return['unit'] = unit | ||
if unit in ['kg', 'g']: | ||
to_return['is_mass'] = True | ||
else: | ||
to_return['is_mass'] = False | ||
|
||
#elif k == 'impact': | ||
# print('impact of {} = {}'.format(d['activity'], v)) | ||
|
||
else: | ||
to_return[k] = v | ||
#print('cum_impact of {} = {}'.format(d['activity'], cum_impact)) | ||
#to_return['cum_impact'] = cum_impact | ||
|
||
return to_return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.mf_node rect { | ||
cursor: move; | ||
fill-opacity: .9; | ||
/*shape-rendering: crispEdges;*/ | ||
} | ||
|
||
.mf_node text { | ||
pointer-events: none; | ||
font-size: 8px; | ||
} | ||
|
||
.mf_link { | ||
fill: none; | ||
stroke: rgba(0,0,0,0.2); | ||
/*stroke-opacity: .2;*/ | ||
} | ||
|
||
.mf_link:hover { | ||
stroke-opacity: .5; | ||
} | ||
|
||
.tag_other > rect{ | ||
fill: rgba(0,0,0,0.2) !important; | ||
stroke: none !important; | ||
/*stroke-opacity:.2; | ||
opacity: .2;*/ | ||
} | ||
|
||
.tag_other > rect:hover{ | ||
fill: rgba(255,255,255,0.5) !important; | ||
stroke: #000 !important; | ||
|
||
} | ||
|
||
.tag_other > text{ | ||
display: none; | ||
fill: rgba(0,0,0,0); | ||
} |
Oops, something went wrong.