Published
Edited
May 9, 2022
1 star
Insert cell
Insert cell
<svg width="1100" height="1300">
<rect id = "fffbox" x="150" y="185" width="101.33" height="25" style="fill:lightgrey; stroke: yellowgreen; stroke-width: 2;opacity:0.5;"/>
<rect id = "fffbox" x="230" y="190" width="104" height="25" style="fill:lightgrey; stroke: orange; stroke-width: 2;opacity:0.5;"/>
<rect id = "fffbox" x="310" y="185" width="80" height="25" style="fill:lightgrey; stroke: orangered; stroke-width: 2;opacity:0.5;"/>
<rect id = "fffbox" x="391" y="190" width="559" height="25" style="fill:lightgrey; stroke: red; stroke-width: 2;opacity:0.5;"/>

<rect id = "dffbox" x="179" y="380" width="29" height="25" style="fill:lightgrey; stroke: orangered; stroke-width: 2;opacity:0.5;"/>
<rect id = "dffbox" x="150" y="390" width="250" height="25" style="fill:lightgrey; stroke: red; stroke-width: 2;opacity:0.5;"/>
<rect id = "dffbox2" x="425" y="380" width="52" height="25" style="fill:lightgrey; stroke: orange; stroke-width: 2;opacity:0.5;"/>
<rect id = "dffbox2" x="425" y="400" width="85" height="25" style="fill:lightgrey; stroke: orangered; stroke-width: 2;opacity:0.5;"/>
<rect id = "dffbox2" x="425" y="390" width="250" height="25" style="fill:lightgrey; stroke: red; stroke-width: 2;opacity:0.5;"/>
<rect id = "dffbox3" x="700" y="385" width="121.4" height="25" style="fill:lightgrey; stroke: yellowgreen; stroke-width: 2;opacity:0.5;"/>
<rect id = "dffbox3" x="700" y="380" width="109.6" height="25" style="fill:lightgrey; stroke: orange; stroke-width: 2;opacity:0.5;"/>
<rect id = "dffbox3" x="709.2" y="400" width="72.2" height="25" style="fill:lightgrey; stroke: orangered; stroke-width: 2;opacity:0.5;"/>
<rect id = "dffbox3" x="714" y="390" width="236" height="25" style="fill:lightgrey; stroke: red; stroke-width: 2;opacity:0.5;"/>

<rect id = "gefbox" x="502" y="585" width="448" height="25" style="fill:lightgrey; stroke: green; stroke-width: 2;opacity:0.5;"/>
<rect id = "gefbox" x="462" y="590" width="56" height="25" style="fill:lightgrey; stroke: yellowgreen; stroke-width: 2;opacity:0.5;"/>
<rect id = "gefbox" x="430" y="585" width="56" height="25" style="fill:lightgrey; stroke: orange; stroke-width: 2;opacity:0.5;"/>
<rect id = "gefbox" x="366" y="590" width="112" height="25" style="fill:lightgrey; stroke: orangered; stroke-width: 2;opacity:0.5;"/>
<rect id = "gefbox" x="150" y="585" width="256" height="25" style="fill:lightgrey; stroke: red; stroke-width: 2;opacity:0.5;"/>

