diff options
| -rw-r--r-- | docs/repl.js | 6 | ||||
| -rw-r--r-- | src/p.bqn | 18 |
2 files changed, 16 insertions, 8 deletions
diff --git a/docs/repl.js b/docs/repl.js index 5d37e145..88203703 100644 --- a/docs/repl.js +++ b/docs/repl.js @@ -67,9 +67,9 @@ if (doc.doexplain) doc.doexplain.onclick = () => { let makePlot; sysvals.plot = (x,w) => { if (!makePlot) makePlot = run( - [0,19,22,0,0,11,22,0,1,11,14,15,1,22,0,2,11,14,15,2,22,0,3,11,14,15,3,22,0,4,11,14,15,4,22,0,5,11,14,0,20,0,39,21,0,5,8,0,30,9,0,20,0,43,31,0,5,8,15,5,3,3,0,45,0,16,0,5,0,49,19,8,22,0,6,11,14,21,0,6,21,0,6,0,35,0,21,7,0,60,19,0,21,9,0,24,0,48,19,15,6,3,3,0,45,0,16,0,5,0,49,19,8,22,0,7,11,14,0,37,15,7,7,0,21,0,73,19,22,0,8,11,14,0,48,0,46,21,0,8,0,39,0,11,8,8,0,21,9,0,42,0,21,8,22,0,9,11,14,15,8,22,0,10,11,14,21,0,6,0,34,0,22,7,0,76,0,77,3,2,19,22,0,11,11,14,21,0,9,0,39,31,0,4,8,22,0,12,11,14,15,9,22,0,13,11,14,0,56,22,0,14,11,14,0,54,0,20,0,49,17,22,0,15,11,14,0,80,21,0,10,16,22,0,16,11,14,0,81,21,0,10,16,22,0,17,11,14,0,82,21,0,10,16,22,0,18,11,14,0,84,31,0,10,0,83,17,22,0,19,11,14,0,19,0,11,0,40,0,22,8,0,86,19,0,21,0,18,19,21,0,12,0,85,19,22,0,20,11,14,15,10,22,0,21,11,25,0,48,0,18,21,0,2,17,0,47,0,17,0,33,0,20,7,0,48,0,49,3,2,19,0,42,0,33,0,35,0,24,0,21,0,66,19,0,21,0,23,19,7,7,8,8,22,0,3,11,14,21,0,1,21,1,1,0,41,21,1,0,0,30,0,43,31,0,3,8,9,0,21,0,41,0,11,8,0,35,0,48,7,19,8,16,25,15,11,22,0,3,11,14,0,67,21,0,2,0,68,3,3,0,21,16,22,0,4,11,14,0,69,21,0,2,0,28,0,60,0,13,21,0,2,17,0,38,0,9,7,16,17,0,68,3,3,0,21,16,22,0,5,11,14,21,0,1,0,16,16,22,0,6,11,0,11,0,48,17,22,0,7,11,14,31,0,5,21,0,7,0,47,0,11,0,39,0,20,8,8,0,40,15,12,21,0,1,31,0,7,0,47,15,13,8,16,7,8,31,0,4,17,0,21,16,25,0,67,21,0,1,0,71,3,3,0,21,16,25,21,0,1,0,53,0,42,0,11,8,0,9,0,11,0,41,0,52,8,19,16,0,37,0,9,7,16,0,32,16,14,0,54,22,0,3,11,0,33,0,4,7,0,50,17,22,0,4,11,14,0,61,0,1,0,72,17,22,0,5,22,0,6,4,2,11,14,0,51,0,11,21,0,1,17,22,0,7,11,14,21,0,1,0,7,16,22,0,8,11,14,31,0,8,0,2,21,0,4,17,0,0,0,55,17,0,5,16,22,0,9,11,14,31,0,7,0,28,16,0,35,31,0,5,7,0,42,0,11,0,40,0,22,8,8,16,0,22,16,21,0,4,0,3,21,0,9,17,0,5,16,15,14,0,41,0,13,0,39,0,25,8,8,16,31,0,9,15,15,0,41,0,13,0,39,0,25,8,8,16,0,13,0,11,0,51,19,0,47,0,21,0,41,0,29,0,39,0,26,0,30,9,0,43,0,35,31,0,6,7,8,8,8,8,16,3,3,0,21,16,0,27,16,0,34,0,21,0,39,0,11,8,7,16,0,37,0,0,0,41,0,61,8,0,42,0,31,8,7,16,25,21,0,1,14,0,51,0,32,16,25,21,0,1,14,0,51,0,32,16,25,21,0,2,0,74,21,0,1,0,75,3,4,0,21,16,25,15,16,22,0,3,11,14,21,0,1,21,0,3,0,63,7,16,0,35,31,0,3,0,62,7,7,16,0,35,21,1,8,7,0,21,9,0,42,0,21,8,0,44,0,12,8,21,0,2,17,25,21,0,1,21,1,3,0,79,21,0,2,21,1,7,16,3,2,21,1,9,0,78,17,17,25,21,0,1,0,51,0,12,0,41,0,64,8,0,37,0,9,7,9,3,2,0,45,0,14,0,14,0,48,19,8,0,40,0,9,0,44,0,19,8,8,21,0,2,17,0,32,0,87,17,14,21,0,1,0,13,0,40,0,16,0,44,0,48,8,8,21,0,2,17,0,32,0,88,17,14,21,0,1,0,18,0,44,0,13,0,39,0,25,8,8,21,0,2,17,21,0,1,3,2,0,5,0,6,0,41,0,1,8,0,18,19,0,57,17,22,0,3,11,14,21,0,3,0,35,0,37,0,6,7,0,22,0,37,0,5,7,19,7,16,22,0,4,11,0,35,0,38,0,33,0,1,7,7,7,16,22,0,5,11,14,21,0,5,0,35,0,30,7,0,48,17,0,37,0,33,0,3,7,7,16,0,11,0,41,0,59,8,0,10,0,12,0,41,0,58,0,3,16,8,19,0,47,0,48,8,16,22,0,6,11,14,31,0,6,0,2,0,22,0,18,19,21,1,14,17,22,0,7,11,14,0,19,0,35,15,17,7,31,0,5,0,35,0,37,15,18,7,7,16,0,30,0,41,0,48,8,0,43,15,19,8,16,19,22,0,8,11,14,31,0,3,21,0,8,16,0,2,21,0,7,17,0,12,16,21,1,6,16,0,35,0,21,7,0,89,17,0,27,16,0,20,16,0,21,16,0,30,0,43,0,65,8,16,0,11,16,22,0,9,11,14,21,1,15,0,0,21,0,7,17,21,1,6,16,0,34,0,22,7,0,91,0,92,3,2,17,0,21,0,49,0,3,21,1,15,17,0,1,16,21,1,11,16,17,0,21,21,1,18,17,21,1,12,0,90,17,0,11,16,0,51,31,0,8,16,0,2,0,41,0,49,0,25,16,0,33,0,36,0,14,7,7,16,8,0,34,0,48,0,42,0,21,8,7,9,0,2,21,0,7,19,21,1,6,9,0,35,0,21,7,0,94,0,34,0,21,0,41,0,93,8,7,16,19,0,34,0,21,0,39,0,11,8,7,9,0,28,0,48,0,42,0,15,8,0,9,0,15,0,41,0,51,8,19,19,16,0,35,21,1,20,0,41,21,1,16,8,7,16,31,0,9,0,35,21,1,20,0,41,21,1,17,8,7,16,3,3,0,35,0,20,7,16,0,21,16,21,1,3,21,1,19,17,21,1,13,21,1,15,0,2,0,49,17,0,0,31,0,7,17,0,21,21,1,15,0,1,16,17,17,25,21,0,1,0,20,16,0,51,0,39,0,32,8,0,11,0,20,9,0,19,0,35,21,0,0,7,0,21,9,3,4,0,45,0,16,0,5,0,50,19,8,16,25,21,0,2,21,0,4,21,0,1,3,3,25,21,0,1,0,20,16,21,1,6,0,15,0,50,17,0,47,0,35,21,1,3,7,0,21,9,8,16,0,35,0,21,0,41,0,70,8,7,16,25,21,0,1,0,15,21,1,3,17,22,0,3,11,14,21,0,2,21,0,1,3,2,0,22,0,26,0,30,9,0,43,0,7,0,41,21,1,3,8,8,0,21,0,37,0,28,0,41,21,0,3,8,0,40,21,1,3,0,42,0,3,8,0,5,9,0,42,21,0,0,8,8,7,19,3,2,0,45,31,0,3,0,37,0,10,7,16,8,16,25,21,0,1,0,7,21,1,4,17,22,0,1,12,0,2,16,22,0,3,11,14,21,0,1,0,51,0,49,3,2,0,25,16,0,28,0,41,21,0,3,8,0,40,0,2,0,41,21,1,3,8,0,42,21,0,0,0,21,21,1,4,0,42,0,3,8,0,5,9,0,42,0,11,0,40,0,22,8,8,19,8,8,3,2,0,45,31,0,3,0,37,0,10,7,16,8,21,0,2,17,25,0,31,0,41,0,14,0,41,21,0,1,8,0,1,0,41,0,8,0,2,0,38,0,0,7,19,8,9,8,25,21,0,1,21,0,2,16,25,0,19,0,33,0,1,7,21,0,2,19,0,33,0,3,7,21,0,1,19,25,21,0,1,0,8,9,25] - ,[runtime[0],runtime[1],runtime[2],runtime[3],runtime[4],runtime[6],runtime[7],runtime[8],runtime[9],runtime[10],runtime[11],runtime[12],runtime[13],runtime[14],runtime[15],runtime[16],runtime[18],runtime[19],runtime[20],runtime[21],runtime[22],runtime[23],runtime[24],runtime[25],runtime[26],runtime[27],runtime[30],runtime[31],runtime[32],runtime[35],runtime[36],runtime[41],runtime[42],runtime[44],runtime[45],runtime[46],runtime[47],runtime[49],runtime[51],runtime[52],runtime[53],runtime[54],runtime[55],runtime[56],runtime[57],runtime[58],runtime[59],runtime[61],1,2,3,0,-Infinity,Infinity,10,0.5,384,1.0E300,4,1.5,' ','0','=','|','\0','M',str("t"),str("<"),str(">"),str("</"),str(" "),str("/>"),str("-."),str(" "),str("=\'"),str("\'"),str("x"),str("y"),str("svg"),str("viewBox"),str("class=Paren|stroke=currentColor|stroke-width=1"),str("class=red|style=fill:none|stroke-width=1"),str("class=code|stroke-width=1|rx=5"),str("g"),str("font-family=BQN,monospace|font-size=18px"),str("path"),str("d"),str("•Plot: 𝕨 and 𝕩 must be lists of numbers"),str("•Plot: 𝕨 and 𝕩 must have the same length"),str("L "),str("rect"),str("width"),str("height"),str("M "),str("VH")] - ,[[0,1,0,22],[0,0,307,4],[0,0,394,8],[0,0,514,3],[0,0,527,10],[0,0,778,3],[0,0,788,3],[0,0,798,3],[0,0,814,4],[0,0,865,3],[0,0,890,10],[0,0,1441,3],[1,0,1484,5],[0,0,1496,3],[0,0,1535,4],[0,0,1625,4],[1,1,1726,2],[0,0,1756,3],[0,0,1764,3],[0,0,1785,3]] + [0,19,22,0,0,11,22,0,1,11,14,15,1,22,0,2,11,14,15,2,22,0,3,11,14,15,3,22,0,4,11,14,15,4,22,0,5,11,14,0,20,0,40,21,0,5,8,0,30,9,0,20,0,44,31,0,5,8,15,5,3,3,0,46,0,16,0,5,0,50,19,8,22,0,6,11,14,21,0,6,21,0,6,0,36,0,21,7,0,62,19,0,21,9,0,24,0,49,19,15,6,3,3,0,46,0,16,0,5,0,50,19,8,22,0,7,11,14,0,38,15,7,7,0,21,0,75,19,22,0,8,11,14,0,49,0,47,21,0,8,0,40,0,11,8,8,0,21,9,0,43,0,21,8,22,0,9,11,14,15,8,22,0,10,11,14,21,0,6,0,35,0,22,7,0,78,0,79,3,2,19,22,0,11,11,14,21,0,9,0,40,31,0,4,8,22,0,12,11,14,15,9,22,0,13,11,14,0,57,22,0,14,11,14,0,55,0,20,0,50,17,22,0,15,11,14,0,82,21,0,10,16,22,0,16,11,14,0,83,21,0,10,16,22,0,17,11,14,0,84,21,0,10,16,22,0,18,11,14,0,86,31,0,10,0,85,17,22,0,19,11,14,0,19,0,11,0,41,0,22,8,0,88,19,0,21,0,18,19,21,0,12,0,87,19,22,0,20,11,14,15,10,22,0,21,11,14,15,11,22,0,22,11,14,15,12,22,0,23,11,25,0,49,0,18,21,0,2,17,0,48,0,17,0,34,0,20,7,0,49,0,50,3,2,19,0,43,0,34,0,36,0,24,0,21,0,68,19,0,21,0,23,19,7,7,8,8,22,0,3,11,14,21,0,1,21,1,1,0,42,21,1,0,0,30,0,44,31,0,3,8,9,0,21,0,42,0,11,8,0,36,0,49,7,19,8,16,25,15,13,22,0,3,11,14,0,69,21,0,2,0,70,3,3,0,21,16,22,0,4,11,14,0,71,21,0,2,0,28,0,62,0,13,21,0,2,17,0,39,0,9,7,16,17,0,70,3,3,0,21,16,22,0,5,11,14,21,0,1,0,16,16,22,0,6,11,0,11,0,49,17,22,0,7,11,14,31,0,5,21,0,7,0,48,0,11,0,40,0,20,8,8,0,41,15,14,21,0,1,31,0,7,0,48,15,15,8,16,7,8,31,0,4,17,0,21,16,25,0,69,21,0,1,0,73,3,3,0,21,16,25,21,0,1,0,54,0,43,0,11,8,0,9,0,11,0,42,0,53,8,19,16,0,38,0,9,7,16,0,32,16,14,0,55,22,0,3,11,0,34,0,4,7,0,51,17,22,0,4,11,14,0,63,0,1,0,74,17,22,0,5,22,0,6,4,2,11,14,0,52,0,11,21,0,1,17,22,0,7,11,14,21,0,1,0,7,16,22,0,8,11,14,31,0,8,0,2,21,0,4,17,0,0,0,56,17,0,5,16,22,0,9,11,14,31,0,7,0,28,16,0,36,31,0,5,7,0,43,0,11,0,41,0,22,8,8,16,0,22,16,21,0,4,0,3,21,0,9,17,0,5,16,15,16,0,42,0,13,0,40,0,25,8,8,16,31,0,9,15,17,0,42,0,13,0,40,0,25,8,8,16,0,13,0,11,0,52,19,0,48,0,21,0,42,0,29,0,40,0,26,0,30,9,0,44,0,36,31,0,6,7,8,8,8,8,16,3,3,0,21,16,0,27,16,0,35,0,21,0,40,0,11,8,7,16,0,38,0,0,0,42,0,63,8,0,43,0,31,8,7,16,25,21,0,1,14,0,52,0,32,16,25,21,0,1,14,0,52,0,32,16,25,21,0,2,0,76,21,0,1,0,77,3,4,0,21,16,25,15,18,22,0,3,11,14,21,0,1,21,0,3,0,65,7,16,0,36,31,0,3,0,64,7,7,16,0,36,21,1,8,7,0,21,9,0,43,0,21,8,0,45,0,12,8,21,0,2,17,25,21,0,1,21,1,3,0,81,21,0,2,21,1,7,16,3,2,21,1,9,0,80,17,17,25,21,0,1,0,52,0,12,0,42,0,66,8,0,20,0,40,0,38,0,9,7,8,9,3,2,0,46,0,14,0,15,0,49,19,8,0,41,0,9,0,45,0,19,8,8,21,0,2,17,0,32,0,89,17,14,21,0,1,0,17,0,30,0,58,19,0,41,0,16,8,0,45,0,49,8,21,0,2,17,0,32,0,90,17,14,21,0,1,0,49,0,47,0,19,0,11,0,41,0,22,8,0,18,0,45,0,17,0,30,0,58,19,0,25,9,8,19,0,11,9,8,21,0,2,17,0,20,16,25,21,0,1,0,16,0,41,0,22,8,21,0,2,17,22,0,3,11,14,21,0,1,0,33,21,0,3,7,0,14,0,49,19,0,38,0,9,7,9,0,32,0,91,19,0,18,21,1,21,19,0,36,21,0,0,7,0,20,0,40,0,21,8,9,3,2,0,46,31,0,3,0,38,0,5,7,16,0,15,0,50,17,8,21,0,2,17,25,21,0,1,21,1,22,21,0,2,17,0,12,16,0,27,16,0,5,0,6,0,42,0,1,8,0,18,19,0,59,17,22,0,3,11,14,21,0,3,0,35,0,21,0,40,0,11,8,7,16,22,0,4,11,14,21,0,4,0,36,0,38,0,6,7,0,22,0,38,0,5,7,19,7,16,22,0,5,11,0,36,0,39,0,34,0,1,7,7,7,16,22,0,6,11,14,21,0,6,0,36,0,30,7,0,49,17,0,38,0,34,0,3,7,7,16,0,11,0,42,0,61,8,0,10,0,12,0,42,0,60,0,3,16,8,19,0,48,0,49,8,16,22,0,7,11,14,31,0,7,0,2,0,22,0,18,19,21,1,14,17,22,0,8,11,14,0,19,0,36,15,19,7,31,0,6,0,36,0,38,15,20,7,7,16,0,30,0,42,0,49,8,0,44,15,21,8,16,19,22,0,9,11,14,31,0,4,21,0,9,16,0,2,21,0,8,17,0,12,16,0,27,16,21,1,6,16,0,31,31,0,3,0,29,16,0,36,0,13,7,16,0,28,16,17,0,36,15,22,7,16,22,0,10,11,14,21,1,15,0,0,21,0,8,17,21,1,6,16,0,35,0,22,7,0,94,0,95,3,2,17,0,21,0,50,0,3,21,1,15,17,0,1,16,21,1,11,16,17,0,21,21,1,18,17,21,1,12,0,93,17,0,11,16,0,52,31,0,9,16,0,2,0,42,0,50,0,25,16,0,34,0,37,0,14,7,7,16,8,0,35,0,49,0,43,0,21,8,7,9,0,2,21,0,8,19,21,1,6,9,0,36,0,21,7,0,97,0,35,0,21,0,42,0,96,8,7,16,19,0,35,0,21,0,40,0,11,8,7,9,0,28,0,49,0,43,0,15,8,0,9,0,15,0,42,0,52,8,19,19,16,0,36,21,1,20,0,42,21,1,16,8,7,16,31,0,10,0,36,21,1,20,0,42,21,1,17,8,7,16,3,3,0,36,0,20,7,16,0,21,16,21,1,3,21,1,19,17,21,1,13,21,1,15,0,2,0,50,17,0,0,31,0,8,17,0,21,21,1,15,0,1,16,17,17,25,21,0,1,0,20,16,0,52,0,40,0,32,8,0,11,0,20,9,0,19,0,36,21,0,0,7,0,21,9,3,4,0,46,0,16,0,5,0,51,19,8,16,25,21,0,2,21,0,4,21,0,1,3,3,25,21,0,1,0,20,16,21,1,6,0,15,0,51,17,0,48,0,36,21,1,3,7,0,21,9,8,16,0,36,0,21,0,42,0,72,8,7,16,25,21,0,1,0,15,21,1,3,17,22,0,3,11,14,21,0,2,21,0,1,3,2,0,22,0,26,0,30,9,0,44,0,7,0,42,21,1,3,8,8,0,21,0,38,0,28,0,42,21,0,3,8,0,41,21,1,3,0,43,0,3,8,0,5,9,0,43,21,0,0,8,8,7,19,3,2,0,46,31,0,3,0,38,0,10,7,16,8,16,25,21,0,1,0,7,21,1,4,17,22,0,1,12,0,2,16,22,0,3,11,14,21,0,1,0,52,0,50,3,2,0,25,16,0,28,0,42,21,0,3,8,0,41,0,2,0,42,21,1,3,8,0,43,21,0,0,0,21,21,1,4,0,43,0,3,8,0,5,9,0,43,0,11,0,41,0,22,8,8,19,8,8,3,2,0,46,31,0,3,0,38,0,10,7,16,8,21,0,2,17,25,0,31,0,42,0,14,0,42,21,0,1,8,0,1,0,42,0,8,0,2,0,39,0,0,7,19,8,9,8,25,21,0,1,21,0,2,16,25,0,19,0,34,0,1,7,21,0,2,19,0,34,0,3,7,21,0,1,19,25,21,0,1,0,8,9,25,21,0,1,0,49,0,47,0,36,0,21,7,8,0,92,17,0,20,16,0,21,16,0,30,0,44,0,67,8,16,25] + ,[runtime[0],runtime[1],runtime[2],runtime[3],runtime[4],runtime[6],runtime[7],runtime[8],runtime[9],runtime[10],runtime[11],runtime[12],runtime[13],runtime[14],runtime[15],runtime[16],runtime[18],runtime[19],runtime[20],runtime[21],runtime[22],runtime[23],runtime[24],runtime[25],runtime[26],runtime[27],runtime[30],runtime[31],runtime[32],runtime[35],runtime[36],runtime[41],runtime[42],runtime[43],runtime[44],runtime[45],runtime[46],runtime[47],runtime[49],runtime[51],runtime[52],runtime[53],runtime[54],runtime[55],runtime[56],runtime[57],runtime[58],runtime[59],runtime[61],1,2,3,0,-Infinity,Infinity,10,0.5,384,-1,1.0E300,4,1.5,' ','0','=','|','\0','M',str("t"),str("<"),str(">"),str("</"),str(" "),str("/>"),str("-."),str(" "),str("=\'"),str("\'"),str("x"),str("y"),str("svg"),str("viewBox"),str("class=Paren|stroke=currentColor|stroke-width=1"),str("class=red|style=fill:none|stroke-width=1"),str("class=code|stroke-width=1|rx=5"),str("g"),str("font-family=BQN,monospace|font-size=18px"),str("path"),str("d"),str("•Plot: 𝕨 and 𝕩 must consist of rows of numbers"),str("•Plot: 𝕨 and 𝕩 must have the same length"),str("•Plot: invalid depth mixing"),str("L "),str("rect"),str("width"),str("height"),str("M "),str("VH")] + ,[[0,1,0,24],[0,0,321,4],[0,0,408,8],[0,0,528,3],[0,0,541,10],[0,0,792,3],[0,0,802,3],[0,0,812,3],[0,0,828,4],[0,0,879,3],[0,0,904,3],[0,0,1033,4],[0,0,1121,11],[0,0,1607,3],[1,0,1650,5],[0,0,1662,3],[0,0,1701,4],[0,0,1791,4],[1,1,1892,2],[0,0,1922,3],[0,0,1930,3],[0,0,1951,3],[0,0,1958,3]] ); doc.explain.innerHTML = makePlot(x,w).map(l=>l.join("")).join("\n"); setExplain = () => doc.explain.innerHTML = ''; @@ -9,15 +9,23 @@ rc ← At "class=code|stroke-width=1|rx=5" gr ← "g" At "font-family=BQN,monospace|font-size=18px" Path ← "path" Elt ⊣∾"d"≍○<⊢ +Pair ← { + "•Plot: 𝕨 and 𝕩 must consist of rows of numbers" ! 𝕨 ⊢⊘∧○((1≤=)◶⟨0,∧´∘⥊@⊸>⟩) 𝕩 + "•Plot: 𝕨 and 𝕩 must have the same length" ! 𝕨 1⊘(≡○(¯1⊑≢)) 𝕩 + ⥊ 𝕨 (< (↕¯1⊑≢)⊘⊣ ≍○< ⊢)⎉1 𝕩 +} +PairRec ← { + d ← 𝕨≍○≡𝕩 + 𝕨 (2≤⌊´d)◶⟨Pair⊣"•Plot: invalid depth mixing"!·∧´1=d˙, ∾∘⥊𝕊¨⟩ 𝕩 +} Plot ← { - "•Plot: 𝕨 and 𝕩 must be lists of numbers" ! 𝕨 ⊢⊘∧○((1==)◶⟨0,∧´@⊸>⟩) 𝕩 - "•Plot: 𝕨 and 𝕩 must have the same length" ! 𝕨 1⊘≡○≠ 𝕩 - xy ← 1e300 (⊣-⊸⌈⌊) ⟨𝕨↕∘≠⊘⊣𝕩, 𝕩⟩ # default x and clip - win ← -˜`¨ bounds ← (⌊´≍⌈´)¨ xy # min and range; min and max + xy ← 1e300 (⊣-⊸⌈⌊) ⍉> 𝕨 PairRec 𝕩 # organize and clip + pts ← <∘∾˘ xy + win ← -˜`¨ bounds ← (⌊´≍⌈´)¨ pts # min and range; min and max ar ← 1⍟((÷4)⊸>∨1.5⊸<) ÷˜´ 1⊑¨win # height÷width dim ← width (⊣≍×) ar Scale ← ({¬𝕏}⌾(1⊸⊑) {𝕩÷˜𝕨-˜⊢}´¨ win) {𝕎𝕩}¨ ⊢ - line ← < 'M'⌾⊑ ∾⥊⍉ "L " ∾¨ FmtNum > dim × Scale xy + line ← {'M'⌾⊑ ∾⥊ "L "∾¨⎉1𝕩}¨ (/≠¨⊏xy) ⊔ FmtNum ⍉> dim×Scale pts ((-pad)∾dim+2×pad) SVG gr Enc ∾⥊¨ ⟨ <"rect" Elt rc∾(Pos-pad÷2)∾"width"‿"height"≍˘FmtNum dim+pad pa⊸Path¨ ((0⊸≤∧≤⟜1)/·<∘∾˘("M "⊸∾˘"VH")∾¨·FmtNum dim×·∾⟜1˘(=⌜˜↕2)⊸×) Scale 0 |
