From a97e74474f9fcab4f257f6e5ee298ac295a3ee17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleks=20R=C5=ABti=C5=86=C5=A1?= Date: Sun, 2 Jun 2024 11:41:37 -0400 Subject: [PATCH] Repressors & Leaks --- assets/math.js | 10 ++--- layouts/base.html | 22 +++++++++-- pages/repressors.md | 81 ++++++++++++++++++++++++++++++++++++++- pages/simplest-circuit.md | 6 +-- 4 files changed, 106 insertions(+), 13 deletions(-) diff --git a/assets/math.js b/assets/math.js index 0f0ed2c..3e5d093 100644 --- a/assets/math.js +++ b/assets/math.js @@ -12,7 +12,7 @@ function defineVars(vars) { }); } -function plot(target, fn, deps) { +function plot(target, fns, deps) { const depsEl = deps.map(document.querySelector.bind(document)); const plot = () => { functionPlot({ @@ -21,11 +21,9 @@ function plot(target, fn, deps) { height: 400, yAxis: { domain: [-1, 9] }, grid: true, - data: [ - { - fn: fn(...(depsEl.map(el => el.value))) - } - ] + data: fns(...(depsEl.map(el => parseFloat(el.value)))).map(fn => ({ + fn + })) }); } diff --git a/layouts/base.html b/layouts/base.html index 9f50275..9a5c38a 100644 --- a/layouts/base.html +++ b/layouts/base.html @@ -9,8 +9,24 @@ - + + + @@ -22,7 +38,7 @@