<rect id = "wffbox" x="172.86" y="800" width="777.14" height="20" style="fill:lightgrey; stroke: red; stroke-width: 2;opacity:0.5;"/>
<rect id = "wffbox" x="150" y="785" width="80" height="25" style="fill:lightgrey; stroke: yellowgreen; stroke-width: 2;opacity:0.5;"/>
<rect id = "wffbox" x="299" y="790" width="69.14" height="25" style="fill:lightgrey; stroke: orange; stroke-width: 2;opacity:0.5;"/>
<rect id = "wffbox" x="390" y="785" width="91.43" height="25" style="fill:lightgrey; stroke: orangered; stroke-width: 2;opacity:0.5;"/>
<rect id = "pffbox" x="187.5" y="980" width="11.25" height="25" style="fill:lightgrey; stroke: orangered; stroke-width: 2;opacity:0.5;"/>
<rect id = "pffbox" x="150" y="990" width="375" height="25" style="fill:lightgrey; stroke: red; stroke-width: 2;opacity:0.5;"/>
<rect id = "pffbox2" x="584.375" y="990" width="365.625" height="25" style="fill:lightgrey; stroke: yellowgreen; stroke-width: 2;opacity:0.5;"/>
<rect id = "pffbox2" x="578.75" y="985" width="343.12" height="25" style="fill:lightgrey; stroke: orange; stroke-width: 2;opacity:0.5;"/>
<rect id = "pffbox2" x="652.625" y="990" width="239.25" height="25" style="fill:lightgrey; stroke: orangered; stroke-width: 2;opacity:0.5;"/>
<rect id = "pffbox2" x="586.25" y="980" width="301.875 " height="25" style="fill:lightgrey; stroke: red; stroke-width: 2;opacity:0.5;"/>
<line id="FFF" style="fill:none;stroke:#000000;stroke-width:1;" x1="150" y1="200" x2="950" y2="200"/>
<line id="DFFP" style="fill:none;stroke:#000000;stroke-width:1;" x1="150" y1="400" x2="400" y2="400"/>
<line id="DFFF" style="fill:none;stroke:#000000;stroke-width:1;" x1="425" y1="400" x2="675" y2="400"/>
<line id="DFFC" style="fill:none;stroke:#000000;stroke-width:1;" x1="700" y1="400" x2="950" y2="400"/>
<line id="GEF" style="fill:none;stroke:#000000;stroke-width:1;" x1="150" y1="600" x2="950" y2="600"/>
<line id="WFF" style="fill:none;stroke:#000000;stroke-width:1;" x1="150" y1="800" x2="950" y2="800"/>
<line id="PFF" style="fill:none;stroke:#000000;stroke-width:1;" x1="150" y1="1000" x2="525" y2="1000"/>
<line id="PFF" style="fill:none;stroke:#000000;stroke-width:1;" x1="575" y1="1000" x2="950" y2="1000"/>

<line id="line2" style="fill:none;stroke:green;stroke-width:3;opacity:0.5;"x1="150" y1="150" x2="150" y2="250"/>
<line id="line2" style="fill:none;stroke:red;stroke-width:3;opacity:0.6;"x1="950" y1="150" x2="950" y2="250"/>
<line id="line2" style="fill:none;stroke:green;stroke-width:3;opacity:0.5;"x1="150" y1="350" x2="150" y2="450"/>
<line id="line2" style="fill:none;stroke:red;stroke-width:3;opacity:0.6;"x1="400" y1="350" x2="400" y2="450"/>
<line id="line2" style="fill:none;stroke:green;stroke-width:3;opacity:0.5;"x1="425" y1="350" x2="425" y2="450"/>
<line id="line2" style="fill:none;stroke:red;stroke-width:3;opacity:0.6;"x1="675" y1="350" x2="675" y2="450"/>
<line id="line2" style="fill:none;stroke:green;stroke-width:3;opacity:0.5;"x1="700" y1="350" x2="700" y2="450"/>
<line id="line2" style="fill:none;stroke:red;stroke-width:3;opacity:0.6;"x1="950" y1="350" x2="950" y2="450"/>

<line id="line4" style="fill:none;stroke:red;stroke-width:3;opacity:0.6;"x1="150" y1="550" x2="150" y2="650"/>
<line id="line4" style="fill:none;stroke:green;stroke-width:3;opacity:0.5;"x1="950" y1="550" x2="950" y2="650"/>

<line id="line5" style="fill:none;stroke:green;stroke-width:3;opacity:0.5;"x1="150" y1="750" x2="150" y2="850"/>
<line id="line5" style="fill:none;stroke:red;stroke-width:3;opacity:0.6;"x1="950" y1="750" x2="950" y2="850"/>

<line id="line6" style="fill:none;stroke:green;stroke-width:3;opacity:0.5;"x1="150" y1="950" x2="150" y2="1050"/>
<line id="line6" style="fill:none;stroke:red;stroke-width:3;opacity:0.6;"x1="950" y1="950" x2="950" y2="1050"/>
<line id="line6" style="fill:none;stroke:green;stroke-width:3.2;opacity:0.5;"x1="575" y1="950" x2="575" y2="1050"/>
<line id="line6" style="fill:none;stroke:red;stroke-width:3;opacity:0.6;"x1="525" y1="950" x2="525" y2="1050"/>

