@pie-element/charting 2.7.30 → 5.0.0
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/CHANGELOG.md +65 -0
- package/configure/CHANGELOG.md +64 -0
- package/configure/lib/charting-config.js +22 -4
- package/configure/lib/charting-config.js.map +1 -1
- package/configure/lib/configure.js +21 -13
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/correct-response.js +161 -41
- package/configure/lib/correct-response.js.map +1 -1
- package/configure/lib/defaults.js +11 -3
- package/configure/lib/defaults.js.map +1 -1
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +8 -0
- package/controller/lib/index.js +24 -19
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/docs/config-schema.json +63 -0
- package/docs/config-schema.json.md +49 -1
- package/docs/demo/generate.js +6 -20
- package/docs/demo/session.js +3 -6
- package/docs/pie-schema.json +21 -6
- package/docs/pie-schema.json.md +16 -4
- package/lib/main.js +0 -3
- package/lib/main.js.map +1 -1
- package/package.json +6 -6
- package/configure/lib/chart-type.js +0 -72
- package/configure/lib/chart-type.js.map +0 -1
package/docs/config-schema.json
CHANGED
|
@@ -120,6 +120,48 @@
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
+
"maxImageWidth": {
|
|
124
|
+
"title": "ConfigureMaxImageDimensionsProp",
|
|
125
|
+
"type": "object",
|
|
126
|
+
"properties": {
|
|
127
|
+
"teacherInstructions": {
|
|
128
|
+
"description": "Indicates the max dimension for images in teacher instructions",
|
|
129
|
+
"type": "number",
|
|
130
|
+
"title": "teacherInstructions"
|
|
131
|
+
},
|
|
132
|
+
"prompt": {
|
|
133
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
|
|
134
|
+
"type": "number",
|
|
135
|
+
"title": "prompt"
|
|
136
|
+
},
|
|
137
|
+
"rationale": {
|
|
138
|
+
"description": "Indicates the max dimension for images in rationale",
|
|
139
|
+
"type": "number",
|
|
140
|
+
"title": "rationale"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"maxImageHeight": {
|
|
145
|
+
"title": "ConfigureMaxImageDimensionsProp",
|
|
146
|
+
"type": "object",
|
|
147
|
+
"properties": {
|
|
148
|
+
"teacherInstructions": {
|
|
149
|
+
"description": "Indicates the max dimension for images in teacher instructions",
|
|
150
|
+
"type": "number",
|
|
151
|
+
"title": "teacherInstructions"
|
|
152
|
+
},
|
|
153
|
+
"prompt": {
|
|
154
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
|
|
155
|
+
"type": "number",
|
|
156
|
+
"title": "prompt"
|
|
157
|
+
},
|
|
158
|
+
"rationale": {
|
|
159
|
+
"description": "Indicates the max dimension for images in rationale",
|
|
160
|
+
"type": "number",
|
|
161
|
+
"title": "rationale"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
123
165
|
"showPrompt": {
|
|
124
166
|
"description": "Determines whether prompt field will be displayed or not",
|
|
125
167
|
"default": true,
|
|
@@ -176,6 +218,27 @@
|
|
|
176
218
|
"title": "enabled"
|
|
177
219
|
}
|
|
178
220
|
}
|
|
221
|
+
},
|
|
222
|
+
"ConfigureMaxImageDimensionsProp": {
|
|
223
|
+
"title": "ConfigureMaxImageDimensionsProp",
|
|
224
|
+
"type": "object",
|
|
225
|
+
"properties": {
|
|
226
|
+
"teacherInstructions": {
|
|
227
|
+
"description": "Indicates the max dimension for images in teacher instructions",
|
|
228
|
+
"type": "number",
|
|
229
|
+
"title": "teacherInstructions"
|
|
230
|
+
},
|
|
231
|
+
"prompt": {
|
|
232
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
|
|
233
|
+
"type": "number",
|
|
234
|
+
"title": "prompt"
|
|
235
|
+
},
|
|
236
|
+
"rationale": {
|
|
237
|
+
"description": "Indicates the max dimension for images in rationale",
|
|
238
|
+
"type": "number",
|
|
239
|
+
"title": "rationale"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
179
242
|
}
|
|
180
243
|
},
|
|
181
244
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
@@ -91,6 +91,38 @@ Indicates the label for the item that has to be displayed in the Settings Panel
|
|
|
91
91
|
Indicates the value of the item if it affects config-ui
|
|
92
92
|
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
93
93
|
|
|
94
|
+
# `maxImageWidth` (object)
|
|
95
|
+
|
|
96
|
+
Properties of the `maxImageWidth` object:
|
|
97
|
+
|
|
98
|
+
## `teacherInstructions` (number)
|
|
99
|
+
|
|
100
|
+
Indicates the max dimension for images in teacher instructions
|
|
101
|
+
|
|
102
|
+
## `prompt` (number)
|
|
103
|
+
|
|
104
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
105
|
+
|
|
106
|
+
## `rationale` (number)
|
|
107
|
+
|
|
108
|
+
Indicates the max dimension for images in rationale
|
|
109
|
+
|
|
110
|
+
# `maxImageHeight` (object)
|
|
111
|
+
|
|
112
|
+
Properties of the `maxImageHeight` object:
|
|
113
|
+
|
|
114
|
+
## `teacherInstructions` (number)
|
|
115
|
+
|
|
116
|
+
Indicates the max dimension for images in teacher instructions
|
|
117
|
+
|
|
118
|
+
## `prompt` (number)
|
|
119
|
+
|
|
120
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
121
|
+
|
|
122
|
+
## `rationale` (number)
|
|
123
|
+
|
|
124
|
+
Indicates the max dimension for images in rationale
|
|
125
|
+
|
|
94
126
|
# `showPrompt` (boolean)
|
|
95
127
|
|
|
96
128
|
Determines whether prompt field will be displayed or not
|
|
@@ -142,4 +174,20 @@ Indicates the label for the item that has to be displayed in the Settings Panel
|
|
|
142
174
|
### `enabled` (boolean)
|
|
143
175
|
|
|
144
176
|
Indicates the value of the item if it affects config-ui
|
|
145
|
-
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
177
|
+
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
178
|
+
|
|
179
|
+
## `ConfigureMaxImageDimensionsProp` (object)
|
|
180
|
+
|
|
181
|
+
Properties of the `ConfigureMaxImageDimensionsProp` object:
|
|
182
|
+
|
|
183
|
+
### `teacherInstructions` (number)
|
|
184
|
+
|
|
185
|
+
Indicates the max dimension for images in teacher instructions
|
|
186
|
+
|
|
187
|
+
### `prompt` (number)
|
|
188
|
+
|
|
189
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
190
|
+
|
|
191
|
+
### `rationale` (number)
|
|
192
|
+
|
|
193
|
+
Indicates the max dimension for images in rationale
|
package/docs/demo/generate.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
exports.model = (id, element) => ({
|
|
2
2
|
id,
|
|
3
3
|
element,
|
|
4
|
-
|
|
5
4
|
addCategoryEnabled: true,
|
|
6
5
|
categoryDefaultLabel: 'Category',
|
|
7
6
|
chartType: 'bar',
|
|
@@ -9,24 +8,15 @@ exports.model = (id, element) => ({
|
|
|
9
8
|
data: [
|
|
10
9
|
{
|
|
11
10
|
label: 'A',
|
|
12
|
-
value: 1
|
|
13
|
-
interactive: false,
|
|
14
|
-
editable: true,
|
|
15
|
-
deletable: true
|
|
11
|
+
value: 1
|
|
16
12
|
},
|
|
17
13
|
{
|
|
18
14
|
label: 'B',
|
|
19
|
-
value: 1
|
|
20
|
-
interactive: true,
|
|
21
|
-
editable: true,
|
|
22
|
-
deletable: true
|
|
15
|
+
value: 1
|
|
23
16
|
},
|
|
24
17
|
{
|
|
25
18
|
label: 'C',
|
|
26
|
-
value: 1
|
|
27
|
-
interactive: true,
|
|
28
|
-
editable: true,
|
|
29
|
-
deletable: true
|
|
19
|
+
value: 1
|
|
30
20
|
},
|
|
31
21
|
]
|
|
32
22
|
},
|
|
@@ -35,28 +25,24 @@ exports.model = (id, element) => ({
|
|
|
35
25
|
label: 'A',
|
|
36
26
|
value: 1,
|
|
37
27
|
interactive: false,
|
|
38
|
-
editable:
|
|
39
|
-
deletable: true
|
|
28
|
+
editable: false
|
|
40
29
|
},
|
|
41
30
|
{
|
|
42
31
|
label: 'B',
|
|
43
32
|
value: 1,
|
|
44
33
|
interactive: true,
|
|
45
|
-
editable:
|
|
46
|
-
deletable: true
|
|
34
|
+
editable: false
|
|
47
35
|
},
|
|
48
36
|
{
|
|
49
37
|
label: 'D',
|
|
50
38
|
value: 2,
|
|
51
39
|
interactive: true,
|
|
52
|
-
editable:
|
|
53
|
-
deletable: true
|
|
40
|
+
editable: false
|
|
54
41
|
},
|
|
55
42
|
],
|
|
56
43
|
domain: {
|
|
57
44
|
label: 'Characters',
|
|
58
45
|
},
|
|
59
|
-
editCategoryEnabled: true,
|
|
60
46
|
graph: {
|
|
61
47
|
width: 480,
|
|
62
48
|
height: 480
|
package/docs/demo/session.js
CHANGED
|
@@ -7,22 +7,19 @@ module.exports = [
|
|
|
7
7
|
// label: 'A',
|
|
8
8
|
// value: 1,
|
|
9
9
|
// interactive: false,
|
|
10
|
-
// editable: true
|
|
11
|
-
// deletable: true
|
|
10
|
+
// editable: true
|
|
12
11
|
// },
|
|
13
12
|
// {
|
|
14
13
|
// label: 'B',
|
|
15
14
|
// value: 1,
|
|
16
15
|
// interactive: true,
|
|
17
|
-
// editable: true
|
|
18
|
-
// deletable: true
|
|
16
|
+
// editable: true
|
|
19
17
|
// },
|
|
20
18
|
// {
|
|
21
19
|
// label: 'C',
|
|
22
20
|
// value: 1,
|
|
23
21
|
// interactive: true,
|
|
24
|
-
// editable: true
|
|
25
|
-
// deletable: true
|
|
22
|
+
// editable: true
|
|
26
23
|
// }
|
|
27
24
|
// ]
|
|
28
25
|
},
|
package/docs/pie-schema.json
CHANGED
|
@@ -366,11 +366,6 @@
|
|
|
366
366
|
"step"
|
|
367
367
|
]
|
|
368
368
|
},
|
|
369
|
-
"editCategoryEnabled": {
|
|
370
|
-
"description": "Indicates if user can edit default categories",
|
|
371
|
-
"type": "boolean",
|
|
372
|
-
"title": "editCategoryEnabled"
|
|
373
|
-
},
|
|
374
369
|
"graph": {
|
|
375
370
|
"title": "Chart",
|
|
376
371
|
"type": "object",
|
|
@@ -506,7 +501,6 @@
|
|
|
506
501
|
"correctAnswer",
|
|
507
502
|
"data",
|
|
508
503
|
"domain",
|
|
509
|
-
"editCategoryEnabled",
|
|
510
504
|
"element",
|
|
511
505
|
"graph",
|
|
512
506
|
"id",
|
|
@@ -554,6 +548,27 @@
|
|
|
554
548
|
}
|
|
555
549
|
}
|
|
556
550
|
},
|
|
551
|
+
"ConfigureMaxImageDimensionsProp": {
|
|
552
|
+
"title": "ConfigureMaxImageDimensionsProp",
|
|
553
|
+
"type": "object",
|
|
554
|
+
"properties": {
|
|
555
|
+
"teacherInstructions": {
|
|
556
|
+
"description": "Indicates the max dimension for images in teacher instructions",
|
|
557
|
+
"type": "number",
|
|
558
|
+
"title": "teacherInstructions"
|
|
559
|
+
},
|
|
560
|
+
"prompt": {
|
|
561
|
+
"description": "Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified",
|
|
562
|
+
"type": "number",
|
|
563
|
+
"title": "prompt"
|
|
564
|
+
},
|
|
565
|
+
"rationale": {
|
|
566
|
+
"description": "Indicates the max dimension for images in rationale",
|
|
567
|
+
"type": "number",
|
|
568
|
+
"title": "rationale"
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
},
|
|
557
572
|
"Answer": {
|
|
558
573
|
"title": "Answer",
|
|
559
574
|
"type": "object",
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -69,10 +69,6 @@ Label step value
|
|
|
69
69
|
|
|
70
70
|
Axis Label
|
|
71
71
|
|
|
72
|
-
# `editCategoryEnabled` (boolean, required)
|
|
73
|
-
|
|
74
|
-
Indicates if user can edit default categories
|
|
75
|
-
|
|
76
72
|
# `graph` (object, required)
|
|
77
73
|
|
|
78
74
|
Properties of the `graph` object:
|
|
@@ -201,6 +197,22 @@ Indicates the label for the item that has to be displayed in the Settings Panel
|
|
|
201
197
|
Indicates the value of the item if it affects config-ui
|
|
202
198
|
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
203
199
|
|
|
200
|
+
## `ConfigureMaxImageDimensionsProp` (object)
|
|
201
|
+
|
|
202
|
+
Properties of the `ConfigureMaxImageDimensionsProp` object:
|
|
203
|
+
|
|
204
|
+
### `teacherInstructions` (number)
|
|
205
|
+
|
|
206
|
+
Indicates the max dimension for images in teacher instructions
|
|
207
|
+
|
|
208
|
+
### `prompt` (number)
|
|
209
|
+
|
|
210
|
+
Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
|
|
211
|
+
|
|
212
|
+
### `rationale` (number)
|
|
213
|
+
|
|
214
|
+
Indicates the max dimension for images in rationale
|
|
215
|
+
|
|
204
216
|
## `Answer` (object)
|
|
205
217
|
|
|
206
218
|
Properties of the `Answer` object:
|
package/lib/main.js
CHANGED
|
@@ -106,7 +106,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
106
106
|
domain = model.domain,
|
|
107
107
|
range = model.range,
|
|
108
108
|
title = model.title,
|
|
109
|
-
editCategoryEnabled = model.editCategoryEnabled,
|
|
110
109
|
addCategoryEnabled = model.addCategoryEnabled,
|
|
111
110
|
categoryDefaultLabel = model.categoryDefaultLabel,
|
|
112
111
|
rationale = model.rationale,
|
|
@@ -144,7 +143,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
144
143
|
data: correctData || categories,
|
|
145
144
|
title: title,
|
|
146
145
|
onDataChange: this.changeData,
|
|
147
|
-
editCategoryEnabled: false,
|
|
148
146
|
addCategoryEnabled: false,
|
|
149
147
|
categoryDefaultLabel: categoryDefaultLabel
|
|
150
148
|
}) : /*#__PURE__*/_react["default"].createElement(_charting.Chart, {
|
|
@@ -156,7 +154,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
156
154
|
data: correctedAnswer || categories,
|
|
157
155
|
title: title,
|
|
158
156
|
onDataChange: this.changeData,
|
|
159
|
-
editCategoryEnabled: editCategoryEnabled,
|
|
160
157
|
addCategoryEnabled: addCategoryEnabled,
|
|
161
158
|
categoryDefaultLabel: categoryDefaultLabel
|
|
162
159
|
}), /*#__PURE__*/_react["default"].createElement("br", null), rationale && (0, _renderUi.hasText)(rationale) && /*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["Main","props","data","setState","categories","onAnswersChange","showingCorrect","state","model","nextProps","nextData","classes","teacherInstructions","prompt","chartType","size","domain","range","title","
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["Main","props","data","setState","categories","onAnswersChange","showingCorrect","state","model","nextProps","nextData","classes","teacherInstructions","prompt","chartType","size","domain","range","title","addCategoryEnabled","categoryDefaultLabel","rationale","correctedAnswer","correctAnswer","correctData","map","interactive","editable","showToggle","length","mainContainer","toggleCorrect","hidden","visible","chartTypes","Bar","Histogram","LineDot","LineCross","DotPlot","LinePlot","changeData","React","Component","PropTypes","object","isRequired","func","array","styles","theme","padding","spacing","unit","color","text","backgroundColor","background","overflow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;IAEaA,I;;;;;AAUX,gBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,mGAkBN,UAACC,IAAD;AAAA,aACX,MAAKC,QAAL,CACE;AACEC,QAAAA,UAAU,EAAEF;AADd,OADF,EAIE;AAAA,eAAM,MAAKD,KAAL,CAAWI,eAAX,CAA2BH,IAA3B,CAAN;AAAA,OAJF,CADW;AAAA,KAlBM;AAAA,sGA0BH,UAACI,cAAD;AAAA,aAAoB,MAAKH,QAAL,CAAc;AAAEG,QAAAA,cAAc,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,eACQ;AACjBW,EAAAA,OAAO,EAAEiC,sBAAUC,MADF;AAEjBrC,EAAAA,KAAK,EAAEoC,sBAAUC,MAAV,CAAiBC,UAFP;AAGjBzC,EAAAA,eAAe,EAAEuC,sBAAUG,IAHV;AAIjB3C,EAAAA,UAAU,EAAEwC,sBAAUI;AAJL,C;iCADRhD,I,kBAQW;AAAEW,EAAAA,OAAO,EAAE;AAAX,C;;AAiJxB,IAAMsC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBpB,IAAAA,aAAa,EAAE;AACbqB,MAAAA,OAAO,EAAED,KAAK,CAACE,OAAN,CAAcC,IADV;AAEbC,MAAAA,KAAK,EAAEA,gBAAMC,IAAN,EAFM;AAGbC,MAAAA,eAAe,EAAEF,gBAAMG,UAAN,EAHJ;AAIbC,MAAAA,QAAQ,EAAE;AAJG;AADU,GAAZ;AAAA,CAAf;;eASe,wBAAWT,MAAX,EAAmBjD,IAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport {color, Collapsible, hasText, PreviewPrompt} from '@pie-lib/render-ui';\nimport { Chart, chartTypes } from '@pie-lib/charting';\nimport isEqual from 'lodash/isEqual';\nimport CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n model: PropTypes.object.isRequired,\n onAnswersChange: PropTypes.func,\n categories: PropTypes.array,\n };\n\n static defaultProps = { classes: {} };\n\n constructor(props) {\n super(props);\n\n this.state = {\n categories: props.categories || props.model.data,\n showingCorrect: false,\n };\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { model: { data: nextData = [] } = {} } = nextProps;\n const { model: { data = [] } = {} } = this.props;\n\n if (!isEqual(nextData, data)) {\n this.setState({ categories: nextData });\n }\n }\n\n changeData = (data) =>\n this.setState(\n {\n categories: data,\n },\n () => this.props.onAnswersChange(data)\n );\n\n toggleCorrect = (showingCorrect) => this.setState({ showingCorrect });\n\n render() {\n const { categories, showingCorrect } = this.state;\n const { model, classes } = this.props;\n const {\n teacherInstructions,\n prompt,\n chartType,\n size,\n domain,\n range,\n title,\n addCategoryEnabled,\n categoryDefaultLabel,\n rationale,\n correctedAnswer,\n correctAnswer,\n } = model;\n\n const correctData =\n correctAnswer && correctAnswer.data\n ? correctAnswer.data.map((data) => {\n return {\n ...data,\n interactive: false,\n editable: false,\n };\n })\n : [];\n\n const showToggle = correctData && correctData.length > 0;\n\n return (\n <div className={classes.mainContainer}>\n <CorrectAnswerToggle\n show={showToggle}\n toggled={showingCorrect}\n onToggle={this.toggleCorrect}\n />\n\n {teacherInstructions && hasText(teacherInstructions) && (\n <React.Fragment>\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n <PreviewPrompt prompt={teacherInstructions} />\n </Collapsible>\n <br />\n </React.Fragment>\n )}\n\n {prompt && (\n <React.Fragment>\n <PreviewPrompt className=\"prompt\" prompt={prompt} />\n <br />\n </React.Fragment>\n )}\n\n {showingCorrect && showToggle ? (\n <Chart\n chartType={chartType}\n size={size}\n domain={domain}\n range={range}\n charts={[\n chartTypes.Bar(),\n chartTypes.Histogram(),\n chartTypes.LineDot(),\n chartTypes.LineCross(),\n chartTypes.DotPlot(),\n chartTypes.LinePlot(),\n ]}\n data={correctData || categories}\n title={title}\n onDataChange={this.changeData}\n addCategoryEnabled={false}\n categoryDefaultLabel={categoryDefaultLabel}\n />\n ) : (\n <Chart\n chartType={chartType}\n size={size}\n domain={domain}\n range={range}\n charts={[\n chartTypes.Bar(),\n chartTypes.Histogram(),\n chartTypes.LineDot(),\n chartTypes.LineCross(),\n chartTypes.DotPlot(),\n chartTypes.LinePlot(),\n ]}\n data={correctedAnswer || categories}\n title={title}\n onDataChange={this.changeData}\n addCategoryEnabled={addCategoryEnabled}\n categoryDefaultLabel={categoryDefaultLabel}\n />\n )}\n\n <br />\n {rationale && hasText(rationale) && (\n <Collapsible\n labels={{ hidden: 'Show Rationale', visible: 'Hide Rationale' }}\n >\n <PreviewPrompt prompt={rationale} />\n </Collapsible>\n )}\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n mainContainer: {\n padding: theme.spacing.unit,\n color: color.text(),\n backgroundColor: color.background(),\n overflow: 'hidden'\n }\n});\n\nexport default withStyles(styles)(Main);\n"],"file":"main.js"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "5.0.0",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@material-ui/core": "^3.9.2",
|
|
15
15
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
16
|
-
"@pie-lib/charting": "^
|
|
17
|
-
"@pie-lib/correct-answer-toggle": "^2.3.
|
|
18
|
-
"@pie-lib/math-rendering": "^2.4.
|
|
19
|
-
"@pie-lib/render-ui": "^4.12.
|
|
16
|
+
"@pie-lib/charting": "^5.1.0",
|
|
17
|
+
"@pie-lib/correct-answer-toggle": "^2.3.39",
|
|
18
|
+
"@pie-lib/math-rendering": "^2.4.3",
|
|
19
|
+
"@pie-lib/render-ui": "^4.12.9",
|
|
20
20
|
"classnames": "^2.2.5",
|
|
21
21
|
"debug": "^4.1.1",
|
|
22
22
|
"lodash": "^4.17.15",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"author": "",
|
|
27
27
|
"license": "ISC",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "9b55e36b358084c7a96a08bad969f4856d6802da",
|
|
29
29
|
"main": "lib/index.js",
|
|
30
30
|
"module": "src/index.js"
|
|
31
31
|
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _styles = require("@material-ui/core/styles");
|
|
13
|
-
|
|
14
|
-
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
15
|
-
|
|
16
|
-
var _FormControl = _interopRequireDefault(require("@material-ui/core/FormControl"));
|
|
17
|
-
|
|
18
|
-
var _InputLabel = _interopRequireDefault(require("@material-ui/core/InputLabel"));
|
|
19
|
-
|
|
20
|
-
var _Select = _interopRequireDefault(require("@material-ui/core/Select"));
|
|
21
|
-
|
|
22
|
-
var _OutlinedInput = _interopRequireDefault(require("@material-ui/core/OutlinedInput"));
|
|
23
|
-
|
|
24
|
-
var ChartType = (0, _styles.withStyles)(function (theme) {
|
|
25
|
-
return {
|
|
26
|
-
formControl: {
|
|
27
|
-
width: '100%'
|
|
28
|
-
},
|
|
29
|
-
chartType: {
|
|
30
|
-
paddingTop: theme.spacing.unit * 2,
|
|
31
|
-
paddingBottom: theme.spacing.unit * 2
|
|
32
|
-
},
|
|
33
|
-
chartTypeLabel: {
|
|
34
|
-
transform: 'translate(0px, -16px) scale(0.75) !important'
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
})(function (_ref) {
|
|
38
|
-
var onChange = _ref.onChange,
|
|
39
|
-
value = _ref.value,
|
|
40
|
-
classes = _ref.classes;
|
|
41
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
42
|
-
className: classes.chartType
|
|
43
|
-
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
44
|
-
variant: "outlined",
|
|
45
|
-
className: classes.formControl
|
|
46
|
-
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
47
|
-
htmlFor: "type-helper",
|
|
48
|
-
className: classes.chartTypeLabel
|
|
49
|
-
}, "ChartType"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
50
|
-
value: value,
|
|
51
|
-
onChange: onChange,
|
|
52
|
-
input: /*#__PURE__*/_react["default"].createElement(_OutlinedInput["default"], {
|
|
53
|
-
name: "type",
|
|
54
|
-
id: "type-helper"
|
|
55
|
-
})
|
|
56
|
-
}, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
57
|
-
value: 'histogram'
|
|
58
|
-
}, "Histogram"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
59
|
-
value: 'bar'
|
|
60
|
-
}, "Bar"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
61
|
-
value: 'lineDot'
|
|
62
|
-
}, "Line Dot"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
63
|
-
value: 'lineCross'
|
|
64
|
-
}, "Line Cross"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
65
|
-
value: 'dotPlot'
|
|
66
|
-
}, "Dot Plot"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
67
|
-
value: 'linePlot'
|
|
68
|
-
}, "Line Plot"))));
|
|
69
|
-
});
|
|
70
|
-
var _default = ChartType;
|
|
71
|
-
exports["default"] = _default;
|
|
72
|
-
//# sourceMappingURL=chart-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chart-type.js"],"names":["ChartType","theme","formControl","width","chartType","paddingTop","spacing","unit","paddingBottom","chartTypeLabel","transform","onChange","value","classes"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,SAAS,GAAG,wBAAW,UAAAC,KAAK;AAAA,SAAK;AACrCC,IAAAA,WAAW,EAA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,CAhCiB,CAAlB;eAkCeX,S","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport Select from '@material-ui/core/Select';\nimport OutlinedInput from '@material-ui/core/OutlinedInput';\n\nconst ChartType = withStyles(theme => ({\n formControl: {\n width: '100%'\n },\n chartType: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2\n },\n chartTypeLabel: {\n transform: 'translate(0px, -16px) scale(0.75) !important'\n }\n}))(({ onChange, value, classes }) => {\n return (\n <div className={classes.chartType}>\n <FormControl variant=\"outlined\" className={classes.formControl}>\n <InputLabel htmlFor=\"type-helper\" className={classes.chartTypeLabel}>ChartType</InputLabel>\n\n <Select\n value={value}\n onChange={onChange}\n input={<OutlinedInput name=\"type\" id=\"type-helper\" />}\n >\n <MenuItem value={'histogram'}>Histogram</MenuItem>\n <MenuItem value={'bar'}>Bar</MenuItem>\n <MenuItem value={'lineDot'}>Line Dot</MenuItem>\n <MenuItem value={'lineCross'}>Line Cross</MenuItem>\n <MenuItem value={'dotPlot'}>Dot Plot</MenuItem>\n <MenuItem value={'linePlot'}>Line Plot</MenuItem>\n </Select>\n </FormControl>\n </div>\n );\n});\n\nexport default ChartType;\n"],"file":"chart-type.js"}
|