Public
Edited
Nov 3, 2022
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
yExtent = d3.extent(baseDemandY)
Insert cell
yScale = [
Math.floor(yExtent[0] / 1000) * 1000,
Math.ceil(yExtent[1] / 1000) * 1000
]
Insert cell
baseDemand = supplyDemandX.map((d, i) => [d, baseDemandY[i]])
Insert cell
baseSupply = supplyDemandX.map((d, i) => [d, baseSupplyY[i]])
Insert cell
supplyDemandX = d3.range(20, 80)
Insert cell
demandSlope = -10
Insert cell
supplySlope = -demandSlope
Insert cell
baseDemandC1 = 10000
Insert cell
baseDemandY = supplyDemandX.map((d) => d * demandSlope + baseDemandC1)
Insert cell
baseIntersectY = demandSlope * 50 + baseDemandC1
Insert cell
baseIntersectX = 50
Insert cell
supplyIntercept = baseIntersectY - supplySlope * baseIntersectX
Insert cell
baseSupplyY = supplyDemandX.map((d) => d * supplySlope + supplyIntercept)
Insert cell
variableDotX = baseIntersectX + adForm.x2
Insert cell
variableDotY = variableDotX * supplySlope + supplyIntercept
Insert cell
variableDot = [variableDotX,variableDotY]
Insert cell
variableIntercept = variableDotY - demandSlope * variableDotX
Insert cell
variableDemandX = supplyDemandX.map((d) => d + adForm.x2)
Insert cell
variableDemandY = variableDemandX.map((d) => d * demandSlope + variableIntercept)
Insert cell
variableDemand = variableDemandX.map((d, i) => [d, variableDemandY[i]])
Insert cell
Insert cell
import { Plot, addTooltips } from "@mkfreeman/plot-tooltip"
Insert cell
import { color as colorWidget, radio as radioWidget } from "@jashkenas/inputs"
Insert cell
import { signature } from "3d9d1394d858ca97"
Insert cell
import {
rangeSlider,
rangeInput,
themes,
theme,
color,
theme_Retro1
} from "@beerdrinker/range-slider"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more