<text class = "type1" x="140" y="280">0%</text>
<text class = "type1" x="140" y="135">A</text>
<text class = "type2" x="160" y="180">B [0-3.8%]</text>
<text class = "type3" x="240" y="235">C [3-6.9%]</text>
<text class = "type4" x="305" y="180">D [6-8.9%]</text>
<text class = "type5" x="600" y="235">F [0.1-100%]</text>
<text class = "type5" x="600" y="235">F [0.1-100%]</text>

<text class = "typedff4" x="160" y="370">D [0.6-1.4%]</text>
<text class = "typedff5" x="240" y="435">F [0.1-5.1%]</text>
<text class = "typedff5" x="240" y="435">F [0.1-5.1%]</text>

<text class = "typedff3" x="430" y="370">C [0-2.5%]</text>
<text class = "typedff4" x="430" y="440">D [0-4.1%]</text>
<text class = "typedff5" x="550" y="435">F [0-9.2%]</text>
<text class = "typedff5" x="550" y="435">F [0-9.2%]</text>

<text class = "typedff2" x="720" y="375">B [0-17%]</text>
<text class = "typedff3" x="710" y="355">C [0.4-15.2%]</text>
<text class = "typedff4" x="710" y="440">D [1.3-11.4%]</text>
<text class = "typedff5" x="830" y="435">F [1.9-100%]</text>
<text class = "typedff5" x="830" y="435">F [1.9-100%]</text>

<text class = "type5" x="240" y="580">F [0-32]</text>
<text class = "type5" x="240" y="580">F [0-32]</text>
<text class = "type4" x="370" y="635">D [27-41]</text>
<text class = "type3" x="430" y="580">C [35-42]</text>
<text class = "type2" x="460" y="635">B [39-46]</text>
<text class = "type1" x="660" y="580">A [44-48]</text>

<text class = "type2" x="160" y="780">B [0-0.7%]</text>
<text class = "type3" x="280" y="780">C [1.3-1.9%]</text>
<text class = "type4" x="395" y="775">D [2.1-2.9%]</text>
<text class = "type5" x="500" y="840">F [0.-8.6%]</text>

<text class = "typedff4" x="160" y="970">D [1-1.4%]</text>
<text class = "typedff5" x="300" y="1035">F [0.2-6.5%]</text>
<text class = "typedff5" x="300" y="1035">F [0.2-6.5%]</text>

<text class = "typedff2" x="720" y="955">B [0.5-20%]</text>
<text class = "typedff3" x="700" y="1030">C [0.2-18.5%]</text>
<text class = "typedff4" x="750" y="1045">D [2.7-16.9%]</text>
<text class = "typedff5" x="710" y="975">F [0.6-16.7%]</text>
<text class = "typedff5" x="710" y="975">F [0.6-16.7%]</text>
<text class = "type1" x="140" y="480">0%</text>
<text class = "type2" x="140" y="680">0</text>
<text class = "type1" x="140" y="880">0%</text>
<text class = "type1" x="140" y="1080">0%</text>

<text class = "type1" x="140" y="335">A</text>
<text class = "type1" x="415" y="335">A</text>
<text class = "type1" x="690" y="335">A</text>
<text class = "type1" x="140" y="735">A</text>
<text class = "type1" x="140" y="935">A</text>
<text class = "type1" x="570" y="935">A</text>




<text class = "type6" x="5" y="150">Fossil Free Grade </text>
<text class = "type6" x="0" y="350">Deforestation Free Grade</text>
<text class = "type6" x="0" y="550">Gender Equality Grade</text>
<text class = "type6" x="0" y="750">Military Weapon Grade</text>
<text class = "type6" x="15" y="930">Prison Industrial</text>
<text class = "type6" x="20" y="950">Complex Grade</text>

