feat(export): 函数图像静态渲染(function-plot → SVG)

- 新增 app/plot 包:白名单表达式解析(ast 无 eval)+ FunctionPlot 模型 + 静态 SVG 渲染
- HtmlExporter 的 function_plot 节点解析并内嵌 SVG,解析失败回退占位并转诊断
- 新增 test_plot.py(13 个测试)覆盖表达式安全、指令解析、SVG 输出与导出链路集成

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
yxx
2026-09-04 22:41:35 +08:00
co-authored by Claude Code
parent 64af1f5165
commit f49d1245a1
6 changed files with 804 additions and 5 deletions
+7
View File
@@ -0,0 +1,7 @@
"""Function Plot:函数图像的白名单表达式解析与静态 SVG 渲染。
模块划分:
- model.py FunctionPlot 等内部数据模型(不进 contracts.py,同 Document AST
- parser.py function-plot 源码与表达式解析(ast 白名单,绝不 eval/exec
- render.py 把 FunctionPlot 渲染为内嵌 SVG(纯几何 + <text>,无脚本)
"""