colors = ({
navy: "#2C3E50",
teal: "#16A085",
orange: "#E67E22",
blue: "#3498DB",
gray: "#7F8C8D",
purple: "#9B59B6",
red: "#E74C3C"
})
viewof adoptionSpeed = Inputs.range([1, 10], {
value: 5,
step: 0.5,
label: "Adoption speed (1=slow, 10=fast)"
})
viewof yearsSinceIntro = Inputs.range([0, 30], {
value: 10,
step: 1,
label: "Years since introduction"
})
// S-curve calculation (logistic function)
calculateAdoption = (year, speed) => {
const k = speed / 5; // growth rate
const midpoint = 15; // inflection point
return 100 / (1 + Math.exp(-k * (year - midpoint)));
}
currentAdoption = calculateAdoption(yearsSinceIntro, adoptionSpeed)
// Generate curve data
curveData = Array.from({length: 31}, (_, i) => ({
year: i,
adoption: calculateAdoption(i, adoptionSpeed)
}))
// Determine phase
phase = currentAdoption < 2.5 ? "Innovators" :
currentAdoption < 16 ? "Early Adopters" :
currentAdoption < 50 ? "Early Majority" :
currentAdoption < 84 ? "Late Majority" : "Laggards"
phaseColor = phase === "Innovators" ? colors.purple :
phase === "Early Adopters" ? colors.blue :
phase === "Early Majority" ? colors.teal :
phase === "Late Majority" ? colors.orange : colors.red
Plot.plot({
width: typeof width === "number" ? Math.min(640, width) : 640,
height: 400,
marginLeft: 60,
marginBottom: 50,
x: {
label: "Years since introduction →",
domain: [0, 30],
grid: true
},
y: {
label: "↑ Market penetration (%)",
domain: [0, 100],
grid: true
},
marks: [
// S-curve line
Plot.line(curveData, {
x: "year",
y: "adoption",
stroke: colors.navy,
strokeWidth: 3
}),
// Current position marker
Plot.dot([{year: yearsSinceIntro, adoption: currentAdoption}], {
x: "year",
y: "adoption",
fill: phaseColor,
r: 8,
stroke: colors.navy,
strokeWidth: 2
}),
// Phase regions (background)
Plot.rect([
{x1: 0, x2: 30, y1: 0, y2: 2.5, label: "Innovators"},
{x1: 0, x2: 30, y1: 2.5, y2: 16, label: "Early Adopters"},
{x1: 0, x2: 30, y1: 16, y2: 50, label: "Early Majority"},
{x1: 0, x2: 30, y1: 50, y2: 84, label: "Late Majority"},
{x1: 0, x2: 30, y1: 84, y2: 100, label: "Laggards"}
], {
x1: "x1",
x2: "x2",
y1: "y1",
y2: "y2",
fill: "label",
fillOpacity: 0.05
})
]
})html`<div style="background: ${phaseColor}; color: white; padding: 20px; border-radius: 8px; margin-top: 20px;">
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px;">
<div style="min-width: 0; background: rgba(255,255,255,0.1); padding: 15px; border-radius: 6px;">
<div style="font-size: 0.85em; opacity: 0.9;">Current Phase</div>
<div style="font-size: clamp(1.2rem, 6vw, 1.6rem); font-weight: bold; margin: 5px 0; overflow-wrap: anywhere;">${phase}</div>
</div>
<div style="min-width: 0; background: rgba(255,255,255,0.1); padding: 15px; border-radius: 6px;">
<div style="font-size: 0.85em; opacity: 0.9;">Market Penetration</div>
<div style="font-size: clamp(1.2rem, 6vw, 1.6rem); font-weight: bold; margin: 5px 0; overflow-wrap: anywhere;">${currentAdoption.toFixed(1)}%</div>
</div>
<div style="min-width: 0; background: rgba(255,255,255,0.1); padding: 15px; border-radius: 6px;">
<div style="font-size: 0.85em; opacity: 0.9;">Years Elapsed</div>
<div style="font-size: clamp(1.2rem, 6vw, 1.6rem); font-weight: bold; margin: 5px 0; overflow-wrap: anywhere;">${yearsSinceIntro}</div>
</div>
</div>
<div style="margin-top: 15px; padding: 12px; background: rgba(255,255,255,0.1); border-radius: 4px; font-size: 0.9em;">
<strong>${phase} Phase:</strong>
${phase === "Innovators" ? "Risk-takers trying unproven technology. Market is tiny but crucial for feedback." : ""}
${phase === "Early Adopters" ? "Visionaries see potential. Word-of-mouth begins. Chasm ahead." : ""}
${phase === "Early Majority" ? "Pragmatists adopt proven solutions. Growth accelerates rapidly." : ""}
${phase === "Late Majority" ? "Skeptics adopt when it becomes standard. Growth slows." : ""}
${phase === "Laggards" ? "Traditionalists adopt only when forced. Market saturated." : ""}
</div>
</div>`