<text class = "type6" x="440" y="270">% of net assets invest in Fossil Fuels</text>
<text class = "type6" x="430" y="490">% of net assets invest in Deforestation Funds</text>
<text class = "type6" x="230" y="455">% Producer</text>
<text class = "type6" x="510" y="455">% Financier</text>
<text class = "type6" x="760" y="455">% Consumer Brand</text>
<text class = "type6" x="480" y="680">Gender Equality Score</text>
<text class = "type6" x="420" y="890">% of net assets invest in Military Weapons Funds</text>
<text class = "type6" x="440" y="1090">% of net assets invest in Prison Funds</text>
<text class = "type6" x="280" y="1060">% General Risk</text>
<text class = "type6" x="720" y="1060">% Higher Risk</text>

<rect id = "boxf" x="25" y="165" width="70" height="70" style="fill:none; stroke: black; stroke-width: 1.5"/>
<rect id = "boxd" x="25" y="365" width="70" height="70" style="fill:none; stroke: black; stroke-width: 1.5"/>
<rect id = "boxg" x="25" y="565" width="70" height="70" style="fill:none; stroke: black; stroke-width: 1.5"/>
<rect id = "boxw" x="25" y="765" width="70" height="70" style="fill:none; stroke: black; stroke-width: 1.5"/>
<rect id = "boxp" x="25" y="965" width="70" height="70" style="fill:none; stroke: black; stroke-width: 1.5"/>

<text id = "gradename" class = "grade" x="0" y="25"></text>
<text id = "gradefossil" class = "grade" x="60" y="210"></text>
<text id = "gradedeforestation" class = "grade" x="60" y="410"></text>
<text id = "gradegender" class = "grade" x="60" y="610"></text>
<text id = "gradeweapon" class = "grade" x="60" y="810"></text>
<text id = "gradeprison" class = "grade" x="60" y="1010"></text>
<style>
text.type1 {font-size: 18px; fill: green;}
text.type2 {font-size: 18px; fill: yellowgreen; opacity: 0.6}
text.type3 {font-size: 18px; fill: orange; opacity: 0.4}
text.type4 {font-size: 18px; fill: orangered; opacity: 0.4}
text.type5 {font-size: 18px; fill: red; opacity: 0.4}
text.type6 {font-size: 12px; fill: black;}

