@pie-element/graphing 3.7.9 → 3.7.10-beta.1443

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.
@@ -72,6 +72,22 @@ Additional restrictions:
72
72
 
73
73
  Indicates if coordinates of a point are displayed on hover
74
74
 
75
+ # `defaultTool` (string, enum, required)
76
+
77
+ Indicates the default selected tool for the graph
78
+
79
+ This element must be one of the following enum values:
80
+
81
+ * `circle`
82
+ * `line`
83
+ * `parabola`
84
+ * `point`
85
+ * `polygon`
86
+ * `ray`
87
+ * `segment`
88
+ * `sine`
89
+ * `vector`
90
+
75
91
  # `domain` (object, required)
76
92
 
77
93
  Properties of the `domain` object:
@@ -112,6 +128,10 @@ Width for graph representation
112
128
 
113
129
  Height for graph representation
114
130
 
131
+ # `includeAxes` (boolean)
132
+
133
+ Indicates if the graph axes and labels are enabled
134
+
115
135
  # `labels` (object)
116
136
 
117
137
  Properties of the `labels` object:
@@ -197,6 +217,14 @@ Indicates teacher instructions
197
217
 
198
218
  Indicates graph title
199
219
 
220
+ # `labelsEnabled` (boolean)
221
+
222
+ Indicates if the graph labels are displayed
223
+
224
+ # `titleEnabled` (boolean)
225
+
226
+ Indicates if the graph title is displayed
227
+
200
228
  # `toolbarTools` (array)
201
229
 
202
230
  Indicates the tools that have to be displayed in toolbar
@@ -209,6 +237,14 @@ Additional restrictions:
209
237
 
210
238
  Indicates if Rationale are enabled
211
239
 
240
+ # `spellCheckEnabled` (boolean, required)
241
+
242
+ Indicates if spellcheck is enabled for the author. Default value is true
243
+
244
+ # `standardGrid` (boolean)
245
+
246
+ Indicates if some domain values will be synched to the range values
247
+
212
248
  # `studentInstructionsEnabled` (boolean, required)
213
249
 
214
250
  Indicates if Student Instructions are enabled
@@ -217,6 +253,10 @@ Indicates if Student Instructions are enabled
217
253
 
218
254
  Indicates if Teacher Instructions are enabled
219
255
 
256
+ # `rubricEnabled` (boolean, required)
257
+
258
+ Indicates if Rubric is enabled
259
+
220
260
  # `id` (string, required)
221
261
 
222
262
  Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
@@ -231,22 +271,101 @@ The html Element tag name
231
271
 
232
272
  The schema defines the following additional types:
233
273
 
234
- ## `ConfigurePropWithEnabled` (object)
274
+ ## `AuthoringConfigProp` (object)
235
275
 
236
- Properties of the `ConfigurePropWithEnabled` object:
276
+ Properties of the `AuthoringConfigProp` object:
237
277
 
238
278
  ### `settings` (boolean)
239
279
 
240
- Indicates if the item has to be displayed in the Settings Panel
280
+ Indicates if the item is displayed in the Settings Panel
241
281
 
242
282
  ### `label` (string)
243
283
 
244
- Indicates the label for the item that has to be displayed in the Settings Panel
284
+ Indicates the label for the item that is displayed in the Settings Panel
245
285
 
246
286
  ### `enabled` (boolean)
247
287
 
