feat(lab-graph): введённые функции — редактируемое KaTeX-поле
Введённая функция показывается отрисованной формулой KaTeX прямо в строке; клик по формуле → правка текста на месте (raw input + живое превью под полем), клик мимо/blur → снова формула. Реализовано без MathQuill: .fn-field держит <input> и .fn-math (KaTeX), класс has-math переключает отображение по фокусу. - renderFnMath() рисует формулу в строке; _fnDisplay() решает режим (фокус+значение) - focus/blur/mousedown-обработчики в _initGraphPanel (идемпотентно) - живое превью .fn-preview теперь видно ТОЛЬКО при правке (:focus-within), цвет функции - graphInsert/applyPreset/state-apply/clearAll/default-fn0 обновляют math-поле - _katexInto() — общий безопасный рендер Только фронт. node --check OK; логика вставки 5/5 (прошлый прогон). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,10 @@
|
||||
<div class="fn-row">
|
||||
<div class="fn-dot"></div>
|
||||
<span class="fn-label">y =</span>
|
||||
<input class="fn-input" id="fn0" placeholder="sin(x)" autocomplete="off" spellcheck="false" oninput="updateFn(0)" />
|
||||
<div class="fn-field">
|
||||
<input class="fn-input" id="fn0" placeholder="sin(x)" autocomplete="off" spellcheck="false" oninput="updateFn(0)" />
|
||||
<div class="fn-math" id="fn0-math" title="Нажми, чтобы изменить"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fn-preview" id="fn0-prev"></div>
|
||||
<div class="fn-err" id="fn0-err">Синтаксическая ошибка</div>
|
||||
@@ -21,7 +24,10 @@
|
||||
<div class="fn-row">
|
||||
<div class="fn-dot"></div>
|
||||
<span class="fn-label">y =</span>
|
||||
<input class="fn-input" id="fn1" placeholder="x^2 - 4" autocomplete="off" spellcheck="false" oninput="updateFn(1)" />
|
||||
<div class="fn-field">
|
||||
<input class="fn-input" id="fn1" placeholder="x^2 - 4" autocomplete="off" spellcheck="false" oninput="updateFn(1)" />
|
||||
<div class="fn-math" id="fn1-math" title="Нажми, чтобы изменить"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fn-preview" id="fn1-prev"></div>
|
||||
<div class="fn-err" id="fn1-err">Синтаксическая ошибка</div>
|
||||
@@ -32,7 +38,10 @@
|
||||
<div class="fn-row">
|
||||
<div class="fn-dot"></div>
|
||||
<span class="fn-label">y =</span>
|
||||
<input class="fn-input" id="fn2" placeholder="tg(x)" autocomplete="off" spellcheck="false" oninput="updateFn(2)" />
|
||||
<div class="fn-field">
|
||||
<input class="fn-input" id="fn2" placeholder="tg(x)" autocomplete="off" spellcheck="false" oninput="updateFn(2)" />
|
||||
<div class="fn-math" id="fn2-math" title="Нажми, чтобы изменить"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fn-preview" id="fn2-prev"></div>
|
||||
<div class="fn-err" id="fn2-err">Синтаксическая ошибка</div>
|
||||
|
||||
Reference in New Issue
Block a user