text.typedff2 {font-size: 15px; fill: yellowgreen; opacity: 0.6}
text.typedff3 {font-size: 15px; fill: orange; opacity: 0.4}
text.typedff4 {font-size: 15px; fill: orangered; opacity: 0.4}
text.typedff5 {font-size: 15px; fill: red; opacity: 0.4}
line {stroke: white; stroke-width: 1;}
text.subtext {font-size: 14px; fill: white;}
text.subtext2 {font-size: 20px; fill: white;}
text.grade {font-size: 30px; fill: white; text-anchor: middle}
text.
</style>
</svg>
Insert cell
Insert cell
Insert cell
Insert cell
viewof sliderData = Inputs.search(alldata, {placeholder: "Fund profile: Shareclass name"})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
movedots = (funds)=> {
let fossilfuely = 200;
let deforestationy = 400;
let gendery = 600;
let weapony = 800;
let prisony = 1000;

let ffdots = vis.selectAll('.ffdot')
.data(sliderData)
.join('circle')
.classed('ffdot', true)
.attr('cx', d=> scalexmain(d['Fossil Free Funds: Fossil fuel holdings, weight'] ))
.attr('cy', fossilfuely)
.attr('r', 5)
.style("fill", (d)=>"black")
.style("opacity", (d)=>"0.8")
let dfdots = vis.selectAll('.dfdot')
.data(sliderData)
.join('circle')
.classed('dfdot', true)
.attr('cx', d=> scalexmainDFFp(d['Deforestation Free Funds: Deforestation-risk producer, weight'] ))
.attr('cy', deforestationy)
.attr('r', 5)
.style("fill", (d)=>"red")
.style("opacity", (d)=>"0.8")

let df2dots = vis.selectAll('.df2dot')
.data(sliderData)
.join('circle')
.classed('df2dot', true)
.attr('cx', d=> scalexmainDFFf(d['Deforestation Free Funds: Deforestation-risk financier, weight'] ))
.attr('cy', deforestationy)
.attr('r', 5)
.style("fill", (d)=>"blue")
.style("opacity", (d)=>"0.8")
let df3dots = vis.selectAll('.df3dot')
.data(sliderData)
.join('circle')
.classed('df3dot', false)
.attr('cx', d=> scalexmainDFFc(d['Deforestation Free Funds: Deforestation-risk consumer brand, weight'] ))
.attr('cy', deforestationy)
.attr('r', 5)
.style("fill", (d)=>"purple")
.style("opacity", (d)=>"0.8")
let gfdots = vis.selectAll('.gfdot')
.data(sliderData)
.join('circle')
.classed('gfdot', true)
.attr('cx', d=> scalexmainGEF(d['Gender Equality Funds: Gender equality score - Overall score (out of 100 points)'] ))
.attr('cy', gendery)
.attr('r', 5)
.style("fill", (d)=>"black")
.style("opacity", (d)=>"0.8")
let wfdots = vis.selectAll('.wfdot')
.data(sliderData)
.join('circle')
.classed('wfdot', true)
.attr('cx', d=> scalexmainWFW(d['Weapon Free Funds: Military weapon, weight'] ))
.attr('cy', weapony)
.attr('r', 5)
.style("fill", (d)=>"black")
.style("opacity", (d)=>"0.8")

let pfdots = vis.selectAll('.pfdot')
.data(sliderData)
.join('circle')
.classed('pfdot', true)
.attr('cx', d=> scalexmainPFF(d['Prison Free Funds: All flagged, weight'] ))
.attr('cy', prisony)
.attr('r', 5)

let pf2dots = vis.selectAll('.pf2dot')
.data(sliderData)
.join('circle')
.classed('pf2dot', true)
.attr('cx', d=> scalexmainPFF2(d['Prison Free Funds: All flagged, higher risk, weight'] ))
.attr('cy', prisony)
.attr('r', 5)
.style("fill", (d)=>"orange")
.style("opacity", (d)=>"0.8")
if (sliderData.length == 1) {
let grade = sliderData[0]["Fossil Free Funds: Fossil fuel grade"];
let color;
if (grade == "A") {
color = "green";
}
else if (grade == "B") {
color = "yellowgreen";
}
else if (grade == "C") {
color = "orange";
}
else if (grade == "D") {
color = "orangered";
}
else {
color = "red";
}
d3.select("#gradefossil").text(grade);
d3.select("#boxf").style("fill", color);
}
if (sliderData.length == 1) {
let grade = sliderData[0]["Deforestation Free Funds: Deforestation grade"];
let color;
if (grade == "A") {
color = "green";
}
else if (grade == "B") {
color = "yellowgreen";
}
else if (grade == "C") {
color = "orange";
}
else if (grade == "D") {
color = "orangered";
}
else {
color = "red";
}
d3.select("#gradedeforestation").text(grade);
d3.select("#boxd").style("fill", color);
}
if (sliderData.length == 1) {
let grade = sliderData[0]["Gender Equality Funds: Gender equality grade"];
let color;
if (grade == "A") {
color = "green";
}
else if (grade == "B") {
color = "yellowgreen";
}
else if (grade == "C") {
color = "orange";
}
else if (grade == "D") {
color = "orangered";
}
else {
color = "red";
}
d3.select("#gradegender").text(grade);
d3.select("#boxg").style("fill", color);
}
if (sliderData.length == 1) {
let grade = sliderData[0]["Weapon Free Funds: Military weapon grade"];
let color;
if (grade == "A") {
color = "green";
}
else if (grade == "B") {
color = "yellowgreen";
}
else if (grade == "C") {
color = "orange";
}
else if (grade == "D") {
color = "orangered";
}
else {
color = "red";
}
d3.select("#gradeweapon").text(grade);
d3.select("#boxw").style("fill", color);
}
if (sliderData.length == 1) {
let grade = sliderData[0]["Prison Free Funds: Prison industrial complex grade"];
let color;
if (grade == "A") {
color = "green";
}
else if (grade == "B") {
color = "yellowgreen";
}
else if (grade == "C") {
color = "orange";
}
else if (grade == "D") {
color = "orangered";
}
else {
color = "red";
}
d3.select("#gradeprison").text(grade);
d3.select("#boxp").style("fill", color);
}

}

Insert cell
movedots(sliderData)
Insert cell
sliderData[0]
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more