Published
Edited
Mar 15, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {working_memory} from "@ch-bu/visualisierung-ergebnisse-studie-ward-und-kollegen"
Insert cell
import {studiesViz} from '@ch-bu/effekt-ward-visualisierung'
Insert cell
Insert cell
sigsquared = σ**2
Insert cell
abs_x = 6
Insert cell
area = d3.area()
.x(d => x(d.x))
.y1(d => y(d.y))
.y0(y(0))
Insert cell
y = d3.scaleLinear()
.domain([Math.min(d3.min(data, d => d.y),0), Math.max(1,d3.max(data, d => d.y))]).nice()
.range([innerHeight, 0])
Insert cell
data = {
let values = [];
for (let x = -abs_x; x < abs_x; x=x+0.01) values.push({"x":x,"y":normal_pdf(x, µ, sigsquared)});
return values;
}
Insert cell
function normal_pdf (input_value, mu, sigsq) {
let left_chunk = 1/(Math.sqrt(2*Math.PI*sigsq))
let right_top = -((input_value-mu)**2)
let right_bottom = 2*sigsq
return left_chunk * Math.exp(right_top/right_bottom)
}

Insert cell
data_null = {
let values = [];
for (let x = -abs_x; x < abs_x; x=x+0.01) values.push({"x":x,"y":normal_pdf(x, 0, sigsquared)});
return values;
}
Insert cell
margin = ({top: 20, left: 20, right: 20, bottom: 80})
Insert cell
µ = 0.31
Insert cell
height = 400
Insert cell
innerWidth = width - margin.left - margin.right
Insert cell
innerHeight = 400 - margin.top - margin.bottom
Insert cell
x = d3.scaleLinear()
.domain([-3, 6])
.range([0, innerWidth])
Insert cell
d3 = require('d3')
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