From 1f27d70428f7e23ef472a38e60a99eb1530849d4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 15 Sep 2021 21:41:46 -0400 Subject: =?UTF-8?q?Support=20temporary=20syntax=20=E2=80=A2SetPlot=20"scat?= =?UTF-8?q?ter"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/p.bqn | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/p.bqn b/src/p.bqn index 9d399262..2c9972e4 100644 --- a/src/p.bqn +++ b/src/p.bqn @@ -3,8 +3,13 @@ width ← 384 pad ← 2⥊10 +opts_type ← @ +InitPlot ← {𝕤⋄ opts_type ↩ "line" } +SetPlot ← {𝕤⋄ opts_type ↩ 𝕩 } + pa ← At "class=Paren|stroke=currentColor|stroke-width=1" pg ← At "class=red|style=fill:none|stroke-width=1" +pc ← At "class=red|r=4" rc ← At "class=code|stroke-width=1|rx=5" gr ← "g" At "font-family=BQN,monospace|font-size=18px" Path ← "path" Elt ⊣∾"d"≍○<⊢ @@ -25,10 +30,15 @@ Plot ← { ar ← 1⍟((÷4)⊸>∨1.5⊸<) ÷˜´ 1⊑¨win # height÷width dim ← width (⊣≍×) ar Scale ← ({¬𝕏}⌾(1⊸⊑) {𝕩÷˜𝕨-˜⊢}´¨ win) {𝕎𝕩}¨ ⊢ - line ← {'M'⌾⊑ ∾⥊ "L "∾¨⎉1𝕩}¨ (/≠¨⊏xy) ⊔ FmtNum ⍉> dim×Scale pts + line ← (/≠¨⊏xy) ⊔ FmtNum ⍉> dim×Scale pts + draw ← ("line"‿"scatter"⊸⊐⌾