Published
Edited
May 24, 2020
2 stars
Insert cell
md`# Traits of Pollinator Communities and their consequences`
Insert cell
image4 = FileAttachment("F1.large.jpg").image()
Insert cell
md`## ( WILL FOCUS) Trait 1: Small world structure: two given species are seperated by small number of links from any other species in the web `
Insert cell
image = FileAttachment("20200226_114029.jpg").image()
Insert cell
d3 = require("https://d3js.org/d3.v5.min.js")
Insert cell
graph2 = {
const height = 300
var n = d3.range(0,50).map(function(d) { return { name:d, } })
var l = [];
n.forEach(function(d,i) { l.push({source:n[0],target:n[i]}) })

const simulation = d3.forceSimulation(n)
.force("link", d3.forceLink(l).strength(1) )
.force("charge", d3.forceManyBody().strength([-30]))
.force("center", d3.forceCenter(width / 2, height / 2))
.on("tick", ticked);
const svg = d3.select(DOM.svg(width, height));

const node = svg
.selectAll("circle")
.data(n)
.enter().append("circle")
.attr("id", function(d) { return "node_"+d.name })
.attr("r", 10)
.attr("stroke-width", "2px")
.style("stroke", "steelblue")
.attr("fill", "white")
.call(d3.drag()
.on("start", dragstarted)
.on("drag", dragged)
.on("end", dragended));
const link = svg
.selectAll("line")
.data(l)
.enter().insert("line","circle")
.attr("id", function(d,i) { return "link_"+i })
.attr("x1", d=> d.source.x)
.attr("y1", d=> d.source.y)
.attr("x2", d=> d.target.x)
.attr("y2", d=> d.target.y)
.attr("stroke-width", "2px")
.style("stroke", "steelblue")
function ticked() {
node
.attr("cx", d => d.x)
.attr("cy", d => d.y);
link
.attr("x1", d=> d.source.x)
.attr("y1", d=> d.source.y)
.attr("x2", d=> d.target.x)
.attr("y2", d=> d.target.y)
}
function dragstarted(d) {
if (!d3.event.active) simulation.alphaTarget(1).restart();
d.fx = d.x;
d.fy = d.y;
}

function dragged(d) {
d.fx = d3.event.x;
d.fy = d3.event.y;
}

function dragended(d) {
if (!d3.event.active) simulation.alphaTarget(0);
d.fx = null;
d.fy = null;
}
return svg.node();
}
Insert cell
bees = d3.range(10)
Insert cell
image2 = FileAttachment("generalist.png").image()
Insert cell
md` Looking at the complicated network diagram, a student may be scared to learn about the pollinator networks. But as people know, that is not the case. Once the student understands the roles of genralists and specialists for both plants and pollinators as well as understand the bipartite characteristics of the network, the network can be analyzed easier and in detail. `
Insert cell
md` So what exactly are these pollinators and plants, and how would we define them?

generalists: with functional redundancy, and more resistant to extincton. They can also tend to drive evolution

Generalist Pollinator: a pollinator which visits and pollinates the majority of plant species

Generalist Plant: a plant which interacts with more than one pollinator specie

Specialist Pollinator: a pollinator that visits (and hence pollinates) only a limited number of plant species, i.e. one that has different flower preferences from the others

Specialist Plant: a plant which interacts with only a few selected pollinator specie`
Insert cell
md` In most pollinator communities, generalist plants like to match with specialist pollinators while specialist plants like to match with generalist pollinators. That is so because of nestedness. We will talk about nestedness later on too but to simply put, if specialist pollinators only match with specialist plants, they depend on each one another too much and are much more vulnerable to extinction if the other goes extinct or some other environmental effect affects them. `
Insert cell
md` Bipartite graph is a graph whose verticies is divided into two disjoint and independent sets and such which every edge connects to a vertext to one in.`
Insert cell
md` Once all these concepts have been understood, it is easier to percept this whole idea as just one game. You set yourself from the perspective of a generalist/specialist pollinator/plant and make choices of what you would do. For example, if you are a specialist plant wouldn't you only want to interact with a generalist pollinator?`
Insert cell
md` And just like a game, every action/move will yield a result. Let's say as a specialist plant, you decided to not interact with a generalist pollinator but only a specialist pollinator. One day the specialist pollinator you interacted with dies from a insecticide. Well... good luck, let's see if you can find a pollinator in the mean time or uh oh.`
Insert cell
md`## Nestedness: specialists interact with a subset of whole set of species that generalists interact with
WILL USE ADJACENCY MATRIX`
Insert cell
image3 = FileAttachment("20200226_114036.jpg").image()
Insert cell
html`<style>
svg.matrixdiagram {
font: 10px sans-serif;
}
svg.matrixdiagram .label {
fill: #999;
font-size: 8px;
text-anchor: end;
}
svg.matrixdiagram .column .label {
text-anchor: start;
}
svg.matrixdiagram rect {
fill: #eee;
stroke: #d62333;
stroke-width: 0;
}
svg.matrixdiagram rect:hover {
stroke-width: 1px;
}
</style>`
Insert cell
Insert cell
data = (await fetch("https://cdn.rawgit.com/mbostock/4062045"
+ "/raw/5916d145c8c048a6e3086915a6be464467391c62"
+ "/miserables.json")).json()
Insert cell
d33 = require("https://d3js.org/d3.v5.min.js")
Insert cell
md `WHY NESTEDNESS MATTERS : Importantly, seminal work has predicted that more ordered network structures (as opposed to random network structures) should be found in less predictable environments (Levins, 1968; Margalef, 1968; May, 1975; Odum, 1969). The rationale is that under less predictable environments, species may enhance their tolerance to external disturbances through well‐structured communities. In this line, theoretical work has shown that a nested structure in plant–pollinator networks can enhance species coexistence by minimizing species competition, and by increasing the range of intrinsic conditions leading to positive species abundances`
Insert cell
md`#### Trait 4 * : In a nested matrix version, species are ranked according to their number of links,`
Insert cell
md`#### Trait 4 * : Quite obviously: increase in nestedness should be more advantageous and occur more often in locations subject to random environmental perturbations, which could be driven by highly changing or seasonal environments.`
Insert cell
nest = FileAttachment("Association of nestedness with other network descriptors and constraints..jpg").image()
Insert cell
md `For 59 observed plant–pollinator networks, (a) and (b) show the positive and negative association of nestedness (NODF) with connectance and number of species (log of geometric mean of plants and pollinators) respectively. Results are qualitatively the same if the number of species is calculated by the log of the sum of plants and pollinators. (c) It illustrates the positive association between nestedness (NODF) and the maximum value of nestedness that can be reached in the corresponding network (calculated using a greedy algorithm). Each point corresponds to one of the 59 networks. The red lines correspond to the linear regression (intended to guide the eye), and r corresponds to the Pearson correlation (all correlations were significant at the 5% confidence level)`
Insert cell
md `HOW NESTEDNESS IS CALCULATED: : NODF, which has shown to be a consistent metric based on two basic properties derived from the original concept of nestedness: species can be arranged in decreasing order according to their number of mutualistic partners, and the mutualistic partners of species with few interactions are typically shared with species with more interactions

or z scores! higher z- more nested. not for comparison (downside: depends too much on the size of network)`
Insert cell
https://www.youtube.com/watch?time_continue=30&v=g2mW8g0TLmo&feature=emb_title
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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