248
- Indicates the value of the item if it affects config-ui
249
- (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
288
+ Indicates if the Grid Setup Panel is displayed
289
+
290
+ ### `includeAxesEnabled` (boolean)
291
+
292
+ Indicates if the "includeAxes" toggle is displayed in the Grid Setup Panel
293
+
294
+ ### `standardGridEnabled` (boolean)
295
+
296
+ Indicates if the "standardGrid" toggle is displayed in the Grid Setup Panel
297
+
298
+ ### `min` (object)
299
+
300
+ Properties of the `min` object:
301
+
302
+ #### `label` (string)
303
+
304
+ Indicates the label for the item that is displayed in the Grid Setup Panel
305
+
306
+ #### `enabled` (boolean)
307
+
308
+ Indicates if the item is displayed in the Grid Setup Panel
309
+
310
+ ### `max` (object)
311
+
312
+ Properties of the `max` object:
313
+
314
+ #### `label` (string)
315
+
316
+ Indicates the label for the item that is displayed in the Grid Setup Panel
317
+
318
+ #### `enabled` (boolean)
319
+
320
+ Indicates if the item is displayed in the Grid Setup Panel
321
+
322
+ ### `axisLabel` (object)
323
+
324
+ Properties of the `axisLabel` object:
325
+
326
+ #### `label` (string)
327
+
328
+ Indicates the label for the item that is displayed in the Grid Setup Panel
329
+
330
+ #### `enabled` (boolean)
331
+
332
+ Indicates if the item is displayed in the Grid Setup Panel
333
+
334
+ ### `step` (object)
335
+
336
+ Properties of the `step` object:
337
+
338
+ #### `label` (string)
339
+
340
+ Indicates the label for the item that is displayed in the Grid Setup Panel
341
+
342
+ #### `enabled` (boolean)
343
+
344
+ Indicates if the item is displayed in the Grid Setup Panel
345
+
346
+ ### `labelStep` (object)
347
+
348
+ Properties of the `labelStep` object:
349
+
350
+ #### `label` (string)
351
+
352
+ Indicates the label for the item that is displayed in the Grid Setup Panel
353
+
354
+ #### `enabled` (boolean)
355
+
356
+ Indicates if the item is displayed in the Grid Setup Panel
357
+
358
+ ## `GridPanelConfigProp` (object)
359
+
360
+ Properties of the `GridPanelConfigProp` object:
361
+
362
+ ### `label` (string)
363
+
364
+ Indicates the label for the item that is displayed in the Grid Setup Panel
365
+
366
+ ### `enabled` (boolean)
367
+
368
+ Indicates if the item is displayed in the Grid Setup Panel
250
369
 
251
370
  ## `ArrowsConfigProp` (object)
252
371
 
@@ -312,157 +431,165 @@ Indicates if the item has to be displayed in the Settings Panel
312
431
 
313
432
  Indicates the label for the item that has to be displayed in the Settings Panel
314
433
 
315
- ## `Answer` (object)
434
+ ## `DimensionsConfigProp` (object)
316
435
 
317
- Properties of the `Answer` object:
436
+ Properties of the `DimensionsConfigProp` object:
318
437
 
319
- ### `name` (string, required)
438
+ ### `settings` (boolean)
320
439
 
321
- Indicates name of answer
440
+ Indicates if the item has to be displayed in the Settings Panel
322
441
 
323
- ### `marks` (array, required)
442
+ ### `label` (string)
324
443
 
325
- Indicates marks for the answer
444
+ Indicates the label for the item that has to be displayed in the Settings Panel
326
445
 
327
- Additional restrictions:
446
+ ### `enabled` (boolean)
328
447
 
329
- * Minimum items: `1`
448
+ Indicates if the graph dimensions are included in the Grid Setup Panel
330
449
 
331
- ## `Mark` (object)
450
+ ### `min` (number)
332
451
 
333
- Properties of the `Mark` object:
452
+ Indicates the minimum value for the graph width and height
334
453
 
335
- ### `type` (string, enum, required)
454
+ ### `max` (number)
336
455
 
337
- Indicates type of mark
456
+ Indicates the maximum value for the graph width and height
338
457
 
339
- This element must be one of the following enum values:
458
+ ### `step` (number)
340
459
 
341
- * `circle`
342
- * `line`
343
- * `parabola`
344
- * `point`
345
- * `polygon`
346
- * `ray`
347
- * `segment`
348
- * `sine`
349
- * `vector`
460
+ Indicates the increase/decrease value for the graph width and height
350
461
 
351
- ### `showLabel` (boolean)
462
+ ## `GridConfigurationsProp` (object)
352
463
 
353
- Indicates if label should be visible
464
+ Properties of the `GridConfigurationsProp` object:
354
465
 
355
466
  ### `label` (string)
356
467
 
357
- Indicates label value for mark
468
+ Indicates the label for the configuration
358
469
 
359
- ### `building` (boolean, required)
470
+ ### `arrows` (object)
360
471
 
361
- Indicates if mark is in build process
472
+ Properties of the `arrows` object:
362
473
 
363
- ### `x` (number)
474
+ #### `left` (boolean, required)
364
475
 
365
- Indicates x coordinate if type is point
476
+ Indicates if left arrow is enabled
366
477
 
367
- ### `y` (number)
478
+ #### `right` (boolean, required)
368
479
 
369
- Indicates y coordinate if type is point
480
+ Indicates if right arrow is enabled
370
481
 
371
- ### `from` (object)
482
+ #### `up` (boolean, required)
372
483
 
373
- Properties of the `from` object:
484
+ Indicates if up arrow is enabled
374
485
 
375
- #### `x` (number, required)
486
+ #### `down` (boolean, required)
376
487
 
377
- Indicates x coordinate
488
+ Indicates if down arrow is enabled
378
489
 
379
- #### `y` (number, required)
490
+ ### `domain` (object, required)
380
491
 
381
- Indicates y coordinate
492
+ Properties of the `domain` object:
382
493
 
383
- ### `to` (object)
494
+ #### `min` (number, required)
384
495
 
385
- Properties of the `to` object:
496
+ Min value
386
497
 
387
- #### `x` (number, required)
498
+ #### `max` (number, required)
388
499
 
389
- Indicates x coordinate
500
+ Max value
390
501
 
391
- #### `y` (number, required)
502
+ #### `padding` (number, required)
392
503
 
393
- Indicates y coordinate
504
+ Padding value
394
505
 
395
- ### `center` (object)
506
+ #### `step` (number, required)
396
507
 
397
- Properties of the `center` object:
508
+ Step value
398
509
 
399
- #### `x` (number, required)
510
+ #### `labelStep` (number, required)
400
511
 
401
- Indicates x coordinate
512
+ Label step value
402
513
 
403
- #### `y` (number, required)
514
+ #### `axisLabel` (string, required)
404
515
 
405
- Indicates y coordinate
516
+ Axis Label
406
517
 
407
- ### `outerPoint` (object)
518
+ ### `graph` (object, required)
408
519
 
409
- Properties of the `outerPoint` object:
520
+ Properties of the `graph` object:
410
521
 
411
- #### `x` (number, required)
522
+ #### `width` (number, required)
412
523
 
413
- Indicates x coordinate
524
+ Width for graph representation
414
525
 
415
- #### `y` (number, required)
526
+ #### `height` (number, required)
416
527
 
417
- Indicates y coordinate
528
+ Height for graph representation
418
529
 
419
- ### `closed` (boolean)
530
+ ### `includeAxes` (boolean)
420
531
 
421
- Indicates if mark is closed if type is polygon, sine
532
+ Indicates if the graph axes and labels are enabled
422
533
 
423
- ### `points` (array)
534
+ ### `labels` (object)
424
535
 
425
- Indicates all mark's points if type is polygon
536
+ Properties of the `labels` object:
426
537
 
427
- Additional restrictions:
538
+ #### `top` (string, required)
428
539
 
429
- * Minimum items: `1`
540
+ Label for top side of the graph
430
541
 
431
- ### `root` (object)
542
+ #### `bottom` (string, required)
432
543
 
433
- Properties of the `root` object:
544
+ Label for bottom side of the graph
434
545
 
435
- #### `x` (number, required)
546
+ #### `left` (string, required)
436
547
 
437
- Indicates x coordinate
548
+ Label for left side of the graph
438
549
 
439
- #### `y` (number, required)
550
+ #### `right` (string, required)
440
551
 
441
- Indicates y coordinate
552
+ Label for right side of the graph
442
553
 
443
- ### `edge` (object)
554
+ ### `padding` (boolean)
444
555
 
445
- Properties of the `edge` object:
556
+ Indicates if padding is enabled
446
557
 
447
- #### `x` (number, required)
558
+ ### `range` (object, required)
448
559
 
449
- Indicates x coordinate
560
+ Properties of the `range` object:
450
561
 
451
- #### `y` (number, required)
562
+ #### `min` (number, required)
452
563
 
453
- Indicates y coordinate
564
+ Min value
454
565
 
455
- ## `Point` (object)
566
+ #### `max` (number, required)
456
567
 
457
- Properties of the `Point` object:
568
+ Max value
458
569
 
459
- ### `x` (number, required)
570
+ #### `padding` (number, required)
460
571
 
461
- Indicates x coordinate
572
+ Padding value
462
573
 
463
- ### `y` (number, required)
574
+ #### `step` (number, required)
464
575
 
465
- Indicates y coordinate
576
+ Step value
577
+
578
+ #### `labelStep` (number, required)
579
+
580
+ Label step value
581
+
582
+ #### `axisLabel` (string, required)
583
+
584
+ Axis Label
585
+
586
+ ### `standardGrid` (boolean)
587
+
588
+ Indicates if some domain values will be synched to the range values
589
+
590
+ ### `title` (string)
591
+
592
+ Indicates graph title
466
593
 
467
594
  ## `Arrows` (object)
468
595
 
@@ -542,4 +669,202 @@ Label for left side of the graph
542
669
 
543
670
  ### `right` (string, required)
544
671
 
545
- Label for right side of the graph
672
+ Label for right side of the graph
673
+
674
+ ## `LabelsConfigProp` (object)
675
+
676
+ Properties of the `LabelsConfigProp` object:
677
+
678
+ ### `top` (string)
679
+
680
+ Indicates the placeholder for the top label
681
+
682
+ ### `right` (string)
683
+
684
+ Indicates the placeholder for the right label
685
+
686
+ ### `bottom` (string)
687
+
688
+ Indicates the placeholder for the bottom label
689
+
690
+ ### `left` (string)
691
+
692
+ Indicates the placeholder for the left label
693
+
694
+ ### `settings` (boolean)
695
+
696
+ Indicates if the item has to be displayed in the Settings Panel
697
+
698
+ ### `label` (string)
699
+
700
+ Indicates the label for the item that has to be displayed in the Settings Panel
701
+
702
+ ### `enabled` (boolean)
703
+
704
+ Indicates the value of the item if it affects config-ui
705
+ (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
706
+
707
+ ## `TitleConfigProp` (object)
708
+
709
+ Properties of the `TitleConfigProp` object:
710
+
711
+ ### `placeholder` (string)
712
+
713
+ Indicates the placeholder for the title label
714
+
715
+ ### `settings` (boolean)
716
+
717
+ Indicates if the item has to be displayed in the Settings Panel
718
+
719
+ ### `label` (string)
720
+
721
+ Indicates the label for the item that has to be displayed in the Settings Panel
722
+
723
+ ### `enabled` (boolean)
724
+
725
+ Indicates the value of the item if it affects config-ui
726
+ (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
727
+
728
+ ## `ConfigureMaxImageDimensionsProp` (object)
729
+
730
+ Properties of the `ConfigureMaxImageDimensionsProp` object:
731
+
732
+ ### `teacherInstructions` (number)
733
+
734
+ Indicates the max dimension for images in teacher instructions
735
+
736
+ ### `prompt` (number)
737
+
738
+ Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
739
+
740
+ ### `rationale` (number)
741
+
742
+ Indicates the max dimension for images in rationale
743
+
744
+ ## `Answer` (object)
745
+
746
+ Properties of the `Answer` object:
747
+
748
+ ### `name` (string, required)
749
+
750
+ Indicates name of answer
751
+
752
+ ### `marks` (array, required)
753
+
754
+ Indicates marks for the answer
755
+
756
+ Additional restrictions:
757
+
758
+ * Minimum items: `1`
759
+
760
+ ## `Mark` (object)
761
+
762
+ Properties of the `Mark` object:
763
+
764
+ ### `type` (string, enum, required)
765
+
766
+ Indicates type of mark
767
+
768
+ This element must be one of the following enum values:
769
+
770
+ * `circle`
771
+ * `line`
772
+ * `parabola`
773
+ * `point`
774
+ * `polygon`
775
+ * `ray`
776
+ * `segment`
777
+ * `sine`
778
+ * `vector`
779
+
780
+ ### `showLabel` (boolean)
781
+
782
+ Indicates if label should be visible
783
+
784
+ ### `label` (string)
785
+
786
+ Indicates label value for mark
787
+
788
+ ### `building` (boolean, required)
789
+
790
+ Indicates if mark is in build process
791
+
792
+ ### `x` (number)
793
+
794
+ Indicates x coordinate if type is point
795
+
796
+ ### `y` (number)
797
+
798
+ Indicates y coordinate if type is point
799
+
800
+ ### `from` (object)
801
+
802
+ Properties of the `from` object:
803
+
804
+ #### `x` (number, required)
805
+
806
+ Indicates x coordinate
807
+
808
+ #### `y` (number, required)
809
+
810
+ Indicates y coordinate
811
+
812
+ ### `to` (object)
813
+
814
+ Properties of the `to` object:
815
+
816
+ #### `x` (number, required)
817
+
818
+ Indicates x coordinate
819
+
820
+ #### `y` (number, required)
821
+
822
+ Indicates y coordinate
823
+
824
+ ### `closed` (boolean)
825
+
826
+ Indicates if mark is closed if type is polygon, sine
827
+
828
+ ### `points` (array)
829
+
830
+ Indicates all mark's points if type is polygon
831
+
832
+ Additional restrictions:
833
+
834
+ * Minimum items: `1`
835
+
836
+ ### `root` (object)
837
+
838
+ Properties of the `root` object:
839
+
840
+ #### `x` (number, required)
841
+
842
+ Indicates x coordinate
843
+
844
+ #### `y` (number, required)
845
+
846
+ Indicates y coordinate
847
+
848
+ ### `edge` (object)
849
+
850
+ Properties of the `edge` object:
851
+
852
+ #### `x` (number, required)
853
+
854
+ Indicates x coordinate
855
+
856
+ #### `y` (number, required)
857
+
858
+ Indicates y coordinate
859
+
860
+ ## `Point` (object)
861
+
862
+ Properties of the `Point` object:
863
+
864
+ ### `x` (number, required)
865
+
866
+ Indicates x coordinate
867
+
868
+ ### `y` (number, required)
869
+
870
+ Indicates y coordinate
package/lib/index.js CHANGED
@@ -77,6 +77,9 @@ var Graphing = /*#__PURE__*/function (_HTMLElement) {
77
77
  }
78
78
  }, {
79
79
  key: "session",
80
+ get: function get() {
81
+ return this._session;
82
+ },
80
83
  set: function set(s) {
81
84
  this._session = s;
82
85
 
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["Graphing","answer","Array","isArray","length","_session","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","isComplete","_render","m","_model","s","el","React","createElement","Main","model","session","onAnswersChange","changeAnswers","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;IAIqBA,Q;;;;;AACnB,sBAAc;AAAA;;AAAA;AACZ;AADY,mGAkBD,UAAAC,MAAM;AAAA,aAAIC,KAAK,CAACC,OAAN,CAAcF,MAAd,KAAyBA,MAAM,CAACG,MAAP,GAAgB,CAA7C;AAAA,KAlBL;AAAA,sGAoBE,UAAAH,MAAM,EAAI;AACxB,YAAKI,QAAL,CAAcJ,MAAd,GAAuB,iCAAqBA,MAArB,CAAvB;;AAEA,YAAKK,aAAL,CACE,IAAIC,oCAAJ,CACE,MAAKC,OAAL,CAAaC,WAAb,EADF,EAEE,MAAKC,UAAL,CAAgB,MAAKL,QAAL,CAAcJ,MAA9B,CAFF,CADF;;AAOA,YAAKU,OAAL;AACD,KA/Ba;AAAA;AAEb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;;AACA,WAAKD,OAAL;AACD;;;SAED,aAAYG,CAAZ,EAAe;AACb,WAAKT,QAAL,GAAgBS,CAAhB;;AACA,WAAKH,OAAL;AACD;;;WAED,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;WAiBD,mBAAU;AAAA;;AACR,UAAI,CAAC,KAAKE,MAAN,IAAgB,CAAC,KAAKR,QAA1B,EAAoC;AAClC;AACD;;AAED,UAAMU,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,QAAAA,KAAK,EAAE,KAAKN,MADuB;AAEnCO,QAAAA,OAAO,EAAE,KAAKf,QAFqB;AAGnCgB,QAAAA,eAAe,EAAE,KAAKC;AAHa,OAA1B,CAAX;;AAMAC,2BAASC,MAAT,CAAgBT,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,uCAAW,MAAX;AACD,OAFD;AAGD;;;kDAhDmCU,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nimport { removeInvalidAnswers } from './utils';\nimport Main from './main';\n\nexport { Main as Component };\n\nexport default class Graphing extends HTMLElement {\n constructor() {\n super();\n }\n\n set model(m) {\n this._model = m;\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n connectedCallback() {\n this._render();\n }\n\n isComplete = answer => Array.isArray(answer) && answer.length > 0;\n\n changeAnswers = answer => {\n this._session.answer = removeInvalidAnswers(answer);\n\n this.dispatchEvent(\n new SessionChangedEvent(\n this.tagName.toLowerCase(),\n this.isComplete(this._session.answer)\n )\n );\n\n this._render();\n };\n\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["Graphing","answer","Array","isArray","length","_session","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","isComplete","_render","m","_model","s","el","React","createElement","Main","model","session","onAnswersChange","changeAnswers","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;IAIqBA,Q;;;;;AACnB,sBAAc;AAAA;;AAAA;AACZ;AADY,mGAsBD,UAACC,MAAD;AAAA,aAAYC,KAAK,CAACC,OAAN,CAAcF,MAAd,KAAyBA,MAAM,CAACG,MAAP,GAAgB,CAArD;AAAA,KAtBC;AAAA,sGAwBE,UAACH,MAAD,EAAY;AAC1B,YAAKI,QAAL,CAAcJ,MAAd,GAAuB,iCAAqBA,MAArB,CAAvB;;AAEA,YAAKK,aAAL,CAAmB,IAAIC,oCAAJ,CAAwB,MAAKC,OAAL,CAAaC,WAAb,EAAxB,EAAoD,MAAKC,UAAL,CAAgB,MAAKL,QAAL,CAAcJ,MAA9B,CAApD,CAAnB;;AAEA,YAAKU,OAAL;AACD,KA9Ba;AAAA;AAEb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;;AACA,WAAKD,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKN,QAAZ;AACD,K;SAPD,aAAYS,CAAZ,EAAe;AACb,WAAKT,QAAL,GAAgBS,CAAhB;;AACA,WAAKH,OAAL;AACD;;;WAMD,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;WAYD,mBAAU;AAAA;;AACR,UAAI,CAAC,KAAKE,MAAN,IAAgB,CAAC,KAAKR,QAA1B,EAAoC;AAClC;AACD;;AAED,UAAMU,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,QAAAA,KAAK,EAAE,KAAKN,MADuB;AAEnCO,QAAAA,OAAO,EAAE,KAAKf,QAFqB;AAGnCgB,QAAAA,eAAe,EAAE,KAAKC;AAHa,OAA1B,CAAX;;AAMAC,2BAASC,MAAT,CAAgBT,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,uCAAW,MAAX;AACD,OAFD;AAGD;;;kDA/CmCU,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nimport { removeInvalidAnswers } from './utils';\nimport Main from './main';\n\nexport { Main as Component };\n\nexport default class Graphing extends HTMLElement {\n constructor() {\n super();\n }\n\n set model(m) {\n this._model = m;\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n connectedCallback() {\n this._render();\n }\n\n isComplete = (answer) => Array.isArray(answer) && answer.length > 0;\n\n changeAnswers = (answer) => {\n this._session.answer = removeInvalidAnswers(answer);\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete(this._session.answer)));\n\n this._render();\n };\n\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers,\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n}\n"],"file":"index.js"}