compostjs 0.0.4 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +11 -0
- package/README.md +38 -37
- package/dist/compost.js +168 -230
- package/dist/core.js +1530 -1686
- package/dist/helpers.js +31 -0
- package/dist/html.js +252 -364
- package/index.html +49 -0
- package/package.json +36 -41
- package/dist/bundle.js +0 -829
- package/dist/main.js +0 -217
package/dist/core.js
CHANGED
|
@@ -1,1686 +1,1530 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { bool_type, unit_type, record_type, option_type, lambda_type, array_type, class_type, tuple_type, float64_type, union_type, string_type, int32_type } from "./fable-library.
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { op_EqualsBangGreater, h as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
export function
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
export function
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
export
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
export function
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
const
|
|
392
|
-
return
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
return new
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
return
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
const
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
export function
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
});
|
|
1532
|
-
return new Shape(8, "Shape", arg0$$10);
|
|
1533
|
-
}
|
|
1534
|
-
export function Derived$$$Column(x$$20, y$$16) {
|
|
1535
|
-
const arg0$$11 = delay(function () {
|
|
1536
|
-
return append(singleton([new Value(0, "CAR", x$$20, 0), new Value(1, "COV", y$$16)]), delay(function () {
|
|
1537
|
-
return append(singleton([new Value(0, "CAR", x$$20, 1), new Value(1, "COV", y$$16)]), delay(function () {
|
|
1538
|
-
return append(singleton([new Value(0, "CAR", x$$20, 1), new Value(1, "COV", new continuous(0, "CO", 0))]), delay(function () {
|
|
1539
|
-
return singleton([new Value(0, "CAR", x$$20, 0), new Value(1, "COV", new continuous(0, "CO", 0))]);
|
|
1540
|
-
}));
|
|
1541
|
-
}));
|
|
1542
|
-
}));
|
|
1543
|
-
});
|
|
1544
|
-
return new Shape(8, "Shape", arg0$$11);
|
|
1545
|
-
}
|
|
1546
|
-
export function Compost$$$niceNumber(num, decs) {
|
|
1547
|
-
var x$$21;
|
|
1548
|
-
const str = num.toString();
|
|
1549
|
-
const dot = str.indexOf(".") | 0;
|
|
1550
|
-
const patternInput$$26 = dot === -1 ? [str, ""] : [substring(str, 0, dot), substring(str, dot + 1, min(comparePrimitives, decs, str.length - dot - 1))];
|
|
1551
|
-
const after$$1 = patternInput$$26[1].length < decs ? patternInput$$26[1] + ofSeq$$1(delay(function () {
|
|
1552
|
-
return map$$1(function (i$$4) {
|
|
1553
|
-
return "0";
|
|
1554
|
-
}, rangeNumber(1, 1, decs - patternInput$$26[1].length));
|
|
1555
|
-
}), Array).join("") : patternInput$$26[1];
|
|
1556
|
-
let res = patternInput$$26[0];
|
|
1557
|
-
|
|
1558
|
-
if (patternInput$$26[0].length > 5) {
|
|
1559
|
-
const inputSequence = rangeNumber(patternInput$$26[0].length - 1, -1, 0);
|
|
1560
|
-
iterate(function (i$$5) {
|
|
1561
|
-
const j = patternInput$$26[0].length - i$$5 | 0;
|
|
1562
|
-
|
|
1563
|
-
if (i$$5 !== 0 ? j % 3 === 0 : false) {
|
|
1564
|
-
res = insert(res, i$$5, ",");
|
|
1565
|
-
} else {
|
|
1566
|
-
void null;
|
|
1567
|
-
}
|
|
1568
|
-
}, inputSequence);
|
|
1569
|
-
} else {
|
|
1570
|
-
void null;
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
if (forAll((x$$21 = "0", function (y$$17) {
|
|
1574
|
-
return x$$21 === y$$17;
|
|
1575
|
-
}), after$$1.split(""))) {
|
|
1576
|
-
return res;
|
|
1577
|
-
} else {
|
|
1578
|
-
return res + "." + after$$1;
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
export function Compost$$$defaultFormat(scale$$4, value$$1) {
|
|
1582
|
-
if (value$$1.tag === 1) {
|
|
1583
|
-
const dec = scale$$4.tag === 0 ? Scales$$$decimalPoints(scale$$4.fields[0].fields[0], scale$$4.fields[1].fields[0]) : 0;
|
|
1584
|
-
return Compost$$$niceNumber(round(value$$1.fields[0].fields[0], ~~dec), ~~dec);
|
|
1585
|
-
} else {
|
|
1586
|
-
return value$$1.fields[0].fields[0];
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
export const Compost$$$defstyle = (() => {
|
|
1590
|
-
const Fill$$5 = new FillStyle(0, "Solid", [1, new Color(0, "RGB", 196, 196, 196)]);
|
|
1591
|
-
const StrokeColor$$2 = [1, new Color(0, "RGB", 256, 0, 0)];
|
|
1592
|
-
const StrokeDashArray = [];
|
|
1593
|
-
const StrokeWidth$$1 = new Width(0, "Pixels", 2);
|
|
1594
|
-
const Animation$$4 = undefined;
|
|
1595
|
-
return new Style(StrokeColor$$2, StrokeWidth$$1, StrokeDashArray, Fill$$5, Animation$$4, "10pt sans-serif", "default", Compost$$$defaultFormat, Compost$$$defaultFormat);
|
|
1596
|
-
})();
|
|
1597
|
-
export function Compost$$$getRelativeLocation(el, x$$22, y$$18) {
|
|
1598
|
-
const getOffset = function getOffset($parent$$203, $tupledArg$$5$$204) {
|
|
1599
|
-
getOffset: while (true) {
|
|
1600
|
-
const parent = $parent$$203,
|
|
1601
|
-
tupledArg$$5 = $tupledArg$$5$$204;
|
|
1602
|
-
|
|
1603
|
-
if (equals(parent, null)) {
|
|
1604
|
-
return [tupledArg$$5[0], tupledArg$$5[1]];
|
|
1605
|
-
} else {
|
|
1606
|
-
$parent$$203 = parent.offsetParent;
|
|
1607
|
-
$tupledArg$$5$$204 = [tupledArg$$5[0] - parent.offsetLeft, tupledArg$$5[1] - parent.offsetTop];
|
|
1608
|
-
continue getOffset;
|
|
1609
|
-
}
|
|
1610
|
-
|
|
1611
|
-
break;
|
|
1612
|
-
}
|
|
1613
|
-
};
|
|
1614
|
-
|
|
1615
|
-
const getParent = function getParent($parent$$1$$205) {
|
|
1616
|
-
getParent: while (true) {
|
|
1617
|
-
const parent$$1 = $parent$$1$$205;
|
|
1618
|
-
|
|
1619
|
-
if (parent$$1.namespaceURI === "http://www.w3.org/2000/svg" ? parent$$1.tagName !== "svg" : false) {
|
|
1620
|
-
if (!equals(parent$$1.parentElement, null)) {
|
|
1621
|
-
$parent$$1$$205 = parent$$1.parentElement;
|
|
1622
|
-
continue getParent;
|
|
1623
|
-
} else {
|
|
1624
|
-
$parent$$1$$205 = parent$$1.parentNode;
|
|
1625
|
-
continue getParent;
|
|
1626
|
-
}
|
|
1627
|
-
} else if (!equals(parent$$1.offsetParent, null)) {
|
|
1628
|
-
return parent$$1;
|
|
1629
|
-
} else if (!equals(parent$$1.parentElement, null)) {
|
|
1630
|
-
$parent$$1$$205 = parent$$1.parentElement;
|
|
1631
|
-
continue getParent;
|
|
1632
|
-
} else {
|
|
1633
|
-
$parent$$1$$205 = parent$$1.parentNode;
|
|
1634
|
-
continue getParent;
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1637
|
-
break;
|
|
1638
|
-
}
|
|
1639
|
-
};
|
|
1640
|
-
|
|
1641
|
-
return getOffset(getParent(el), [x$$22, y$$18]);
|
|
1642
|
-
}
|
|
1643
|
-
export function Compost$$$createSvg(revX, revY, width$$1, height, viz) {
|
|
1644
|
-
const patternInput$$27 = Scales$$$calculateScales(Compost$$$defstyle, viz);
|
|
1645
|
-
const defs$$1 = [];
|
|
1646
|
-
let svg$$2;
|
|
1647
|
-
const ctx$$3 = new Drawing$002EDrawingContext(Compost$$$defstyle, defs$$1);
|
|
1648
|
-
svg$$2 = Drawing$$$drawShape(ctx$$3, 0, 0, width$$1, height, patternInput$$27[0][0], patternInput$$27[0][1], patternInput$$27[1]);
|
|
1649
|
-
|
|
1650
|
-
const triggerEvent = function triggerEvent(e$$2, event$$3) {
|
|
1651
|
-
Events$$$triggerEvent(0, 0, width$$1, height, patternInput$$27[0][0], patternInput$$27[0][1], patternInput$$27[1], e$$2, event$$3);
|
|
1652
|
-
};
|
|
1653
|
-
|
|
1654
|
-
const mouseHandler = function mouseHandler(kind$$2, el$$1, evt) {
|
|
1655
|
-
const patternInput$$28 = Compost$$$getRelativeLocation(el$$1, evt.pageX, evt.pageY);
|
|
1656
|
-
const arg10$$10 = new Events$002EInteractiveEvent(0, "MouseEvent", kind$$2, [new Value(1, "COV", new continuous(0, "CO", patternInput$$28[0])), new Value(1, "COV", new continuous(0, "CO", patternInput$$28[1]))]);
|
|
1657
|
-
const clo1$$10 = partialApply(1, triggerEvent, [evt]);
|
|
1658
|
-
clo1$$10(arg10$$10);
|
|
1659
|
-
};
|
|
1660
|
-
|
|
1661
|
-
const touchHandler = function touchHandler(kind$$3, el$$2, evt$$2) {
|
|
1662
|
-
const touch = evt$$2.touches[0];
|
|
1663
|
-
const patternInput$$29 = Compost$$$getRelativeLocation(el$$2, touch.pageX, touch.pageY);
|
|
1664
|
-
const arg10$$11 = new Events$002EInteractiveEvent(1, "TouchEvent", kind$$3, [new Value(1, "COV", new continuous(0, "CO", patternInput$$29[0])), new Value(1, "COV", new continuous(0, "CO", patternInput$$29[1]))]);
|
|
1665
|
-
const clo1$$11 = partialApply(1, triggerEvent, [evt$$2]);
|
|
1666
|
-
clo1$$11(arg10$$11);
|
|
1667
|
-
};
|
|
1668
|
-
|
|
1669
|
-
return function (arg0$$12) {
|
|
1670
|
-
return function (arg1$$7) {
|
|
1671
|
-
return El$0024$0024$0024op_Dynamic$0024$0024Z451691CD(arg0$$12, arg1$$7);
|
|
1672
|
-
};
|
|
1673
|
-
}(h$$13)("div")(new List())(new List((El$0024$0024$0024op_Dynamic$0024$0024Z451691CD(s$$19, "svg"))(ofArray([op_EqualsGreater("style", "overflow:visible"), op_EqualsGreater("width", int32ToString(~~width$$1)), op_EqualsGreater("height", int32ToString(~~height)), op_EqualsBangGreater("click", uncurry(2, partialApply(2, mouseHandler, [new Events$002EMouseEventKind(0, "Click")]))), op_EqualsBangGreater("mousemove", uncurry(2, partialApply(2, mouseHandler, [new Events$002EMouseEventKind(1, "Move")]))), op_EqualsBangGreater("mousedown", uncurry(2, partialApply(2, mouseHandler, [new Events$002EMouseEventKind(3, "Down")]))), op_EqualsBangGreater("mouseup", uncurry(2, partialApply(2, mouseHandler, [new Events$002EMouseEventKind(2, "Up")]))), op_EqualsBangGreater("mouseleave", function (_arg1$$11, evt$$4) {
|
|
1674
|
-
triggerEvent(evt$$4, new Events$002EInteractiveEvent(3, "MouseLeave"));
|
|
1675
|
-
}), op_EqualsBangGreater("touchmove", uncurry(2, partialApply(2, touchHandler, [new Events$002ETouchEventKind(0, "Move")]))), op_EqualsBangGreater("touchstart", uncurry(2, partialApply(2, touchHandler, [new Events$002ETouchEventKind(1, "Start")]))), op_EqualsBangGreater("touchend", function (_arg2$$4, evt$$5) {
|
|
1676
|
-
triggerEvent(evt$$5, new Events$002EInteractiveEvent(2, "TouchEnd"));
|
|
1677
|
-
})]))(ofSeq(delay(function () {
|
|
1678
|
-
const renderCtx = new Svg$002ERenderingContext(defs$$1);
|
|
1679
|
-
let body;
|
|
1680
|
-
const source$$7 = Svg$$$renderSvg(renderCtx, svg$$2);
|
|
1681
|
-
body = ofSeq$$1(source$$7, Array);
|
|
1682
|
-
return append(defs$$1, delay(function () {
|
|
1683
|
-
return body;
|
|
1684
|
-
}));
|
|
1685
|
-
}))), new List()));
|
|
1686
|
-
}
|
|
1
|
+
import { toString, Record, Union } from "./fable_modules/fable-library-js.4.28.0/Types.js";
|
|
2
|
+
import { bool_type, unit_type, record_type, option_type, lambda_type, array_type, class_type, tuple_type, float64_type, union_type, string_type, int32_type } from "./fable_modules/fable-library-js.4.28.0/Reflection.js";
|
|
3
|
+
import { insert, substring, toFail, split, replace, printf, toText, join } from "./fable_modules/fable-library-js.4.28.0/String.js";
|
|
4
|
+
import { max as max_2, min as min_2, ofArray, singleton as singleton_1, cons, empty, reverse } from "./fable_modules/fable-library-js.4.28.0/List.js";
|
|
5
|
+
import { findIndex, fold, append as append_1, item as item_2, map } from "./fable_modules/fable-library-js.4.28.0/Array.js";
|
|
6
|
+
import { curry3, uncurry2, curry2, defaultOf, comparePrimitives, safeHash, equals, max as max_1, compare, min as min_1, round, int32ToString, disposeSafe, getEnumerator } from "./fable_modules/fable-library-js.4.28.0/Util.js";
|
|
7
|
+
import { op_EqualsBangGreater, h as h_2, text, op_EqualsGreater, s as s_6, El_op_Dynamic_Z451691CD, DomNode_$reflection } from "./html.js";
|
|
8
|
+
import { forAll, exists, head, max as max_3, min as min_3, skip, toArray, filter, tryHead, isEmpty, map as map_1, empty as empty_1, collect, append, toList, singleton, delay } from "./fable_modules/fable-library-js.4.28.0/Seq.js";
|
|
9
|
+
import { max, min } from "./fable_modules/fable-library-js.4.28.0/Double.js";
|
|
10
|
+
import { newGuid } from "./fable_modules/fable-library-js.4.28.0/Guid.js";
|
|
11
|
+
import { defaultArg } from "./fable_modules/fable-library-js.4.28.0/Option.js";
|
|
12
|
+
import { rangeDouble } from "./fable_modules/fable-library-js.4.28.0/Range.js";
|
|
13
|
+
import { Array_distinct } from "./fable_modules/fable-library-js.4.28.0/Seq2.js";
|
|
14
|
+
import { FSharpChoice$3 } from "./fable_modules/fable-library-js.4.28.0/Choice.js";
|
|
15
|
+
|
|
16
|
+
export class Color extends Union {
|
|
17
|
+
constructor(tag, fields) {
|
|
18
|
+
super();
|
|
19
|
+
this.tag = tag;
|
|
20
|
+
this.fields = fields;
|
|
21
|
+
}
|
|
22
|
+
cases() {
|
|
23
|
+
return ["RGB", "HTML"];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function Color_$reflection() {
|
|
28
|
+
return union_type("Compost.Color", [], Color, () => [[["Item1", int32_type], ["Item2", int32_type], ["Item3", int32_type]], [["Item", string_type]]]);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class Width extends Union {
|
|
32
|
+
constructor(Item) {
|
|
33
|
+
super();
|
|
34
|
+
this.tag = 0;
|
|
35
|
+
this.fields = [Item];
|
|
36
|
+
}
|
|
37
|
+
cases() {
|
|
38
|
+
return ["Pixels"];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function Width_$reflection() {
|
|
43
|
+
return union_type("Compost.Width", [], Width, () => [[["Item", int32_type]]]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class FillStyle extends Union {
|
|
47
|
+
constructor(tag, fields) {
|
|
48
|
+
super();
|
|
49
|
+
this.tag = tag;
|
|
50
|
+
this.fields = fields;
|
|
51
|
+
}
|
|
52
|
+
cases() {
|
|
53
|
+
return ["Solid", "LinearGradient"];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function FillStyle_$reflection() {
|
|
58
|
+
return union_type("Compost.FillStyle", [], FillStyle, () => [[["Item", tuple_type(float64_type, Color_$reflection())]], [["Item", class_type("System.Collections.Generic.IEnumerable`1", [tuple_type(float64_type, tuple_type(float64_type, Color_$reflection()))])]]]);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export class Number$ extends Union {
|
|
62
|
+
constructor(tag, fields) {
|
|
63
|
+
super();
|
|
64
|
+
this.tag = tag;
|
|
65
|
+
this.fields = fields;
|
|
66
|
+
}
|
|
67
|
+
cases() {
|
|
68
|
+
return ["Integer", "Percentage"];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function Number$_$reflection() {
|
|
73
|
+
return union_type("Compost.Number", [], Number$, () => [[["Item", int32_type]], [["Item", float64_type]]]);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class HorizontalAlign extends Union {
|
|
77
|
+
constructor(tag, fields) {
|
|
78
|
+
super();
|
|
79
|
+
this.tag = tag;
|
|
80
|
+
this.fields = fields;
|
|
81
|
+
}
|
|
82
|
+
cases() {
|
|
83
|
+
return ["Start", "Center", "End"];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function HorizontalAlign_$reflection() {
|
|
88
|
+
return union_type("Compost.HorizontalAlign", [], HorizontalAlign, () => [[], [], []]);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export class VerticalAlign extends Union {
|
|
92
|
+
constructor(tag, fields) {
|
|
93
|
+
super();
|
|
94
|
+
this.tag = tag;
|
|
95
|
+
this.fields = fields;
|
|
96
|
+
}
|
|
97
|
+
cases() {
|
|
98
|
+
return ["Baseline", "Middle", "Hanging"];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function VerticalAlign_$reflection() {
|
|
103
|
+
return union_type("Compost.VerticalAlign", [], VerticalAlign, () => [[], [], []]);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export class continuous extends Union {
|
|
107
|
+
constructor(Item) {
|
|
108
|
+
super();
|
|
109
|
+
this.tag = 0;
|
|
110
|
+
this.fields = [Item];
|
|
111
|
+
}
|
|
112
|
+
cases() {
|
|
113
|
+
return ["CO"];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function continuous_$reflection(gen0) {
|
|
118
|
+
return union_type("Compost.continuous", [gen0], continuous, () => [[["Item", float64_type]]]);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export class categorical extends Union {
|
|
122
|
+
constructor(Item) {
|
|
123
|
+
super();
|
|
124
|
+
this.tag = 0;
|
|
125
|
+
this.fields = [Item];
|
|
126
|
+
}
|
|
127
|
+
cases() {
|
|
128
|
+
return ["CA"];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function categorical_$reflection(gen0) {
|
|
133
|
+
return union_type("Compost.categorical", [gen0], categorical, () => [[["Item", string_type]]]);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export class Value extends Union {
|
|
137
|
+
constructor(tag, fields) {
|
|
138
|
+
super();
|
|
139
|
+
this.tag = tag;
|
|
140
|
+
this.fields = fields;
|
|
141
|
+
}
|
|
142
|
+
cases() {
|
|
143
|
+
return ["CAR", "COV"];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function Value_$reflection(gen0) {
|
|
148
|
+
return union_type("Compost.Value", [gen0], Value, () => [[["Item1", categorical_$reflection(gen0)], ["Item2", float64_type]], [["Item", continuous_$reflection(gen0)]]]);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export class Scale extends Union {
|
|
152
|
+
constructor(tag, fields) {
|
|
153
|
+
super();
|
|
154
|
+
this.tag = tag;
|
|
155
|
+
this.fields = fields;
|
|
156
|
+
}
|
|
157
|
+
cases() {
|
|
158
|
+
return ["Continuous", "Categorical"];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function Scale_$reflection(gen0) {
|
|
163
|
+
return union_type("Compost.Scale", [gen0], Scale, () => [[["Item1", continuous_$reflection(gen0)], ["Item2", continuous_$reflection(gen0)]], [["Item", array_type(categorical_$reflection(gen0))]]]);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export class Style extends Record {
|
|
167
|
+
constructor(StrokeColor, StrokeWidth, StrokeDashArray, Fill, Animation, Font, Cursor, FormatAxisXLabel, FormatAxisYLabel) {
|
|
168
|
+
super();
|
|
169
|
+
this.StrokeColor = StrokeColor;
|
|
170
|
+
this.StrokeWidth = StrokeWidth;
|
|
171
|
+
this.StrokeDashArray = StrokeDashArray;
|
|
172
|
+
this.Fill = Fill;
|
|
173
|
+
this.Animation = Animation;
|
|
174
|
+
this.Font = Font;
|
|
175
|
+
this.Cursor = Cursor;
|
|
176
|
+
this.FormatAxisXLabel = FormatAxisXLabel;
|
|
177
|
+
this.FormatAxisYLabel = FormatAxisYLabel;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function Style_$reflection() {
|
|
182
|
+
return record_type("Compost.Style", [], Style, () => [["StrokeColor", tuple_type(float64_type, Color_$reflection())], ["StrokeWidth", Width_$reflection()], ["StrokeDashArray", class_type("System.Collections.Generic.IEnumerable`1", [Number$_$reflection()])], ["Fill", FillStyle_$reflection()], ["Animation", option_type(tuple_type(int32_type, string_type, lambda_type(Style_$reflection(), Style_$reflection())))], ["Font", string_type], ["Cursor", string_type], ["FormatAxisXLabel", lambda_type(Scale_$reflection(class_type("Microsoft.FSharp.Core.CompilerServices.MeasureOne")), lambda_type(Value_$reflection(class_type("Microsoft.FSharp.Core.CompilerServices.MeasureOne")), string_type))], ["FormatAxisYLabel", lambda_type(Scale_$reflection(class_type("Microsoft.FSharp.Core.CompilerServices.MeasureOne")), lambda_type(Value_$reflection(class_type("Microsoft.FSharp.Core.CompilerServices.MeasureOne")), string_type))]]);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export class EventHandler extends Union {
|
|
186
|
+
constructor(tag, fields) {
|
|
187
|
+
super();
|
|
188
|
+
this.tag = tag;
|
|
189
|
+
this.fields = fields;
|
|
190
|
+
}
|
|
191
|
+
cases() {
|
|
192
|
+
return ["MouseMove", "MouseUp", "MouseDown", "Click", "TouchStart", "TouchMove", "TouchEnd", "MouseLeave"];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function EventHandler_$reflection(gen0, gen1) {
|
|
197
|
+
return union_type("Compost.EventHandler", [gen0, gen1], EventHandler, () => [[["Item", lambda_type(class_type("Browser.Types.MouseEvent", undefined), lambda_type(tuple_type(Value_$reflection(gen0), Value_$reflection(gen1)), unit_type))]], [["Item", lambda_type(class_type("Browser.Types.MouseEvent", undefined), lambda_type(tuple_type(Value_$reflection(gen0), Value_$reflection(gen1)), unit_type))]], [["Item", lambda_type(class_type("Browser.Types.MouseEvent", undefined), lambda_type(tuple_type(Value_$reflection(gen0), Value_$reflection(gen1)), unit_type))]], [["Item", lambda_type(class_type("Browser.Types.MouseEvent", undefined), lambda_type(tuple_type(Value_$reflection(gen0), Value_$reflection(gen1)), unit_type))]], [["Item", lambda_type(class_type("Browser.Types.TouchEvent", undefined), lambda_type(tuple_type(Value_$reflection(gen0), Value_$reflection(gen1)), unit_type))]], [["Item", lambda_type(class_type("Browser.Types.TouchEvent", undefined), lambda_type(tuple_type(Value_$reflection(gen0), Value_$reflection(gen1)), unit_type))]], [["Item", lambda_type(class_type("Browser.Types.TouchEvent", undefined), unit_type)]], [["Item", lambda_type(class_type("Browser.Types.MouseEvent", undefined), unit_type)]]]);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export class Orientation extends Union {
|
|
201
|
+
constructor(tag, fields) {
|
|
202
|
+
super();
|
|
203
|
+
this.tag = tag;
|
|
204
|
+
this.fields = fields;
|
|
205
|
+
}
|
|
206
|
+
cases() {
|
|
207
|
+
return ["Vertical", "Horizontal"];
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function Orientation_$reflection() {
|
|
212
|
+
return union_type("Compost.Orientation", [], Orientation, () => [[], []]);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export class Shape extends Union {
|
|
216
|
+
constructor(tag, fields) {
|
|
217
|
+
super();
|
|
218
|
+
this.tag = tag;
|
|
219
|
+
this.fields = fields;
|
|
220
|
+
}
|
|
221
|
+
cases() {
|
|
222
|
+
return ["Style", "Text", "AutoScale", "InnerScale", "NestX", "NestY", "Line", "Bubble", "Shape", "Layered", "Axes", "Interactive", "Padding", "Offset"];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export function Shape_$reflection(gen0, gen1) {
|
|
227
|
+
return union_type("Compost.Shape", [gen0, gen1], Shape, () => [[["Item1", lambda_type(Style_$reflection(), Style_$reflection())], ["Item2", Shape_$reflection(gen0, gen1)]], [["Item1", Value_$reflection(gen0)], ["Item2", Value_$reflection(gen1)], ["Item3", VerticalAlign_$reflection()], ["Item4", HorizontalAlign_$reflection()], ["Item5", float64_type], ["Item6", string_type]], [["Item1", bool_type], ["Item2", bool_type], ["Item3", Shape_$reflection(gen0, gen1)]], [["Item1", option_type(Scale_$reflection(gen0))], ["Item2", option_type(Scale_$reflection(gen1))], ["Item3", Shape_$reflection(gen0, gen1)]], [["Item1", Value_$reflection(gen0)], ["Item2", Value_$reflection(gen0)], ["Item3", Shape_$reflection(gen0, gen1)]], [["Item1", Value_$reflection(gen1)], ["Item2", Value_$reflection(gen1)], ["Item3", Shape_$reflection(gen0, gen1)]], [["Item", class_type("System.Collections.Generic.IEnumerable`1", [tuple_type(Value_$reflection(gen0), Value_$reflection(gen1))])]], [["Item1", Value_$reflection(gen0)], ["Item2", Value_$reflection(gen1)], ["Item3", float64_type], ["Item4", float64_type]], [["Item", class_type("System.Collections.Generic.IEnumerable`1", [tuple_type(Value_$reflection(gen0), Value_$reflection(gen1))])]], [["Item", class_type("System.Collections.Generic.IEnumerable`1", [Shape_$reflection(gen0, gen1)])]], [["Item1", bool_type], ["Item2", bool_type], ["Item3", bool_type], ["Item4", bool_type], ["Item5", Shape_$reflection(gen0, gen1)]], [["Item1", class_type("System.Collections.Generic.IEnumerable`1", [EventHandler_$reflection(gen0, gen1)])], ["Item2", Shape_$reflection(gen0, gen1)]], [["Item1", tuple_type(float64_type, float64_type, float64_type, float64_type)], ["Item2", Shape_$reflection(gen0, gen1)]], [["Item1", tuple_type(float64_type, float64_type)], ["Item2", Shape_$reflection(gen0, gen1)]]]);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export class Svg_StringBuilder {
|
|
231
|
+
constructor() {
|
|
232
|
+
this.strs = empty();
|
|
233
|
+
}
|
|
234
|
+
toString() {
|
|
235
|
+
const x = this;
|
|
236
|
+
return join("", reverse(x.strs));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function Svg_StringBuilder_$reflection() {
|
|
241
|
+
return class_type("Compost.Svg.StringBuilder", undefined, Svg_StringBuilder);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function Svg_StringBuilder_$ctor() {
|
|
245
|
+
return new Svg_StringBuilder();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export function Svg_StringBuilder__Append_Z721C83C5(x, s) {
|
|
249
|
+
x.strs = cons(s, x.strs);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export class Svg_PathSegment extends Union {
|
|
253
|
+
constructor(tag, fields) {
|
|
254
|
+
super();
|
|
255
|
+
this.tag = tag;
|
|
256
|
+
this.fields = fields;
|
|
257
|
+
}
|
|
258
|
+
cases() {
|
|
259
|
+
return ["MoveTo", "LineTo"];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export function Svg_PathSegment_$reflection() {
|
|
264
|
+
return union_type("Compost.Svg.PathSegment", [], Svg_PathSegment, () => [[["Item", tuple_type(float64_type, float64_type)]], [["Item", tuple_type(float64_type, float64_type)]]]);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export class Svg_Svg extends Union {
|
|
268
|
+
constructor(tag, fields) {
|
|
269
|
+
super();
|
|
270
|
+
this.tag = tag;
|
|
271
|
+
this.fields = fields;
|
|
272
|
+
}
|
|
273
|
+
cases() {
|
|
274
|
+
return ["Path", "Ellipse", "Rect", "Text", "Combine", "Empty"];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export function Svg_Svg_$reflection() {
|
|
279
|
+
return union_type("Compost.Svg.Svg", [], Svg_Svg, () => [[["Item1", array_type(Svg_PathSegment_$reflection())], ["Item2", string_type]], [["Item1", tuple_type(float64_type, float64_type)], ["Item2", tuple_type(float64_type, float64_type)], ["Item3", string_type]], [["Item1", tuple_type(float64_type, float64_type)], ["Item2", tuple_type(float64_type, float64_type)], ["Item3", string_type]], [["Item1", tuple_type(float64_type, float64_type)], ["Item2", string_type], ["Item3", float64_type], ["Item4", string_type]], [["Item", array_type(Svg_Svg_$reflection())]], []]);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export function Svg_mapSvg(f, _arg) {
|
|
283
|
+
if (_arg.tag === 4) {
|
|
284
|
+
return new Svg_Svg(4, [map((_arg_1) => Svg_mapSvg(f, _arg_1), _arg.fields[0])]);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
return f(_arg);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export function Svg_formatPath(path) {
|
|
292
|
+
const sb = Svg_StringBuilder_$ctor();
|
|
293
|
+
const enumerator = getEnumerator(path);
|
|
294
|
+
try {
|
|
295
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
296
|
+
const ps = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
297
|
+
if (ps.tag === 1) {
|
|
298
|
+
Svg_StringBuilder__Append_Z721C83C5(sb, ((("L" + ps.fields[0][0].toString()) + " ") + ps.fields[0][1].toString()) + " ");
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
Svg_StringBuilder__Append_Z721C83C5(sb, ((("M" + ps.fields[0][0].toString()) + " ") + ps.fields[0][1].toString()) + " ");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
finally {
|
|
306
|
+
disposeSafe(enumerator);
|
|
307
|
+
}
|
|
308
|
+
return toString(sb);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export class Svg_RenderingContext extends Record {
|
|
312
|
+
constructor(Definitions) {
|
|
313
|
+
super();
|
|
314
|
+
this.Definitions = Definitions;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function Svg_RenderingContext_$reflection() {
|
|
319
|
+
return record_type("Compost.Svg.RenderingContext", [], Svg_RenderingContext, () => [["Definitions", array_type(DomNode_$reflection())]]);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export function Svg_renderSvg(ctx, svg) {
|
|
323
|
+
return delay(() => {
|
|
324
|
+
switch (svg.tag) {
|
|
325
|
+
case 3: {
|
|
326
|
+
const y = svg.fields[0][1];
|
|
327
|
+
const x = svg.fields[0][0];
|
|
328
|
+
const rotation = svg.fields[2];
|
|
329
|
+
return singleton(El_op_Dynamic_Z451691CD(s_6, "text")(toList(delay(() => append(singleton(op_EqualsGreater("style", svg.fields[3])), delay(() => ((rotation === 0) ? append(singleton(op_EqualsGreater("x", x.toString())), delay(() => singleton(op_EqualsGreater("y", y.toString())))) : append(singleton(op_EqualsGreater("x", "0")), delay(() => append(singleton(op_EqualsGreater("y", "0")), delay(() => singleton(op_EqualsGreater("transform", toText(printf("translate(%f,%f) rotate(%f)"))(x)(y)(rotation)))))))))))))(singleton_1(text(svg.fields[1]))));
|
|
330
|
+
}
|
|
331
|
+
case 4:
|
|
332
|
+
return collect((s) => Svg_renderSvg(ctx, s), svg.fields[0]);
|
|
333
|
+
case 1:
|
|
334
|
+
return singleton(El_op_Dynamic_Z451691CD(s_6, "ellipse")(ofArray([op_EqualsGreater("cx", svg.fields[0][0].toString()), op_EqualsGreater("cy", svg.fields[0][1].toString()), op_EqualsGreater("rx", svg.fields[1][0].toString()), op_EqualsGreater("ry", svg.fields[1][1].toString()), op_EqualsGreater("style", svg.fields[2])]))(empty()));
|
|
335
|
+
case 2: {
|
|
336
|
+
const y2 = svg.fields[1][1];
|
|
337
|
+
const y1 = svg.fields[0][1];
|
|
338
|
+
const x2 = svg.fields[1][0];
|
|
339
|
+
const x1 = svg.fields[0][0];
|
|
340
|
+
const matchValue = min(x1, x2);
|
|
341
|
+
const matchValue_1 = min(y1, y2);
|
|
342
|
+
const matchValue_2 = Math.abs(x1 - x2);
|
|
343
|
+
const matchValue_3 = Math.abs(y1 - y2);
|
|
344
|
+
return singleton(El_op_Dynamic_Z451691CD(s_6, "rect")(ofArray([op_EqualsGreater("x", matchValue.toString()), op_EqualsGreater("y", matchValue_1.toString()), op_EqualsGreater("width", matchValue_2.toString()), op_EqualsGreater("height", matchValue_3.toString()), op_EqualsGreater("style", svg.fields[2])]))(empty()));
|
|
345
|
+
}
|
|
346
|
+
case 0:
|
|
347
|
+
return singleton(El_op_Dynamic_Z451691CD(s_6, "path")(ofArray([op_EqualsGreater("d", Svg_formatPath(svg.fields[0])), op_EqualsGreater("style", svg.fields[1])]))(empty()));
|
|
348
|
+
default: {
|
|
349
|
+
return empty_1();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export function Svg_formatColor(_arg) {
|
|
356
|
+
if (_arg.tag === 1) {
|
|
357
|
+
return _arg.fields[0];
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
return toText(printf("rgb(%d, %d, %d)"))(_arg.fields[0])(_arg.fields[1])(_arg.fields[2]);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export function Svg_formatNumber(_arg) {
|
|
365
|
+
if (_arg.tag === 1) {
|
|
366
|
+
return _arg.fields[0].toString() + "%";
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
return int32ToString(_arg.fields[0]);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export function Svg_formatStyle(defs, style) {
|
|
374
|
+
let copyOfStruct, bind$0040, patternInput_1, arg_10, matchValue_1, arg_17, id_1, copyOfStruct_1, item_1;
|
|
375
|
+
let patternInput;
|
|
376
|
+
const matchValue = style.Animation;
|
|
377
|
+
if (matchValue == null) {
|
|
378
|
+
patternInput = [style, ""];
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
const ms = matchValue[0] | 0;
|
|
382
|
+
const ease = matchValue[1];
|
|
383
|
+
const anim = matchValue[2];
|
|
384
|
+
const id = "anim_" + replace((copyOfStruct = newGuid(), copyOfStruct), "-", "");
|
|
385
|
+
const fromstyle = Svg_formatStyle(defs, new Style(style.StrokeColor, style.StrokeWidth, style.StrokeDashArray, style.Fill, undefined, style.Font, style.Cursor, style.FormatAxisXLabel, style.FormatAxisYLabel));
|
|
386
|
+
const tostyle = Svg_formatStyle(defs, (bind$0040 = anim(style), new Style(bind$0040.StrokeColor, bind$0040.StrokeWidth, bind$0040.StrokeDashArray, bind$0040.Fill, undefined, bind$0040.Font, bind$0040.Cursor, bind$0040.FormatAxisXLabel, bind$0040.FormatAxisYLabel)));
|
|
387
|
+
const item = El_op_Dynamic_Z451691CD(h_2, "style")(empty())(singleton_1(text(toText(printf("@keyframes %s { from { %s } to { %s } }"))(id)(fromstyle)(tostyle))));
|
|
388
|
+
void (defs.push(item));
|
|
389
|
+
patternInput = [anim(style), toText(printf("animation: %s %dms %s; "))(id)(ms)(ease)];
|
|
390
|
+
}
|
|
391
|
+
const style_1 = patternInput[0];
|
|
392
|
+
return ((((patternInput[1] + join("", toList(delay(() => map_1((c) => (("cursor:" + c) + ";"), split(style_1.Cursor, [","], undefined, 0)))))) + (("font:" + style_1.Font) + ";")) + ((patternInput_1 = style_1.StrokeColor, (arg_10 = Svg_formatColor(patternInput_1[1]), toText(printf("stroke-opacity:%f; stroke-width:%dpx; stroke:%s; "))(patternInput_1[0])(style_1.StrokeWidth.fields[0])(arg_10))))) + (isEmpty(style_1.StrokeDashArray) ? "" : (("stroke-dasharray:" + join(",", map_1(Svg_formatNumber, style_1.StrokeDashArray))) + ";"))) + ((matchValue_1 = style_1.Fill, (matchValue_1.tag === 0) ? ((arg_17 = Svg_formatColor(matchValue_1.fields[0][1]), toText(printf("fill-opacity:%f; fill:%s; "))(matchValue_1.fields[0][0])(arg_17))) : ((id_1 = ("gradient_" + replace((copyOfStruct_1 = newGuid(), copyOfStruct_1), "-", "")), ((item_1 = El_op_Dynamic_Z451691CD(s_6, "linearGradient")(singleton_1(op_EqualsGreater("id", id_1)))(toList(delay(() => collect((matchValue_2) => singleton(El_op_Dynamic_Z451691CD(s_6, "stop")(ofArray([op_EqualsGreater("offset", matchValue_2[0].toString() + "%"), op_EqualsGreater("stop-color", Svg_formatColor(matchValue_2[1][1])), op_EqualsGreater("stop-opacity", matchValue_2[1][0].toString())]))(empty())), matchValue_1.fields[0])))), void (defs.push(item_1))), toText(printf("fill:url(#%s)"))(id_1))))));
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export class Scales_ScaledShape extends Union {
|
|
396
|
+
constructor(tag, fields) {
|
|
397
|
+
super();
|
|
398
|
+
this.tag = tag;
|
|
399
|
+
this.fields = fields;
|
|
400
|
+
}
|
|
401
|
+
cases() {
|
|
402
|
+
return ["ScaledStyle", "ScaledText", "ScaledLine", "ScaledBubble", "ScaledShape", "ScaledLayered", "ScaledInteractive", "ScaledPadding", "ScaledOffset", "ScaledNestX", "ScaledNestY"];
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export function Scales_ScaledShape_$reflection(gen0, gen1) {
|
|
407
|
+
return union_type("Compost.Scales.ScaledShape", [gen0, gen1], Scales_ScaledShape, () => [[["Item1", lambda_type(Style_$reflection(), Style_$reflection())], ["Item2", Scales_ScaledShape_$reflection(gen0, gen1)]], [["Item1", Value_$reflection(gen0)], ["Item2", Value_$reflection(gen1)], ["Item3", VerticalAlign_$reflection()], ["Item4", HorizontalAlign_$reflection()], ["Item5", float64_type], ["Item6", string_type]], [["Item", array_type(tuple_type(Value_$reflection(gen0), Value_$reflection(gen1)))]], [["Item1", Value_$reflection(gen0)], ["Item2", Value_$reflection(gen1)], ["Item3", float64_type], ["Item4", float64_type]], [["Item", array_type(tuple_type(Value_$reflection(gen0), Value_$reflection(gen1)))]], [["Item", array_type(Scales_ScaledShape_$reflection(gen0, gen1))]], [["Item1", class_type("System.Collections.Generic.IEnumerable`1", [EventHandler_$reflection(gen0, gen1)])], ["Item2", Scale_$reflection(gen0)], ["Item3", Scale_$reflection(gen1)], ["Item4", Scales_ScaledShape_$reflection(gen0, gen1)]], [["Item1", tuple_type(float64_type, float64_type, float64_type, float64_type)], ["Item2", Scale_$reflection(gen0)], ["Item3", Scale_$reflection(gen1)], ["Item4", Scales_ScaledShape_$reflection(gen0, gen1)]], [["Item1", tuple_type(float64_type, float64_type)], ["Item2", Scales_ScaledShape_$reflection(gen0, gen1)]], [["Item1", Value_$reflection(gen0)], ["Item2", Value_$reflection(gen0)], ["Item3", Scale_$reflection(gen0)], ["Item4", Scales_ScaledShape_$reflection(gen0, gen1)]], [["Item1", Value_$reflection(gen1)], ["Item2", Value_$reflection(gen1)], ["Item3", Scale_$reflection(gen1)], ["Item4", Scales_ScaledShape_$reflection(gen0, gen1)]]]);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export function Scales_getExtremes(_arg) {
|
|
411
|
+
if (_arg.tag === 1) {
|
|
412
|
+
const vals = _arg.fields[0];
|
|
413
|
+
return [new Value(0, [item_2(0, vals), 0]), new Value(0, [item_2(vals.length - 1, vals), 1])];
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
return [new Value(1, [_arg.fields[0]]), new Value(1, [_arg.fields[1]])];
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Given a range, return a new aligned range together with the magnitude
|
|
422
|
+
*/
|
|
423
|
+
export function Scales_calculateMagnitudeAndRange(lo, hi) {
|
|
424
|
+
let arg1__1;
|
|
425
|
+
const magnitude_1 = ((arg1__1 = round(Math.log10(hi - lo)), Math.pow(10, arg1__1))) / 2;
|
|
426
|
+
return [magnitude_1, [Math.floor(lo / magnitude_1) * magnitude_1, Math.ceil(hi / magnitude_1) * magnitude_1]];
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Get number of decimal points to show for the given range
|
|
431
|
+
*/
|
|
432
|
+
export function Scales_decimalPoints(range_, range__1) {
|
|
433
|
+
const range = [range_, range__1];
|
|
434
|
+
const patternInput = Scales_calculateMagnitudeAndRange(range[0], range[1]);
|
|
435
|
+
return max(0, Math.ceil(-Math.log10(patternInput[0])));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Extend the given range to a nicely adjusted size
|
|
440
|
+
*/
|
|
441
|
+
export function Scales_adjustRange(range_, range__1) {
|
|
442
|
+
const range = [range_, range__1];
|
|
443
|
+
return Scales_calculateMagnitudeAndRange(range[0], range[1])[1];
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export function Scales_adjustRangeUnits(l, h) {
|
|
447
|
+
const patternInput = Scales_adjustRange(l, h);
|
|
448
|
+
return [patternInput[0], patternInput[1]];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export function Scales_toArray(s) {
|
|
452
|
+
return Array.from(s);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Generate points for a grid. Count specifies how many points to generate
|
|
457
|
+
* (this is minimm - the result will be up to 5x more).
|
|
458
|
+
*/
|
|
459
|
+
export function Scales_generateSteps(count, k, lo, hi) {
|
|
460
|
+
const patternInput = Scales_calculateMagnitudeAndRange(lo, hi);
|
|
461
|
+
const magnitude = patternInput[0];
|
|
462
|
+
const step_1 = defaultArg(tryHead(filter((m) => (((hi - lo) / m) >= count), map_1((d) => (magnitude / d), [0.2, 0.5, 1, 2, 5, 10, 20, 40, 50, 60, 80, 100]))), magnitude / 100);
|
|
463
|
+
return Scales_toArray(delay(() => collect((v) => (((v >= lo) && (v <= hi)) ? singleton(v) : empty_1()), rangeDouble(patternInput[1][0], step_1 * k, patternInput[1][1]))));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export function Scales_generateAxisSteps(s) {
|
|
467
|
+
if (s.tag === 1) {
|
|
468
|
+
return toArray(delay(() => collect((matchValue) => singleton(new Value(0, [new categorical(matchValue.fields[0]), 0.5])), s.fields[0])));
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
return map((f) => (new Value(1, [new continuous(f)])), Scales_generateSteps(6, 1, s.fields[0].fields[0], s.fields[1].fields[0]));
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export function Scales_generateAxisLabels(fmt, s) {
|
|
476
|
+
const sunit = s;
|
|
477
|
+
if (s.tag === 1) {
|
|
478
|
+
return toArray(delay(() => collect((matchValue) => {
|
|
479
|
+
const s_1 = matchValue.fields[0];
|
|
480
|
+
return singleton([new Value(0, [new categorical(s_1), 0.5]), fmt(sunit, new Value(0, [new categorical(s_1), 0.5]))]);
|
|
481
|
+
}, s.fields[0])));
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
return map((f) => [new Value(1, [new continuous(f)]), fmt(sunit, new Value(1, [new continuous(f)]))], Scales_generateSteps(6, 2, s.fields[0].fields[0], s.fields[1].fields[0]));
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export function Scales_unionScales(s1, s2) {
|
|
489
|
+
let matchResult, h1, h2, l1, l2, v1, v2;
|
|
490
|
+
if (s1.tag === 1) {
|
|
491
|
+
if (s2.tag === 1) {
|
|
492
|
+
matchResult = 1;
|
|
493
|
+
v1 = s1.fields[0];
|
|
494
|
+
v2 = s2.fields[0];
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
matchResult = 2;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
else if (s2.tag === 0) {
|
|
501
|
+
matchResult = 0;
|
|
502
|
+
h1 = s1.fields[1];
|
|
503
|
+
h2 = s2.fields[1];
|
|
504
|
+
l1 = s1.fields[0];
|
|
505
|
+
l2 = s2.fields[0];
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
matchResult = 2;
|
|
509
|
+
}
|
|
510
|
+
switch (matchResult) {
|
|
511
|
+
case 0:
|
|
512
|
+
return new Scale(0, [min_1(compare, l1, l2), max_1(compare, h1, h2)]);
|
|
513
|
+
case 1:
|
|
514
|
+
return new Scale(1, [Array_distinct(append_1(v1, v2), {
|
|
515
|
+
Equals: equals,
|
|
516
|
+
GetHashCode: safeHash,
|
|
517
|
+
})]);
|
|
518
|
+
default:
|
|
519
|
+
throw new Error("Cannot union continuous with categorical");
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export function Scales_calculateShapeScale(vals) {
|
|
524
|
+
const scales = fold((state, value) => {
|
|
525
|
+
let matchResult, v, v_1, vs, x, x_1, xs;
|
|
526
|
+
switch (state.tag) {
|
|
527
|
+
case 1: {
|
|
528
|
+
if (value.tag === 1) {
|
|
529
|
+
matchResult = 1;
|
|
530
|
+
v_1 = value.fields[0].fields[0];
|
|
531
|
+
vs = state.fields[0];
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
matchResult = 4;
|
|
535
|
+
}
|
|
536
|
+
break;
|
|
537
|
+
}
|
|
538
|
+
case 2: {
|
|
539
|
+
if (value.tag === 0) {
|
|
540
|
+
matchResult = 3;
|
|
541
|
+
x_1 = value.fields[0].fields[0];
|
|
542
|
+
xs = state.fields[0];
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
matchResult = 4;
|
|
546
|
+
}
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
default:
|
|
550
|
+
if (value.tag === 0) {
|
|
551
|
+
matchResult = 2;
|
|
552
|
+
x = value.fields[0].fields[0];
|
|
553
|
+
}
|
|
554
|
+
else {
|
|
555
|
+
matchResult = 0;
|
|
556
|
+
v = value.fields[0].fields[0];
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
switch (matchResult) {
|
|
560
|
+
case 0:
|
|
561
|
+
return new FSharpChoice$3(1, [singleton_1(v)]);
|
|
562
|
+
case 1:
|
|
563
|
+
return new FSharpChoice$3(1, [cons(v_1, vs)]);
|
|
564
|
+
case 2:
|
|
565
|
+
return new FSharpChoice$3(2, [singleton_1(x)]);
|
|
566
|
+
case 3:
|
|
567
|
+
return new FSharpChoice$3(2, [cons(x_1, xs)]);
|
|
568
|
+
default:
|
|
569
|
+
throw new Error("Values with mismatching scales");
|
|
570
|
+
}
|
|
571
|
+
}, new FSharpChoice$3(0, [undefined]), vals);
|
|
572
|
+
switch (scales.tag) {
|
|
573
|
+
case 1: {
|
|
574
|
+
const vs_1 = scales.fields[0];
|
|
575
|
+
return new Scale(0, [new continuous(min_2(vs_1, {
|
|
576
|
+
Compare: comparePrimitives,
|
|
577
|
+
})), new continuous(max_2(vs_1, {
|
|
578
|
+
Compare: comparePrimitives,
|
|
579
|
+
}))]);
|
|
580
|
+
}
|
|
581
|
+
case 2:
|
|
582
|
+
return new Scale(1, [Array_distinct(toArray(delay(() => map_1((x_4) => (new categorical(x_4)), reverse(scales.fields[0])))), {
|
|
583
|
+
Equals: equals,
|
|
584
|
+
GetHashCode: safeHash,
|
|
585
|
+
})]);
|
|
586
|
+
default:
|
|
587
|
+
throw new Error("No values for calculating a scale");
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
export function Scales_calculateShapeScales(points) {
|
|
592
|
+
const xs = map((tuple) => tuple[0], points);
|
|
593
|
+
const ys = map((tuple_1) => tuple_1[1], points);
|
|
594
|
+
return [Scales_calculateShapeScale(xs), Scales_calculateShapeScale(ys)];
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export function Scales_calculateScales(style, shape) {
|
|
598
|
+
const calculateScales = (shape_2) => Scales_calculateScales(style, shape_2);
|
|
599
|
+
switch (shape.tag) {
|
|
600
|
+
case 4: {
|
|
601
|
+
const nx2 = shape.fields[1];
|
|
602
|
+
const nx1 = shape.fields[0];
|
|
603
|
+
const patternInput_1 = calculateScales(shape.fields[2]);
|
|
604
|
+
return [[Scales_calculateShapeScale([nx1, nx2]), patternInput_1[0][1]], new Scales_ScaledShape(9, [nx1, nx2, patternInput_1[0][0], patternInput_1[1]])];
|
|
605
|
+
}
|
|
606
|
+
case 5: {
|
|
607
|
+
const ny2 = shape.fields[1];
|
|
608
|
+
const ny1 = shape.fields[0];
|
|
609
|
+
const patternInput_2 = calculateScales(shape.fields[2]);
|
|
610
|
+
return [[patternInput_2[0][0], Scales_calculateShapeScale([ny1, ny2])], new Scales_ScaledShape(10, [ny1, ny2, patternInput_2[0][1], patternInput_2[1]])];
|
|
611
|
+
}
|
|
612
|
+
case 3: {
|
|
613
|
+
const sy = shape.fields[1];
|
|
614
|
+
const sx = shape.fields[0];
|
|
615
|
+
const patternInput_3 = calculateScales(shape.fields[2]);
|
|
616
|
+
return [[(sx != null) ? sx : patternInput_3[0][0], (sy != null) ? sy : patternInput_3[0][1]], patternInput_3[1]];
|
|
617
|
+
}
|
|
618
|
+
case 2: {
|
|
619
|
+
const patternInput_4 = calculateScales(shape.fields[2]);
|
|
620
|
+
const isy_3 = patternInput_4[0][1];
|
|
621
|
+
const isx_3 = patternInput_4[0][0];
|
|
622
|
+
const autoScale = (_arg) => {
|
|
623
|
+
if (_arg.tag === 0) {
|
|
624
|
+
const patternInput_5 = Scales_adjustRangeUnits(_arg.fields[0].fields[0], _arg.fields[1].fields[0]);
|
|
625
|
+
return new Scale(0, [new continuous(patternInput_5[0]), new continuous(patternInput_5[1])]);
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
return _arg;
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
return [[shape.fields[0] ? autoScale(isx_3) : isx_3, shape.fields[1] ? autoScale(isy_3) : isy_3], patternInput_4[1]];
|
|
632
|
+
}
|
|
633
|
+
case 13: {
|
|
634
|
+
const patternInput_6 = calculateScales(shape.fields[1]);
|
|
635
|
+
return [patternInput_6[0], new Scales_ScaledShape(8, [shape.fields[0], patternInput_6[1]])];
|
|
636
|
+
}
|
|
637
|
+
case 12: {
|
|
638
|
+
const patternInput_7 = calculateScales(shape.fields[1]);
|
|
639
|
+
const sy_3 = patternInput_7[0][1];
|
|
640
|
+
const sx_3 = patternInput_7[0][0];
|
|
641
|
+
return [[sx_3, sy_3], new Scales_ScaledShape(7, [shape.fields[0], sx_3, sy_3, patternInput_7[1]])];
|
|
642
|
+
}
|
|
643
|
+
case 7: {
|
|
644
|
+
const y = shape.fields[1];
|
|
645
|
+
const x = shape.fields[0];
|
|
646
|
+
const makeSingletonScale = (_arg_1) => {
|
|
647
|
+
if (_arg_1.tag === 0) {
|
|
648
|
+
return new Scale(1, [[_arg_1.fields[0]]]);
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
const v = _arg_1.fields[0];
|
|
652
|
+
return new Scale(0, [v, v]);
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
return [[makeSingletonScale(x), makeSingletonScale(y)], new Scales_ScaledShape(3, [x, y, shape.fields[2], shape.fields[3]])];
|
|
656
|
+
}
|
|
657
|
+
case 1: {
|
|
658
|
+
const y_1 = shape.fields[1];
|
|
659
|
+
const x_1 = shape.fields[0];
|
|
660
|
+
const makeSingletonScale_1 = (_arg_2) => {
|
|
661
|
+
if (_arg_2.tag === 0) {
|
|
662
|
+
return new Scale(1, [[_arg_2.fields[0]]]);
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
const v_2 = _arg_2.fields[0];
|
|
666
|
+
return new Scale(0, [v_2, v_2]);
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
return [[makeSingletonScale_1(x_1), makeSingletonScale_1(y_1)], new Scales_ScaledShape(1, [x_1, y_1, shape.fields[2], shape.fields[3], shape.fields[4], shape.fields[5]])];
|
|
670
|
+
}
|
|
671
|
+
case 6: {
|
|
672
|
+
const line_1 = toArray(shape.fields[0]);
|
|
673
|
+
return [Scales_calculateShapeScales(line_1), new Scales_ScaledShape(2, [line_1])];
|
|
674
|
+
}
|
|
675
|
+
case 8: {
|
|
676
|
+
const points_1 = toArray(shape.fields[0]);
|
|
677
|
+
return [Scales_calculateShapeScales(points_1), new Scales_ScaledShape(4, [points_1])];
|
|
678
|
+
}
|
|
679
|
+
case 10: {
|
|
680
|
+
const showTop = shape.fields[0];
|
|
681
|
+
const showRight = shape.fields[1];
|
|
682
|
+
const showLeft = shape.fields[3];
|
|
683
|
+
const showBottom = shape.fields[2];
|
|
684
|
+
const shape_17 = shape.fields[4];
|
|
685
|
+
const patternInput_8 = calculateScales(shape_17);
|
|
686
|
+
const sy_4 = patternInput_8[0][1];
|
|
687
|
+
const sx_4 = patternInput_8[0][0];
|
|
688
|
+
const matchValue = Scales_getExtremes(sx_4);
|
|
689
|
+
const matchValue_1 = Scales_getExtremes(sy_4);
|
|
690
|
+
const ly = matchValue_1[0];
|
|
691
|
+
const lx = matchValue[0];
|
|
692
|
+
const hy = matchValue_1[1];
|
|
693
|
+
const hx = matchValue[1];
|
|
694
|
+
const LineStyle = (clr, alpha, width, shape_18) => (new Shape(0, [(s) => (new Style([alpha, new Color(1, [clr])], new Width(width), s.StrokeDashArray, new FillStyle(0, [[1, new Color(1, ["transparent"])]]), s.Animation, s.Font, s.Cursor, s.FormatAxisXLabel, s.FormatAxisYLabel)), shape_18]));
|
|
695
|
+
const FontStyle = (style_2, shape_19) => (new Shape(0, [(s_1) => (new Style([0, new Color(1, ["transparent"])], s_1.StrokeWidth, s_1.StrokeDashArray, new FillStyle(0, [[1, new Color(1, ["black"])]]), s_1.Animation, style_2, s_1.Cursor, s_1.FormatAxisXLabel, s_1.FormatAxisYLabel)), shape_19]));
|
|
696
|
+
return calculateScales(new Shape(12, [[showTop ? 30 : 0, showRight ? 50 : 0, showBottom ? 30 : 0, showLeft ? 50 : 0], new Shape(9, [toList(delay(() => append(singleton(new Shape(3, [sx_4, sy_4, new Shape(9, [toList(delay(() => append(map_1((x_2) => LineStyle("#e4e4e4", 1, 1, new Shape(6, [[[x_2, ly], [x_2, hy]]])), Scales_generateAxisSteps(sx_4)), delay(() => map_1((y_2) => LineStyle("#e4e4e4", 1, 1, new Shape(6, [[[lx, y_2], [hx, y_2]]])), Scales_generateAxisSteps(sy_4))))))])])), delay(() => append(showTop ? append(singleton(LineStyle("black", 1, 2, new Shape(6, [[[lx, hy], [hx, hy]]]))), delay(() => collect((matchValue_2) => singleton(FontStyle("9pt sans-serif", new Shape(13, [[0, -10], new Shape(1, [matchValue_2[0], hy, new VerticalAlign(0, []), new HorizontalAlign(1, []), 0, matchValue_2[1]])]))), Scales_generateAxisLabels(style.FormatAxisXLabel, sx_4)))) : empty_1(), delay(() => append(showRight ? append(singleton(LineStyle("black", 1, 2, new Shape(6, [[[hx, hy], [hx, ly]]]))), delay(() => collect((matchValue_3) => singleton(FontStyle("9pt sans-serif", new Shape(13, [[10, 0], new Shape(1, [hx, matchValue_3[0], new VerticalAlign(1, []), new HorizontalAlign(0, []), 0, matchValue_3[1]])]))), Scales_generateAxisLabels(style.FormatAxisYLabel, sy_4)))) : empty_1(), delay(() => append(showBottom ? append(singleton(LineStyle("black", 1, 2, new Shape(6, [[[lx, ly], [hx, ly]]]))), delay(() => collect((matchValue_4) => singleton(FontStyle("9pt sans-serif", new Shape(13, [[0, 10], new Shape(1, [matchValue_4[0], ly, new VerticalAlign(2, []), new HorizontalAlign(1, []), 0, matchValue_4[1]])]))), Scales_generateAxisLabels(style.FormatAxisXLabel, sx_4)))) : empty_1(), delay(() => append(showLeft ? append(singleton(LineStyle("black", 1, 2, new Shape(6, [[[lx, hy], [lx, ly]]]))), delay(() => collect((matchValue_5) => singleton(FontStyle("9pt sans-serif", new Shape(13, [[-10, 0], new Shape(1, [lx, matchValue_5[0], new VerticalAlign(1, []), new HorizontalAlign(2, []), 0, matchValue_5[1]])]))), Scales_generateAxisLabels(style.FormatAxisYLabel, sy_4)))) : empty_1(), delay(() => singleton(shape_17)))))))))))))])]));
|
|
697
|
+
}
|
|
698
|
+
case 9: {
|
|
699
|
+
const scaled = map(calculateScales, Array.from(shape.fields[0]));
|
|
700
|
+
const sxs = map((tupledArg) => tupledArg[0][0], scaled);
|
|
701
|
+
const sys = map((tupledArg_1) => tupledArg_1[0][1], scaled);
|
|
702
|
+
return [[sxs.reduce(Scales_unionScales), sys.reduce(Scales_unionScales)], new Scales_ScaledShape(5, [map((tuple) => tuple[1], scaled)])];
|
|
703
|
+
}
|
|
704
|
+
case 11: {
|
|
705
|
+
const patternInput_10 = calculateScales(shape.fields[1]);
|
|
706
|
+
const scales_8 = patternInput_10[0];
|
|
707
|
+
return [scales_8, new Scales_ScaledShape(6, [shape.fields[0], scales_8[0], scales_8[1], patternInput_10[1]])];
|
|
708
|
+
}
|
|
709
|
+
default: {
|
|
710
|
+
const f = shape.fields[0];
|
|
711
|
+
const patternInput = Scales_calculateScales(f(style), shape.fields[1]);
|
|
712
|
+
return [patternInput[0], new Scales_ScaledShape(0, [f, patternInput[1]])];
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
export function Projections_projectOne(reversed, tlv, thv, scale, coord) {
|
|
718
|
+
if (scale.tag === 0) {
|
|
719
|
+
if (coord.tag === 0) {
|
|
720
|
+
return toFail(printf("Cannot project categorical value (%A) on a continuous scale (%A)."))(coord)(scale);
|
|
721
|
+
}
|
|
722
|
+
else if (reversed) {
|
|
723
|
+
return thv - (((coord.fields[0].fields[0] - scale.fields[0].fields[0]) / (scale.fields[1].fields[0] - scale.fields[0].fields[0])) * (thv - tlv));
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
return tlv + (((coord.fields[0].fields[0] - scale.fields[0].fields[0]) / (scale.fields[1].fields[0] - scale.fields[0].fields[0])) * (thv - tlv));
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
else if (coord.tag === 1) {
|
|
730
|
+
return toFail(printf("Cannot project continuous value (%A) on a categorical scale (%A)."))(coord)(scale);
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
const size = (thv - tlv) / scale.fields[0].length;
|
|
734
|
+
const i_1 = findIndex((_arg) => (coord.fields[0].fields[0] === _arg.fields[0]), scale.fields[0]) + coord.fields[1];
|
|
735
|
+
if (reversed) {
|
|
736
|
+
return thv - (i_1 * size);
|
|
737
|
+
}
|
|
738
|
+
else {
|
|
739
|
+
return tlv + (i_1 * size);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
export function Projections_projectOneX(a_, a__1) {
|
|
745
|
+
const a = [a_, a__1];
|
|
746
|
+
return (scale) => ((coord) => Projections_projectOne(false, a[0], a[1], scale, coord));
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export function Projections_projectOneY(a_, a__1) {
|
|
750
|
+
const a = [a_, a__1];
|
|
751
|
+
return (scale) => ((coord) => Projections_projectOne(true, a[0], a[1], scale, coord));
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export function Projections_projectInvOne(reversed, l, h, s, v) {
|
|
755
|
+
if (s.tag === 1) {
|
|
756
|
+
const cats = s.fields[0];
|
|
757
|
+
const size = (h - l) / cats.length;
|
|
758
|
+
const i = reversed ? Math.floor((h - v) / size) : Math.floor((v - l) / size);
|
|
759
|
+
const f = reversed ? (((h - v) / size) - i) : (((v - l) / size) - i);
|
|
760
|
+
const i_1 = (size < 0) ? (cats.length + i) : i;
|
|
761
|
+
if ((~~i_1 < 0) ? true : (~~i_1 >= cats.length)) {
|
|
762
|
+
return new Value(0, [new categorical("<outside-of-range>"), f]);
|
|
763
|
+
}
|
|
764
|
+
else {
|
|
765
|
+
return new Value(0, [item_2(~~i_1, cats), f]);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
else {
|
|
769
|
+
const slv = s.fields[0].fields[0];
|
|
770
|
+
const shv = s.fields[1].fields[0];
|
|
771
|
+
if (reversed) {
|
|
772
|
+
return new Value(1, [new continuous(shv - (((v - l) / (h - l)) * (shv - slv)))]);
|
|
773
|
+
}
|
|
774
|
+
else {
|
|
775
|
+
return new Value(1, [new continuous(slv + (((v - l) / (h - l)) * (shv - slv)))]);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
export function Projections_projectInv(x1, y1, x2, y2, sx, sy, x, y) {
|
|
781
|
+
return [Projections_projectInvOne(false, x1, x2, sx, x), Projections_projectInvOne(true, y1, y2, sy, y)];
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export class Drawing_DrawingContext extends Record {
|
|
785
|
+
constructor(Style, Definitions) {
|
|
786
|
+
super();
|
|
787
|
+
this.Style = Style;
|
|
788
|
+
this.Definitions = Definitions;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
export function Drawing_DrawingContext_$reflection() {
|
|
793
|
+
return record_type("Compost.Drawing.DrawingContext", [], Drawing_DrawingContext, () => [["Style", Style_$reflection()], ["Definitions", array_type(DomNode_$reflection())]]);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
export function Drawing_hideFill(style) {
|
|
797
|
+
let matchValue, f;
|
|
798
|
+
return new Style(style.StrokeColor, style.StrokeWidth, style.StrokeDashArray, new FillStyle(0, [[0, new Color(0, [0, 0, 0])]]), (matchValue = style.Animation, (matchValue != null) ? ((f = matchValue[2], [matchValue[0], matchValue[1], (arg) => Drawing_hideFill(f(arg))])) : undefined), style.Font, style.Cursor, style.FormatAxisXLabel, style.FormatAxisYLabel);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
export function Drawing_hideStroke(style) {
|
|
802
|
+
let matchValue, f;
|
|
803
|
+
return new Style([0, style.StrokeColor[1]], style.StrokeWidth, style.StrokeDashArray, style.Fill, (matchValue = style.Animation, (matchValue != null) ? ((f = matchValue[2], [matchValue[0], matchValue[1], (arg) => Drawing_hideStroke(f(arg))])) : undefined), style.Font, style.Cursor, style.FormatAxisXLabel, style.FormatAxisYLabel);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export function Drawing_drawShape(ctx_mut, area__mut, area__1_mut, area__2_mut, area__3_mut, scales__mut, scales__1_mut, shape_mut) {
|
|
807
|
+
Drawing_drawShape:
|
|
808
|
+
while (true) {
|
|
809
|
+
const ctx = ctx_mut, area_ = area__mut, area__1 = area__1_mut, area__2 = area__2_mut, area__3 = area__3_mut, scales_ = scales__mut, scales__1 = scales__1_mut, shape = shape_mut;
|
|
810
|
+
const area_1 = [area_, area__1, area__2, area__3];
|
|
811
|
+
const y2 = area_1[3];
|
|
812
|
+
const y1 = area_1[1];
|
|
813
|
+
const x2 = area_1[2];
|
|
814
|
+
const x1 = area_1[0];
|
|
815
|
+
const scales_1 = [scales_, scales__1];
|
|
816
|
+
const sy = scales_1[1];
|
|
817
|
+
const sx = scales_1[0];
|
|
818
|
+
const project = (tupledArg) => [Projections_projectOneX(x1, x2)(sx)(tupledArg[0]), Projections_projectOneY(y1, y2)(sy)(tupledArg[1])];
|
|
819
|
+
switch (shape.tag) {
|
|
820
|
+
case 10: {
|
|
821
|
+
ctx_mut = ctx;
|
|
822
|
+
area__mut = x1;
|
|
823
|
+
area__1_mut = Projections_projectOneY(y1, y2)(sy)(shape.fields[0]);
|
|
824
|
+
area__2_mut = x2;
|
|
825
|
+
area__3_mut = Projections_projectOneY(y1, y2)(sy)(shape.fields[1]);
|
|
826
|
+
scales__mut = sx;
|
|
827
|
+
scales__1_mut = shape.fields[2];
|
|
828
|
+
shape_mut = shape.fields[3];
|
|
829
|
+
continue Drawing_drawShape;
|
|
830
|
+
}
|
|
831
|
+
case 8: {
|
|
832
|
+
const dy = shape.fields[0][1];
|
|
833
|
+
const dx = shape.fields[0][0];
|
|
834
|
+
ctx_mut = ctx;
|
|
835
|
+
area__mut = (x1 + dx);
|
|
836
|
+
area__1_mut = (y1 + dy);
|
|
837
|
+
area__2_mut = (x2 + dx);
|
|
838
|
+
area__3_mut = (y2 + dy);
|
|
839
|
+
scales__mut = scales_1[0];
|
|
840
|
+
scales__1_mut = scales_1[1];
|
|
841
|
+
shape_mut = shape.fields[1];
|
|
842
|
+
continue Drawing_drawShape;
|
|
843
|
+
}
|
|
844
|
+
case 5:
|
|
845
|
+
return new Svg_Svg(4, [map((shape_4) => Drawing_drawShape(ctx, area_1[0], area_1[1], area_1[2], area_1[3], scales_1[0], scales_1[1], shape_4), shape.fields[0])]);
|
|
846
|
+
case 0: {
|
|
847
|
+
ctx_mut = (new Drawing_DrawingContext(shape.fields[0](ctx.Style), ctx.Definitions));
|
|
848
|
+
area__mut = area_1[0];
|
|
849
|
+
area__1_mut = area_1[1];
|
|
850
|
+
area__2_mut = area_1[2];
|
|
851
|
+
area__3_mut = area_1[3];
|
|
852
|
+
scales__mut = scales_1[0];
|
|
853
|
+
scales__1_mut = scales_1[1];
|
|
854
|
+
shape_mut = shape.fields[1];
|
|
855
|
+
continue Drawing_drawShape;
|
|
856
|
+
}
|
|
857
|
+
case 4: {
|
|
858
|
+
const points = shape.fields[0];
|
|
859
|
+
return new Svg_Svg(0, [toArray(delay(() => append(singleton(new Svg_PathSegment(0, [project(item_2(0, points))])), delay(() => append(map_1((pt) => (new Svg_PathSegment(1, [project(pt)])), skip(1, points)), delay(() => singleton(new Svg_PathSegment(1, [project(item_2(0, points))])))))))), Svg_formatStyle(ctx.Definitions, Drawing_hideStroke(ctx.Style))]);
|
|
860
|
+
}
|
|
861
|
+
case 7: {
|
|
862
|
+
const isy_1 = shape.fields[2];
|
|
863
|
+
const isx_1 = shape.fields[1];
|
|
864
|
+
const calculateNestedRange = (rev) => ((tupledArg_1) => ((ins) => {
|
|
865
|
+
const v1 = tupledArg_1[0];
|
|
866
|
+
const v2 = tupledArg_1[1];
|
|
867
|
+
return (outs) => {
|
|
868
|
+
if (ins.tag === 1) {
|
|
869
|
+
const pos_1 = collect((v) => ofArray([Projections_projectOne(rev, v1, v2, outs, new Value(0, [v, 0])), Projections_projectOne(rev, v1, v2, outs, new Value(0, [v, 1]))]), ins.fields[0]);
|
|
870
|
+
return [min_3(pos_1, {
|
|
871
|
+
Compare: comparePrimitives,
|
|
872
|
+
}), max_3(pos_1, {
|
|
873
|
+
Compare: comparePrimitives,
|
|
874
|
+
})];
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
const pos = ofArray([Projections_projectOne(rev, v1, v2, outs, new Value(1, [new continuous(ins.fields[0].fields[0])])), Projections_projectOne(rev, v1, v2, outs, new Value(1, [new continuous(ins.fields[1].fields[0])]))]);
|
|
878
|
+
return [min_3(pos, {
|
|
879
|
+
Compare: comparePrimitives,
|
|
880
|
+
}), max_3(pos, {
|
|
881
|
+
Compare: comparePrimitives,
|
|
882
|
+
})];
|
|
883
|
+
}
|
|
884
|
+
};
|
|
885
|
+
}));
|
|
886
|
+
const patternInput = calculateNestedRange(false)([x1, x2])(isx_1)(sx);
|
|
887
|
+
const patternInput_1 = calculateNestedRange(true)([y1, y2])(isy_1)(sy);
|
|
888
|
+
ctx_mut = ctx;
|
|
889
|
+
area__mut = (patternInput[0] + shape.fields[0][3]);
|
|
890
|
+
area__1_mut = (patternInput_1[0] + shape.fields[0][0]);
|
|
891
|
+
area__2_mut = (patternInput[1] - shape.fields[0][1]);
|
|
892
|
+
area__3_mut = (patternInput_1[1] - shape.fields[0][2]);
|
|
893
|
+
scales__mut = isx_1;
|
|
894
|
+
scales__1_mut = isy_1;
|
|
895
|
+
shape_mut = shape.fields[3];
|
|
896
|
+
continue Drawing_drawShape;
|
|
897
|
+
}
|
|
898
|
+
case 2: {
|
|
899
|
+
const line = shape.fields[0];
|
|
900
|
+
return new Svg_Svg(0, [Array.from(delay(() => append(singleton(new Svg_PathSegment(0, [project(head(line))])), delay(() => map_1((pt_1) => (new Svg_PathSegment(1, [project(pt_1)])), skip(1, line)))))), Svg_formatStyle(ctx.Definitions, Drawing_hideFill(ctx.Style))]);
|
|
901
|
+
}
|
|
902
|
+
case 1: {
|
|
903
|
+
const va = shape.fields[2];
|
|
904
|
+
const ha = shape.fields[3];
|
|
905
|
+
const va_1 = (va.tag === 2) ? "hanging" : ((va.tag === 1) ? "middle" : "baseline");
|
|
906
|
+
const ha_1 = (ha.tag === 1) ? "middle" : ((ha.tag === 2) ? "end" : "start");
|
|
907
|
+
return new Svg_Svg(3, [project([shape.fields[0], shape.fields[1]]), shape.fields[5], shape.fields[4], toText(printf("alignment-baseline:%s; text-anchor:%s;"))(va_1)(ha_1) + Svg_formatStyle(ctx.Definitions, ctx.Style)]);
|
|
908
|
+
}
|
|
909
|
+
case 3:
|
|
910
|
+
return new Svg_Svg(1, [project([shape.fields[0], shape.fields[1]]), [shape.fields[2], shape.fields[3]], Svg_formatStyle(ctx.Definitions, ctx.Style)]);
|
|
911
|
+
case 6: {
|
|
912
|
+
ctx_mut = ctx;
|
|
913
|
+
area__mut = area_1[0];
|
|
914
|
+
area__1_mut = area_1[1];
|
|
915
|
+
area__2_mut = area_1[2];
|
|
916
|
+
area__3_mut = area_1[3];
|
|
917
|
+
scales__mut = scales_1[0];
|
|
918
|
+
scales__1_mut = scales_1[1];
|
|
919
|
+
shape_mut = shape.fields[3];
|
|
920
|
+
continue Drawing_drawShape;
|
|
921
|
+
}
|
|
922
|
+
default: {
|
|
923
|
+
ctx_mut = ctx;
|
|
924
|
+
area__mut = Projections_projectOneX(x1, x2)(sx)(shape.fields[0]);
|
|
925
|
+
area__1_mut = y1;
|
|
926
|
+
area__2_mut = Projections_projectOneX(x1, x2)(sx)(shape.fields[1]);
|
|
927
|
+
area__3_mut = y2;
|
|
928
|
+
scales__mut = shape.fields[2];
|
|
929
|
+
scales__1_mut = sy;
|
|
930
|
+
shape_mut = shape.fields[3];
|
|
931
|
+
continue Drawing_drawShape;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
break;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export class Events_MouseEventKind extends Union {
|
|
939
|
+
constructor(tag, fields) {
|
|
940
|
+
super();
|
|
941
|
+
this.tag = tag;
|
|
942
|
+
this.fields = fields;
|
|
943
|
+
}
|
|
944
|
+
cases() {
|
|
945
|
+
return ["Click", "Move", "Up", "Down"];
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
export function Events_MouseEventKind_$reflection() {
|
|
950
|
+
return union_type("Compost.Events.MouseEventKind", [], Events_MouseEventKind, () => [[], [], [], []]);
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
export class Events_TouchEventKind extends Union {
|
|
954
|
+
constructor(tag, fields) {
|
|
955
|
+
super();
|
|
956
|
+
this.tag = tag;
|
|
957
|
+
this.fields = fields;
|
|
958
|
+
}
|
|
959
|
+
cases() {
|
|
960
|
+
return ["Move", "Start"];
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
export function Events_TouchEventKind_$reflection() {
|
|
965
|
+
return union_type("Compost.Events.TouchEventKind", [], Events_TouchEventKind, () => [[], []]);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export class Events_InteractiveEvent extends Union {
|
|
969
|
+
constructor(tag, fields) {
|
|
970
|
+
super();
|
|
971
|
+
this.tag = tag;
|
|
972
|
+
this.fields = fields;
|
|
973
|
+
}
|
|
974
|
+
cases() {
|
|
975
|
+
return ["MouseEvent", "TouchEvent", "TouchEnd", "MouseLeave"];
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
export function Events_InteractiveEvent_$reflection(gen0, gen1) {
|
|
980
|
+
return union_type("Compost.Events.InteractiveEvent", [gen0, gen1], Events_InteractiveEvent, () => [[["Item1", Events_MouseEventKind_$reflection()], ["Item2", tuple_type(Value_$reflection(gen0), Value_$reflection(gen1))]], [["Item1", Events_TouchEventKind_$reflection()], ["Item2", tuple_type(Value_$reflection(gen0), Value_$reflection(gen1))]], [], []]);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
export function Events_projectEvent(area_, area__1, area__2, area__3, scales_, scales__1, event) {
|
|
984
|
+
const area = [area_, area__1, area__2, area__3];
|
|
985
|
+
const scales = [scales_, scales__1];
|
|
986
|
+
let matchResult, kind, x, y, kind_1, x_3, y_3;
|
|
987
|
+
switch (event.tag) {
|
|
988
|
+
case 1: {
|
|
989
|
+
if (event.fields[1][0].tag === 1) {
|
|
990
|
+
if (event.fields[1][1].tag === 1) {
|
|
991
|
+
matchResult = 1;
|
|
992
|
+
kind_1 = event.fields[0];
|
|
993
|
+
x_3 = event.fields[1][0].fields[0].fields[0];
|
|
994
|
+
y_3 = event.fields[1][1].fields[0].fields[0];
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
matchResult = 2;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
else {
|
|
1001
|
+
matchResult = 2;
|
|
1002
|
+
}
|
|
1003
|
+
break;
|
|
1004
|
+
}
|
|
1005
|
+
case 2: {
|
|
1006
|
+
matchResult = 3;
|
|
1007
|
+
break;
|
|
1008
|
+
}
|
|
1009
|
+
case 3: {
|
|
1010
|
+
matchResult = 4;
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
default:
|
|
1014
|
+
if (event.fields[1][0].tag === 1) {
|
|
1015
|
+
if (event.fields[1][1].tag === 1) {
|
|
1016
|
+
matchResult = 0;
|
|
1017
|
+
kind = event.fields[0];
|
|
1018
|
+
x = event.fields[1][0].fields[0].fields[0];
|
|
1019
|
+
y = event.fields[1][1].fields[0].fields[0];
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
matchResult = 2;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
else {
|
|
1026
|
+
matchResult = 2;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
switch (matchResult) {
|
|
1030
|
+
case 0:
|
|
1031
|
+
return new Events_InteractiveEvent(0, [kind, Projections_projectInv(area[0], area[1], area[2], area[3], scales[0], scales[1], x, y)]);
|
|
1032
|
+
case 1:
|
|
1033
|
+
return new Events_InteractiveEvent(1, [kind_1, Projections_projectInv(area[0], area[1], area[2], area[3], scales[0], scales[1], x_3, y_3)]);
|
|
1034
|
+
case 2:
|
|
1035
|
+
throw new Error("TODO: projectEvent - not continuous");
|
|
1036
|
+
case 3:
|
|
1037
|
+
return new Events_InteractiveEvent(2, []);
|
|
1038
|
+
default:
|
|
1039
|
+
return new Events_InteractiveEvent(3, []);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
export function Events_inScale(s, v) {
|
|
1044
|
+
if (s.tag === 1) {
|
|
1045
|
+
if (v.tag === 1) {
|
|
1046
|
+
throw new Error("inScale: Cannot test if continuous value is in categorical scale");
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
return exists((y) => equals(v.fields[0], y), s.fields[0]);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
else if (v.tag === 0) {
|
|
1053
|
+
throw new Error("inScale: Cannot test if categorical value is in continuous scale");
|
|
1054
|
+
}
|
|
1055
|
+
else if (v.fields[0].fields[0] >= min(s.fields[0].fields[0], s.fields[1].fields[0])) {
|
|
1056
|
+
return v.fields[0].fields[0] <= max(s.fields[0].fields[0], s.fields[1].fields[0]);
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
return false;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
export function Events_inScales(sx, sy, event) {
|
|
1064
|
+
let matchResult, x, y;
|
|
1065
|
+
switch (event.tag) {
|
|
1066
|
+
case 2: {
|
|
1067
|
+
matchResult = 1;
|
|
1068
|
+
break;
|
|
1069
|
+
}
|
|
1070
|
+
case 0: {
|
|
1071
|
+
matchResult = 2;
|
|
1072
|
+
x = event.fields[1][0];
|
|
1073
|
+
y = event.fields[1][1];
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
case 1: {
|
|
1077
|
+
matchResult = 2;
|
|
1078
|
+
x = event.fields[1][0];
|
|
1079
|
+
y = event.fields[1][1];
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
default:
|
|
1083
|
+
matchResult = 0;
|
|
1084
|
+
}
|
|
1085
|
+
switch (matchResult) {
|
|
1086
|
+
case 0:
|
|
1087
|
+
return true;
|
|
1088
|
+
case 1:
|
|
1089
|
+
return true;
|
|
1090
|
+
default:
|
|
1091
|
+
if (Events_inScale(sx, x)) {
|
|
1092
|
+
return Events_inScale(sy, y);
|
|
1093
|
+
}
|
|
1094
|
+
else {
|
|
1095
|
+
return false;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
export function Events_triggerEvent(area__mut, area__1_mut, area__2_mut, area__3_mut, scales__mut, scales__1_mut, shape_mut, jse_mut, event_mut) {
|
|
1101
|
+
Events_triggerEvent:
|
|
1102
|
+
while (true) {
|
|
1103
|
+
const area_ = area__mut, area__1 = area__1_mut, area__2 = area__2_mut, area__3 = area__3_mut, scales_ = scales__mut, scales__1 = scales__1_mut, shape = shape_mut, jse = jse_mut, event = event_mut;
|
|
1104
|
+
const area_1 = [area_, area__1, area__2, area__3];
|
|
1105
|
+
const y2 = area_1[3];
|
|
1106
|
+
const y1 = area_1[1];
|
|
1107
|
+
const x2 = area_1[2];
|
|
1108
|
+
const x1 = area_1[0];
|
|
1109
|
+
const scales_1 = [scales_, scales__1];
|
|
1110
|
+
const sy = scales_1[1];
|
|
1111
|
+
const sx = scales_1[0];
|
|
1112
|
+
switch (shape.tag) {
|
|
1113
|
+
case 0: {
|
|
1114
|
+
area__mut = area_1[0];
|
|
1115
|
+
area__1_mut = area_1[1];
|
|
1116
|
+
area__2_mut = area_1[2];
|
|
1117
|
+
area__3_mut = area_1[3];
|
|
1118
|
+
scales__mut = scales_1[0];
|
|
1119
|
+
scales__1_mut = scales_1[1];
|
|
1120
|
+
shape_mut = shape.fields[1];
|
|
1121
|
+
jse_mut = jse;
|
|
1122
|
+
event_mut = event;
|
|
1123
|
+
continue Events_triggerEvent;
|
|
1124
|
+
break;
|
|
1125
|
+
}
|
|
1126
|
+
case 8: {
|
|
1127
|
+
const dy = shape.fields[0][1];
|
|
1128
|
+
const dx = shape.fields[0][0];
|
|
1129
|
+
area__mut = (x1 + dx);
|
|
1130
|
+
area__1_mut = (y1 + dy);
|
|
1131
|
+
area__2_mut = (x2 + dx);
|
|
1132
|
+
area__3_mut = (y2 + dy);
|
|
1133
|
+
scales__mut = scales_1[0];
|
|
1134
|
+
scales__1_mut = scales_1[1];
|
|
1135
|
+
shape_mut = shape.fields[1];
|
|
1136
|
+
jse_mut = jse;
|
|
1137
|
+
event_mut = event;
|
|
1138
|
+
continue Events_triggerEvent;
|
|
1139
|
+
break;
|
|
1140
|
+
}
|
|
1141
|
+
case 9: {
|
|
1142
|
+
area__mut = Projections_projectOneX(x1, x2)(sx)(shape.fields[0]);
|
|
1143
|
+
area__1_mut = y1;
|
|
1144
|
+
area__2_mut = Projections_projectOneX(x1, x2)(sx)(shape.fields[1]);
|
|
1145
|
+
area__3_mut = y2;
|
|
1146
|
+
scales__mut = shape.fields[2];
|
|
1147
|
+
scales__1_mut = sy;
|
|
1148
|
+
shape_mut = shape.fields[3];
|
|
1149
|
+
jse_mut = jse;
|
|
1150
|
+
event_mut = event;
|
|
1151
|
+
continue Events_triggerEvent;
|
|
1152
|
+
break;
|
|
1153
|
+
}
|
|
1154
|
+
case 10: {
|
|
1155
|
+
area__mut = x1;
|
|
1156
|
+
area__1_mut = Projections_projectOneY(y1, y2)(sy)(shape.fields[0]);
|
|
1157
|
+
area__2_mut = x2;
|
|
1158
|
+
area__3_mut = Projections_projectOneY(y1, y2)(sy)(shape.fields[1]);
|
|
1159
|
+
scales__mut = sx;
|
|
1160
|
+
scales__1_mut = shape.fields[2];
|
|
1161
|
+
shape_mut = shape.fields[3];
|
|
1162
|
+
jse_mut = jse;
|
|
1163
|
+
event_mut = event;
|
|
1164
|
+
continue Events_triggerEvent;
|
|
1165
|
+
break;
|
|
1166
|
+
}
|
|
1167
|
+
case 7: {
|
|
1168
|
+
const isy_1 = shape.fields[2];
|
|
1169
|
+
const isx_1 = shape.fields[1];
|
|
1170
|
+
const calculateNestedRange = (rev) => ((tupledArg) => ((ins) => {
|
|
1171
|
+
const v1 = tupledArg[0];
|
|
1172
|
+
const v2 = tupledArg[1];
|
|
1173
|
+
return (outs) => {
|
|
1174
|
+
if (ins.tag === 1) {
|
|
1175
|
+
const pos_1 = collect((v) => ofArray([Projections_projectOne(rev, v1, v2, outs, new Value(0, [v, 0])), Projections_projectOne(rev, v1, v2, outs, new Value(0, [v, 1]))]), ins.fields[0]);
|
|
1176
|
+
return [min_3(pos_1, {
|
|
1177
|
+
Compare: comparePrimitives,
|
|
1178
|
+
}), max_3(pos_1, {
|
|
1179
|
+
Compare: comparePrimitives,
|
|
1180
|
+
})];
|
|
1181
|
+
}
|
|
1182
|
+
else {
|
|
1183
|
+
const pos = ofArray([Projections_projectOne(rev, v1, v2, outs, new Value(1, [new continuous(ins.fields[0].fields[0])])), Projections_projectOne(rev, v1, v2, outs, new Value(1, [new continuous(ins.fields[1].fields[0])]))]);
|
|
1184
|
+
return [min_3(pos, {
|
|
1185
|
+
Compare: comparePrimitives,
|
|
1186
|
+
}), max_3(pos, {
|
|
1187
|
+
Compare: comparePrimitives,
|
|
1188
|
+
})];
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
}));
|
|
1192
|
+
const patternInput = calculateNestedRange(false)([x1, x2])(isx_1)(sx);
|
|
1193
|
+
const patternInput_1 = calculateNestedRange(true)([y1, y2])(isy_1)(sy);
|
|
1194
|
+
area__mut = (patternInput[0] + shape.fields[0][3]);
|
|
1195
|
+
area__1_mut = (patternInput_1[0] + shape.fields[0][0]);
|
|
1196
|
+
area__2_mut = (patternInput[1] - shape.fields[0][1]);
|
|
1197
|
+
area__3_mut = (patternInput_1[1] - shape.fields[0][2]);
|
|
1198
|
+
scales__mut = isx_1;
|
|
1199
|
+
scales__1_mut = isy_1;
|
|
1200
|
+
shape_mut = shape.fields[3];
|
|
1201
|
+
jse_mut = jse;
|
|
1202
|
+
event_mut = event;
|
|
1203
|
+
continue Events_triggerEvent;
|
|
1204
|
+
break;
|
|
1205
|
+
}
|
|
1206
|
+
case 5: {
|
|
1207
|
+
const shapes = shape.fields[0];
|
|
1208
|
+
for (let idx = 0; idx <= (shapes.length - 1); idx++) {
|
|
1209
|
+
Events_triggerEvent(area_1[0], area_1[1], area_1[2], area_1[3], scales_1[0], scales_1[1], item_2(idx, shapes), jse, event);
|
|
1210
|
+
}
|
|
1211
|
+
break;
|
|
1212
|
+
}
|
|
1213
|
+
case 6: {
|
|
1214
|
+
const localEvent = Events_projectEvent(area_1[0], area_1[1], area_1[2], area_1[3], scales_1[0], scales_1[1], event);
|
|
1215
|
+
if (Events_inScales(scales_1[0], scales_1[1], localEvent)) {
|
|
1216
|
+
const enumerator = getEnumerator(shape.fields[0]);
|
|
1217
|
+
try {
|
|
1218
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
1219
|
+
const handler = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
1220
|
+
let matchResult, f, pt, f_1, pt_1, f_2, f_3;
|
|
1221
|
+
switch (localEvent.tag) {
|
|
1222
|
+
case 1: {
|
|
1223
|
+
if (localEvent.fields[0].tag === 1) {
|
|
1224
|
+
if (handler.tag === 4) {
|
|
1225
|
+
matchResult = 1;
|
|
1226
|
+
f_1 = curry2(handler.fields[0]);
|
|
1227
|
+
pt_1 = localEvent.fields[1];
|
|
1228
|
+
}
|
|
1229
|
+
else {
|
|
1230
|
+
matchResult = 4;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
else if (handler.tag === 5) {
|
|
1234
|
+
matchResult = 1;
|
|
1235
|
+
f_1 = curry2(handler.fields[0]);
|
|
1236
|
+
pt_1 = localEvent.fields[1];
|
|
1237
|
+
}
|
|
1238
|
+
else {
|
|
1239
|
+
matchResult = 4;
|
|
1240
|
+
}
|
|
1241
|
+
break;
|
|
1242
|
+
}
|
|
1243
|
+
case 2: {
|
|
1244
|
+
if (handler.tag === 6) {
|
|
1245
|
+
matchResult = 2;
|
|
1246
|
+
f_2 = handler.fields[0];
|
|
1247
|
+
}
|
|
1248
|
+
else {
|
|
1249
|
+
matchResult = 4;
|
|
1250
|
+
}
|
|
1251
|
+
break;
|
|
1252
|
+
}
|
|
1253
|
+
case 3: {
|
|
1254
|
+
if (handler.tag === 7) {
|
|
1255
|
+
matchResult = 3;
|
|
1256
|
+
f_3 = handler.fields[0];
|
|
1257
|
+
}
|
|
1258
|
+
else {
|
|
1259
|
+
matchResult = 4;
|
|
1260
|
+
}
|
|
1261
|
+
break;
|
|
1262
|
+
}
|
|
1263
|
+
default:
|
|
1264
|
+
switch (localEvent.fields[0].tag) {
|
|
1265
|
+
case 1: {
|
|
1266
|
+
if (handler.tag === 0) {
|
|
1267
|
+
matchResult = 0;
|
|
1268
|
+
f = curry2(handler.fields[0]);
|
|
1269
|
+
pt = localEvent.fields[1];
|
|
1270
|
+
}
|
|
1271
|
+
else {
|
|
1272
|
+
matchResult = 4;
|
|
1273
|
+
}
|
|
1274
|
+
break;
|
|
1275
|
+
}
|
|
1276
|
+
case 2: {
|
|
1277
|
+
if (handler.tag === 1) {
|
|
1278
|
+
matchResult = 0;
|
|
1279
|
+
f = curry2(handler.fields[0]);
|
|
1280
|
+
pt = localEvent.fields[1];
|
|
1281
|
+
}
|
|
1282
|
+
else {
|
|
1283
|
+
matchResult = 4;
|
|
1284
|
+
}
|
|
1285
|
+
break;
|
|
1286
|
+
}
|
|
1287
|
+
case 3: {
|
|
1288
|
+
if (handler.tag === 2) {
|
|
1289
|
+
matchResult = 0;
|
|
1290
|
+
f = curry2(handler.fields[0]);
|
|
1291
|
+
pt = localEvent.fields[1];
|
|
1292
|
+
}
|
|
1293
|
+
else {
|
|
1294
|
+
matchResult = 4;
|
|
1295
|
+
}
|
|
1296
|
+
break;
|
|
1297
|
+
}
|
|
1298
|
+
default:
|
|
1299
|
+
if (handler.tag === 3) {
|
|
1300
|
+
matchResult = 0;
|
|
1301
|
+
f = curry2(handler.fields[0]);
|
|
1302
|
+
pt = localEvent.fields[1];
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
matchResult = 4;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
switch (matchResult) {
|
|
1310
|
+
case 0: {
|
|
1311
|
+
if (!equals(jse, defaultOf())) {
|
|
1312
|
+
jse.preventDefault();
|
|
1313
|
+
}
|
|
1314
|
+
f(jse)(pt);
|
|
1315
|
+
break;
|
|
1316
|
+
}
|
|
1317
|
+
case 1: {
|
|
1318
|
+
if (!equals(jse, defaultOf())) {
|
|
1319
|
+
jse.preventDefault();
|
|
1320
|
+
}
|
|
1321
|
+
f_1(jse)(pt_1);
|
|
1322
|
+
break;
|
|
1323
|
+
}
|
|
1324
|
+
case 2: {
|
|
1325
|
+
f_2(jse);
|
|
1326
|
+
break;
|
|
1327
|
+
}
|
|
1328
|
+
case 3: {
|
|
1329
|
+
f_3(jse);
|
|
1330
|
+
break;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
finally {
|
|
1336
|
+
disposeSafe(enumerator);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
area__mut = area_1[0];
|
|
1340
|
+
area__1_mut = area_1[1];
|
|
1341
|
+
area__2_mut = area_1[2];
|
|
1342
|
+
area__3_mut = area_1[3];
|
|
1343
|
+
scales__mut = scales_1[0];
|
|
1344
|
+
scales__1_mut = scales_1[1];
|
|
1345
|
+
shape_mut = shape.fields[3];
|
|
1346
|
+
jse_mut = jse;
|
|
1347
|
+
event_mut = event;
|
|
1348
|
+
continue Events_triggerEvent;
|
|
1349
|
+
break;
|
|
1350
|
+
}
|
|
1351
|
+
default:
|
|
1352
|
+
undefined;
|
|
1353
|
+
}
|
|
1354
|
+
break;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
export function Derived_StrokeColor(clr, s) {
|
|
1359
|
+
return new Shape(0, [(s_1) => (new Style([1, new Color(1, [clr])], s_1.StrokeWidth, s_1.StrokeDashArray, s_1.Fill, s_1.Animation, s_1.Font, s_1.Cursor, s_1.FormatAxisXLabel, s_1.FormatAxisYLabel)), s]);
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
export function Derived_FillColor(clr, s) {
|
|
1363
|
+
return new Shape(0, [(s_1) => (new Style(s_1.StrokeColor, s_1.StrokeWidth, s_1.StrokeDashArray, new FillStyle(0, [[1, new Color(1, [clr])]]), s_1.Animation, s_1.Font, s_1.Cursor, s_1.FormatAxisXLabel, s_1.FormatAxisYLabel)), s]);
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
export function Derived_Font(font, clr, s) {
|
|
1367
|
+
return new Shape(0, [(s_1) => (new Style([0, new Color(1, [clr])], s_1.StrokeWidth, s_1.StrokeDashArray, new FillStyle(0, [[1, new Color(1, [clr])]]), s_1.Animation, font, s_1.Cursor, s_1.FormatAxisXLabel, s_1.FormatAxisYLabel)), s]);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
export function Derived_Area(line) {
|
|
1371
|
+
return new Shape(8, [delay(() => {
|
|
1372
|
+
const line_1 = Array.from(line);
|
|
1373
|
+
const matchValue = item_2(0, line_1)[0];
|
|
1374
|
+
const matchValue_1 = item_2(line_1.length - 1, line_1)[0];
|
|
1375
|
+
const firstX = matchValue;
|
|
1376
|
+
return append(singleton([firstX, new Value(1, [new continuous(0)])]), delay(() => append(line_1, delay(() => append(singleton([matchValue_1, new Value(1, [new continuous(0)])]), delay(() => singleton([firstX, new Value(1, [new continuous(0)])])))))));
|
|
1377
|
+
})]);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
export function Derived_VArea(line) {
|
|
1381
|
+
return new Shape(8, [delay(() => {
|
|
1382
|
+
const line_1 = Array.from(line);
|
|
1383
|
+
const matchValue = item_2(0, line_1)[1];
|
|
1384
|
+
const matchValue_1 = item_2(line_1.length - 1, line_1)[1];
|
|
1385
|
+
const firstY = matchValue;
|
|
1386
|
+
return append(singleton([new Value(1, [new continuous(0)]), firstY]), delay(() => append(line_1, delay(() => append(singleton([new Value(1, [new continuous(0)]), matchValue_1]), delay(() => singleton([new Value(1, [new continuous(0)]), firstY])))))));
|
|
1387
|
+
})]);
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
export function Derived_VShiftedArea(offs, line) {
|
|
1391
|
+
return new Shape(8, [delay(() => {
|
|
1392
|
+
const line_1 = Array.from(line);
|
|
1393
|
+
const matchValue = item_2(0, line_1)[1];
|
|
1394
|
+
const matchValue_1 = item_2(line_1.length - 1, line_1)[1];
|
|
1395
|
+
const firstY = matchValue;
|
|
1396
|
+
return append(singleton([new Value(1, [new continuous(offs)]), firstY]), delay(() => append(line_1, delay(() => append(singleton([new Value(1, [new continuous(offs)]), matchValue_1]), delay(() => singleton([new Value(1, [new continuous(offs)]), firstY])))))));
|
|
1397
|
+
})]);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
export function Derived_Bar(x, y) {
|
|
1401
|
+
return new Shape(8, [delay(() => append(singleton([new Value(1, [x]), new Value(0, [y, 0])]), delay(() => append(singleton([new Value(1, [x]), new Value(0, [y, 1])]), delay(() => append(singleton([new Value(1, [new continuous(0)]), new Value(0, [y, 1])]), delay(() => singleton([new Value(1, [new continuous(0)]), new Value(0, [y, 0])]))))))))]);
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
export function Derived_Column(x, y) {
|
|
1405
|
+
return new Shape(8, [delay(() => append(singleton([new Value(0, [x, 0]), new Value(1, [y])]), delay(() => append(singleton([new Value(0, [x, 1]), new Value(1, [y])]), delay(() => append(singleton([new Value(0, [x, 1]), new Value(1, [new continuous(0)])]), delay(() => singleton([new Value(0, [x, 0]), new Value(1, [new continuous(0)])]))))))))]);
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
export function Compost_niceNumber(num, decs) {
|
|
1409
|
+
const str = toString(num);
|
|
1410
|
+
const dot = str.indexOf(".") | 0;
|
|
1411
|
+
const patternInput = (dot === -1) ? [str, ""] : [substring(str, 0, dot), substring(str, dot + 1, min(decs, (str.length - dot) - 1))];
|
|
1412
|
+
const before = patternInput[0];
|
|
1413
|
+
const after = patternInput[1];
|
|
1414
|
+
const after_1 = (after.length < decs) ? (after + (toArray(delay(() => map_1((i) => "0", rangeDouble(1, 1, decs - after.length)))).join(''))) : after;
|
|
1415
|
+
let res = before;
|
|
1416
|
+
if (before.length > 5) {
|
|
1417
|
+
const enumerator = getEnumerator(rangeDouble(before.length - 1, -1, 0));
|
|
1418
|
+
try {
|
|
1419
|
+
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
1420
|
+
const i_1 = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]() | 0;
|
|
1421
|
+
if ((i_1 !== 0) && (((before.length - i_1) % 3) === 0)) {
|
|
1422
|
+
res = insert(res, i_1, ",");
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
finally {
|
|
1427
|
+
disposeSafe(enumerator);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
if (forAll((y) => ("0" === y), after_1.split(""))) {
|
|
1431
|
+
return res;
|
|
1432
|
+
}
|
|
1433
|
+
else {
|
|
1434
|
+
return (res + ".") + after_1;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
export function Compost_defaultFormat(scale, value) {
|
|
1439
|
+
if (value.tag === 1) {
|
|
1440
|
+
const dec = (scale.tag === 0) ? Scales_decimalPoints(scale.fields[0].fields[0], scale.fields[1].fields[0]) : 0;
|
|
1441
|
+
return Compost_niceNumber(round(value.fields[0].fields[0], ~~dec), ~~dec);
|
|
1442
|
+
}
|
|
1443
|
+
else {
|
|
1444
|
+
return value.fields[0].fields[0];
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
export const Compost_defstyle = new Style([1, new Color(0, [256, 0, 0])], new Width(2), [], new FillStyle(0, [[1, new Color(0, [196, 196, 196])]]), undefined, "10pt sans-serif", "default", Compost_defaultFormat, Compost_defaultFormat);
|
|
1449
|
+
|
|
1450
|
+
export function Compost_getRelativeLocation(el, x, y) {
|
|
1451
|
+
const getOffset = (parent_mut, tupledArg_mut) => {
|
|
1452
|
+
getOffset:
|
|
1453
|
+
while (true) {
|
|
1454
|
+
const parent = parent_mut, tupledArg = tupledArg_mut;
|
|
1455
|
+
const x_1 = tupledArg[0];
|
|
1456
|
+
const y_1 = tupledArg[1];
|
|
1457
|
+
if (equals(parent, defaultOf())) {
|
|
1458
|
+
return [x_1, y_1];
|
|
1459
|
+
}
|
|
1460
|
+
else {
|
|
1461
|
+
parent_mut = parent.offsetParent;
|
|
1462
|
+
tupledArg_mut = [x_1 - parent.offsetLeft, y_1 - parent.offsetTop];
|
|
1463
|
+
continue getOffset;
|
|
1464
|
+
}
|
|
1465
|
+
break;
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
const getParent = (parent_1_mut) => {
|
|
1469
|
+
getParent:
|
|
1470
|
+
while (true) {
|
|
1471
|
+
const parent_1 = parent_1_mut;
|
|
1472
|
+
if ((parent_1.namespaceURI === "http://www.w3.org/2000/svg") && (parent_1.tagName !== "svg")) {
|
|
1473
|
+
if (!equals(parent_1.parentElement, defaultOf())) {
|
|
1474
|
+
parent_1_mut = parent_1.parentElement;
|
|
1475
|
+
continue getParent;
|
|
1476
|
+
}
|
|
1477
|
+
else {
|
|
1478
|
+
parent_1_mut = parent_1.parentNode;
|
|
1479
|
+
continue getParent;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
else if (!equals(parent_1.offsetParent, defaultOf())) {
|
|
1483
|
+
return parent_1;
|
|
1484
|
+
}
|
|
1485
|
+
else if (!equals(parent_1.parentElement, defaultOf())) {
|
|
1486
|
+
parent_1_mut = parent_1.parentElement;
|
|
1487
|
+
continue getParent;
|
|
1488
|
+
}
|
|
1489
|
+
else {
|
|
1490
|
+
parent_1_mut = parent_1.parentNode;
|
|
1491
|
+
continue getParent;
|
|
1492
|
+
}
|
|
1493
|
+
break;
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
return getOffset(getParent(el), [x, y]);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
export function Compost_createSvg(revX, revY, width, height, viz) {
|
|
1500
|
+
const patternInput = Scales_calculateScales(Compost_defstyle, viz);
|
|
1501
|
+
const sy = patternInput[0][1];
|
|
1502
|
+
const sx = patternInput[0][0];
|
|
1503
|
+
const shape = patternInput[1];
|
|
1504
|
+
const defs = [];
|
|
1505
|
+
const area = [0, 0, width, height];
|
|
1506
|
+
const svg = Drawing_drawShape(new Drawing_DrawingContext(Compost_defstyle, defs), area[0], area[1], area[2], area[3], sx, sy, shape);
|
|
1507
|
+
const triggerEvent = (e, event) => {
|
|
1508
|
+
Events_triggerEvent(area[0], area[1], area[2], area[3], sx, sy, shape, e, event);
|
|
1509
|
+
};
|
|
1510
|
+
const mouseHandler = (kind, el, evt) => {
|
|
1511
|
+
const evt_1 = evt;
|
|
1512
|
+
const patternInput_1 = Compost_getRelativeLocation(el, evt_1.pageX, evt_1.pageY);
|
|
1513
|
+
triggerEvent(evt_1, new Events_InteractiveEvent(0, [kind, [new Value(1, [new continuous(patternInput_1[0])]), new Value(1, [new continuous(patternInput_1[1])])]]));
|
|
1514
|
+
};
|
|
1515
|
+
const touchHandler = (kind_1, el_1, evt_2) => {
|
|
1516
|
+
const evt_3 = evt_2;
|
|
1517
|
+
const touch = item_2(0, evt_3.touches);
|
|
1518
|
+
const patternInput_2 = Compost_getRelativeLocation(el_1, touch.pageX, touch.pageY);
|
|
1519
|
+
triggerEvent(evt_3, new Events_InteractiveEvent(1, [kind_1, [new Value(1, [new continuous(patternInput_2[0])]), new Value(1, [new continuous(patternInput_2[1])])]]));
|
|
1520
|
+
};
|
|
1521
|
+
return El_op_Dynamic_Z451691CD(h_2, "div")(empty())(singleton_1(El_op_Dynamic_Z451691CD(s_6, "svg")(ofArray([op_EqualsGreater("style", "overflow:visible"), op_EqualsGreater("width", int32ToString(~~width)), op_EqualsGreater("height", int32ToString(~~height)), op_EqualsBangGreater("click", uncurry2(curry3(mouseHandler)(new Events_MouseEventKind(0, [])))), op_EqualsBangGreater("mousemove", uncurry2(curry3(mouseHandler)(new Events_MouseEventKind(1, [])))), op_EqualsBangGreater("mousedown", uncurry2(curry3(mouseHandler)(new Events_MouseEventKind(3, [])))), op_EqualsBangGreater("mouseup", uncurry2(curry3(mouseHandler)(new Events_MouseEventKind(2, [])))), op_EqualsBangGreater("mouseleave", (_arg, evt_4) => {
|
|
1522
|
+
triggerEvent(evt_4, new Events_InteractiveEvent(3, []));
|
|
1523
|
+
}), op_EqualsBangGreater("touchmove", uncurry2(curry3(touchHandler)(new Events_TouchEventKind(0, [])))), op_EqualsBangGreater("touchstart", uncurry2(curry3(touchHandler)(new Events_TouchEventKind(1, [])))), op_EqualsBangGreater("touchend", (_arg_1, evt_5) => {
|
|
1524
|
+
triggerEvent(evt_5, new Events_InteractiveEvent(2, []));
|
|
1525
|
+
})]))(toList(delay(() => {
|
|
1526
|
+
const body = Array.from(Svg_renderSvg(new Svg_RenderingContext(defs), svg));
|
|
1527
|
+
return append(defs, delay(() => body));
|
|
1528
|
+
})))));
|
|
1529
|
+
}
|
|
1530
|
+
|