Files
marqdo/examples/oa2026-showcase/calculus-plot.svg
cflmy ecd7d5e433 examples: 新增 oa2026-showcase(2026 开源项目大赛作品介绍示例集)
五个可运行示例,覆盖 Marqdo 的核心能力面:

| 文件 | 展示 |
|------|------|
| add.mq.md | 叙述统一、粗体即代码、斜体即返回 |
| invoice.mq.md | 表格即数据、循环、分支、断言 |
| calculus.mq.md | 公式即变量、求导、求根、绘图 |
| bell.mq.md | 量子电路、概率、断言、SVG 派生物 |
| foreign-node.mq.md | 外联一次性执行、持久会话、显式传值 |

全部实测跑通(1.5.2),输出与 README「预期输出」一节一致:
- add → 42
- invoice → 960 / 912 / 966 / within-cap
- calculus → 3*x^2 - 3 / 9 / [-1.73, 0, 1.73] / plot-ok
- bell → {00: 0.5, 11: 0.5} / bell-00-ok / bell-11-ok / bell-draw-ok
- foreign-node → 区域汇总表 + 持久会话复读

仓库侧改动:
- examples/oa2026-showcase/*.svg 随示例入库(README 有说明,属固定产物)
- .gitignore 忽略根目录 bell-*.svg / calculus-*.svg —— 从仓库根运行示例时
  draw/plot 会把 SVG 写到 cwd,那是运行产物不是源文件
- examples/marqdo-blog/db/posts.mq.md 首行正文去掉了内嵌 `#` 标题写法
2026-10-22 10:41:41 +08:00

17 lines
6.8 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 360" width="520" height="360" role="img" aria-label="function plot">
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#4b5563"/>
</marker>
</defs>
<style>
.grid { stroke: #e5e7eb; stroke-width: 1; }
.axis { stroke: #4b5563; stroke-width: 1.5; }
.tick { stroke: #4b5563; stroke-width: 1; }
.curve { fill: none; stroke: #1f6feb; stroke-width: 2; }
.pt { fill: #1f6feb; }
.axis-label { font: 12px ui-sans-serif, system-ui, sans-serif; fill: #374151; font-weight: 600; }
.tick-label { font: 10px ui-sans-serif, system-ui, sans-serif; fill: #6b7280; }
</style>
<line x1="36.00" y1="36" x2="36.00" y2="324" class="grid"/><line x1="110.67" y1="36" x2="110.67" y2="324" class="grid"/><line x1="185.33" y1="36" x2="185.33" y2="324" class="grid"/><line x1="260.00" y1="36" x2="260.00" y2="324" class="grid"/><line x1="334.67" y1="36" x2="334.67" y2="324" class="grid"/><line x1="409.33" y1="36" x2="409.33" y2="324" class="grid"/><line x1="484.00" y1="36" x2="484.00" y2="324" class="grid"/><line x1="36" y1="289.09" x2="484" y2="289.09" class="grid"/><line x1="36" y1="252.73" x2="484" y2="252.73" class="grid"/><line x1="36" y1="216.36" x2="484" y2="216.36" class="grid"/><line x1="36" y1="180.00" x2="484" y2="180.00" class="grid"/><line x1="36" y1="143.64" x2="484" y2="143.64" class="grid"/><line x1="36" y1="107.27" x2="484" y2="107.27" class="grid"/><line x1="36" y1="70.91" x2="484" y2="70.91" class="grid"/><line x1="36" y1="180.00" x2="484" y2="180.00" class="axis" marker-end="url(#arrow)"/><line x1="260.00" y1="324" x2="260.00" y2="36" class="axis" marker-end="url(#arrow)"/><text x="488.00" y="184.00" class="axis-label">x</text><text x="266.00" y="40.00" class="axis-label">y</text><line x1="36.00" y1="176.00" x2="36.00" y2="184.00" class="tick"/><text x="36.00" y="194.00" text-anchor="middle" class="tick-label">-3</text><line x1="110.67" y1="176.00" x2="110.67" y2="184.00" class="tick"/><text x="110.67" y="194.00" text-anchor="middle" class="tick-label">-2</text><line x1="185.33" y1="176.00" x2="185.33" y2="184.00" class="tick"/><text x="185.33" y="194.00" text-anchor="middle" class="tick-label">-1</text><line x1="334.67" y1="176.00" x2="334.67" y2="184.00" class="tick"/><text x="334.67" y="194.00" text-anchor="middle" class="tick-label">1</text><line x1="409.33" y1="176.00" x2="409.33" y2="184.00" class="tick"/><text x="409.33" y="194.00" text-anchor="middle" class="tick-label">2</text><line x1="484.00" y1="176.00" x2="484.00" y2="184.00" class="tick"/><text x="484.00" y="194.00" text-anchor="middle" class="tick-label">3</text><line x1="256.00" y1="289.09" x2="264.00" y2="289.09" class="tick"/><text x="252.00" y="289.09" text-anchor="end" dominant-baseline="middle" class="tick-label">-15</text><line x1="256.00" y1="252.73" x2="264.00" y2="252.73" class="tick"/><text x="252.00" y="252.73" text-anchor="end" dominant-baseline="middle" class="tick-label">-10</text><line x1="256.00" y1="216.36" x2="264.00" y2="216.36" class="tick"/><text x="252.00" y="216.36" text-anchor="end" dominant-baseline="middle" class="tick-label">-5</text><line x1="256.00" y1="143.64" x2="264.00" y2="143.64" class="tick"/><text x="252.00" y="143.64" text-anchor="end" dominant-baseline="middle" class="tick-label">5</text><line x1="256.00" y1="107.27" x2="264.00" y2="107.27" class="tick"/><text x="252.00" y="107.27" text-anchor="end" dominant-baseline="middle" class="tick-label">10</text><line x1="256.00" y1="70.91" x2="264.00" y2="70.91" class="tick"/><text x="252.00" y="70.91" text-anchor="end" dominant-baseline="middle" class="tick-label">15</text><text x="252.00" y="194.00" class="tick-label">0</text><path d="M 36.00 310.91 L 38.24 305.73 L 40.48 300.67 L 42.72 295.72 L 44.96 290.89 L 47.20 286.18 L 49.44 281.57 L 51.68 277.07 L 53.92 272.69 L 56.16 268.41 L 58.40 264.24 L 60.64 260.18 L 62.88 256.22 L 65.12 252.36 L 67.36 248.61 L 69.60 244.96 L 71.84 241.40 L 74.08 237.95 L 76.32 234.60 L 78.56 231.34 L 80.80 228.17 L 83.04 225.11 L 85.28 222.13 L 87.52 219.25 L 89.76 216.45 L 92.00 213.75 L 94.24 211.13 L 96.48 208.61 L 98.72 206.17 L 100.96 203.81 L 103.20 201.53 L 105.44 199.34 L 107.68 197.23 L 109.92 195.20 L 112.16 193.25 L 114.40 191.38 L 116.64 189.58 L 118.88 187.86 L 121.12 186.22 L 123.36 184.64 L 125.60 183.14 L 127.84 181.71 L 130.08 180.35 L 132.32 179.06 L 134.56 177.83 L 136.80 176.67 L 139.04 175.57 L 141.28 174.54 L 143.52 173.57 L 145.76 172.67 L 148.00 171.82 L 150.24 171.03 L 152.48 170.30 L 154.72 169.62 L 156.96 169.00 L 159.20 168.44 L 161.44 167.93 L 163.68 167.47 L 165.92 167.06 L 168.16 166.70 L 170.40 166.39 L 172.64 166.12 L 174.88 165.90 L 177.12 165.73 L 179.36 165.60 L 181.60 165.51 L 183.84 165.46 L 186.08 165.46 L 188.32 165.49 L 190.56 165.56 L 192.80 165.67 L 195.04 165.81 L 197.28 165.98 L 199.52 166.19 L 201.76 166.43 L 204.00 166.70 L 206.24 167.01 L 208.48 167.33 L 210.72 167.69 L 212.96 168.07 L 215.20 168.48 L 217.44 168.91 L 219.68 169.36 L 221.92 169.84 L 224.16 170.33 L 226.40 170.84 L 228.64 171.38 L 230.88 171.92 L 233.12 172.48 L 235.36 173.06 L 237.60 173.65 L 239.84 174.25 L 242.08 174.86 L 244.32 175.49 L 246.56 176.12 L 248.80 176.75 L 251.04 177.39 L 253.28 178.04 L 255.52 178.69 L 257.76 179.35 L 260.00 180.00 L 262.24 180.65 L 264.48 181.31 L 266.72 181.96 L 268.96 182.61 L 271.20 183.25 L 273.44 183.88 L 275.68 184.51 L 277.92 185.14 L 280.16 185.75 L 282.40 186.35 L 284.64 186.94 L 286.88 187.52 L 289.12 188.08 L 291.36 188.62 L 293.60 189.16 L 295.84 189.67 L 298.08 190.16 L 300.32 190.64 L 302.56 191.09 L 304.80 191.52 L 307.04 191.93 L 309.28 192.31 L 311.52 192.67 L 313.76 192.99 L 316.00 193.30 L 318.24 193.57 L 320.48 193.81 L 322.72 194.02 L 324.96 194.19 L 327.20 194.33 L 329.44 194.44 L 331.68 194.51 L 333.92 194.54 L 336.16 194.54 L 338.40 194.49 L 340.64 194.40 L 342.88 194.27 L 345.12 194.10 L 347.36 193.88 L 349.60 193.61 L 351.84 193.30 L 354.08 192.94 L 356.32 192.53 L 358.56 192.07 L 360.80 191.56 L 363.04 191.00 L 365.28 190.38 L 367.52 189.70 L 369.76 188.97 L 372.00 188.18 L 374.24 187.33 L 376.48 186.43 L 378.72 185.46 L 380.96 184.43 L 383.20 183.33 L 385.44 182.17 L 387.68 180.94 L 389.92 179.65 L 392.16 178.29 L 394.40 176.86 L 396.64 175.36 L 398.88 173.78 L 401.12 172.14 L 403.36 170.42 L 405.60 168.62 L 407.84 166.75 L 410.08 164.80 L 412.32 162.77 L 414.56 160.66 L 416.80 158.47 L 419.04 156.19 L 421.28 153.83 L 423.52 151.39 L 425.76 148.87 L 428.00 146.25 L 430.24 143.55 L 432.48 140.75 L 434.72 137.87 L 436.96 134.89 L 439.20 131.83 L 441.44 128.66 L 443.68 125.40 L 445.92 122.05 L 448.16 118.60 L 450.40 115.04 L 452.64 111.39 L 454.88 107.64 L 457.12 103.78 L 459.36 99.82 L 461.60 95.76 L 463.84 91.59 L 466.08 87.31 L 468.32 82.93 L 470.56 78.43 L 472.80 73.82 L 475.04 69.11 L 477.28 64.28 L 479.52 59.33 L 481.76 54.27 L 484.00 49.09" class="curve"/>
</svg>