@pie-element/graphing 3.5.4-next.1158 → 3.5.4-next.1169
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/configure/lib/configure.js +8 -0
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/defaults.js +7 -2
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/graphing-config.js +23 -4
- package/configure/lib/graphing-config.js.map +1 -1
- package/docs/config-schema.json +80 -4
- package/docs/config-schema.json.md +64 -2
- package/docs/pie-schema.json +48 -2
- package/docs/pie-schema.json.md +39 -2
- package/package.json +2 -2
|
@@ -217,6 +217,12 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
217
217
|
log('[render] model', model);
|
|
218
218
|
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
219
219
|
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
220
|
+
var labelsPlaceholders = {
|
|
221
|
+
top: labels.top,
|
|
222
|
+
right: labels.right,
|
|
223
|
+
bottom: labels.bottom,
|
|
224
|
+
left: labels.left
|
|
225
|
+
};
|
|
220
226
|
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
221
227
|
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
222
228
|
model: model,
|
|
@@ -292,9 +298,11 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
292
298
|
authoring: authoring,
|
|
293
299
|
availableTools: availableTools,
|
|
294
300
|
graphDimensions: graphDimensions,
|
|
301
|
+
labelsPlaceholders: labelsPlaceholders,
|
|
295
302
|
model: model,
|
|
296
303
|
showLabels: labelsEnabled,
|
|
297
304
|
showTitle: titleEnabled,
|
|
305
|
+
titlePlaceholder: title.placeholder,
|
|
298
306
|
onChange: this.props.onModelChanged
|
|
299
307
|
}), /*#__PURE__*/_react["default"].createElement(_correctResponse["default"], {
|
|
300
308
|
availableTools: availableTools,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","configuration","availableTools","arrows","left","right","up","down","toolbarTools","classes","onConfigurationChanged","imageSupport","authoring","coordinatesOnHover","graphDimensions","labels","padding","scoringType","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","titleEnabled","defaultImageMaxWidth","defaultImageMaxHeight","label","Properties","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA6CC,kBAA7C,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA6CD,kBAA7C,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAA6CF,kBAA7C,CAAuBE,KAAvB;AAAA,IAA8BC,UAA9B,GAA6CH,kBAA7C,CAA8BG,UAA9B;AACA,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,QADL;AAELC,MAAAA,OAAO,EAAE,OAFJ;AAGLC,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAH3B;AAILC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,CAAcC;AAJvB,KADgB;AAOvBE,IAAAA,OAAO,EAAE;AACPJ,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB;AAD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,KAAK,EAAEH,KAFT;AAGE,QAAA,QAAQ,EAAE,KAAKF,KAAL,CAAWC;AAHvB,QAzEF,CAzCF,CADF;AA2HD;;;EAhO4BsC,kBAAMC,S;;;iCAAxB1C,S,eACQ;AACjBG,EAAAA,cAAc,EAAEwC,sBAAUC,IADT;AAEjB7B,EAAAA,sBAAsB,EAAE4B,sBAAUC,IAFjB;AAGjB9B,EAAAA,OAAO,EAAE6B,sBAAUE,MAHF;AAIjB7B,EAAAA,YAAY,EAAE2B,sBAAUE,MAJP;AAKjBzC,EAAAA,KAAK,EAAEuC,sBAAUE,MAAV,CAAiBC,UALP;AAMjBxC,EAAAA,aAAa,EAAEqC,sBAAUE,MAAV,CAAiBC;AANf,C;iCADR9C,S,kBAUW;AAAEc,EAAAA,OAAO,EAAE;AAAX,C;;eAyNT,wBAAW7B,MAAX,EAAmBe,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = theme => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n content: {\n marginTop: theme.spacing.unit * 2\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n }\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { availableTools } = configuration || {};\n let { arrows } = model || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }\n }\n\n const toolbarTools = intersection(availableTools || [], model.toolbarTools || []);\n\n onModelChanged && onModelChanged({ ...model, arrows, toolbarTools });\n };\n\n onRationaleChange = rationale => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = prompt => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = teacherInstructions => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport\n } = this.props;\n const {\n arrows = {},\n authoring = {},\n availableTools = [],\n coordinatesOnHover = {},\n graphDimensions = {},\n labels = {},\n padding = {},\n prompt = {},\n title = {},\n rationale = {},\n scoringType = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n maxImageWidth = {},\n maxImageHeight = {}\n } = configuration || {};\n const {\n labelsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled\n } = model || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': {\n arrows: arrows.settings && checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down\n }),\n titleEnabled: title.settings && toggle(title.label),\n padding: padding.settings && toggle(padding.label),\n labelsEnabled: labels.settings && toggle(labels.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n },\n Properties: {\n 'authoring.enabled':\n authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, ['dichotomous', 'partial scoring'])\n }\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific\n criteria. The student will draw the line by clicking on two points\n on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label || 'Rationale'}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoring={authoring}\n availableTools={availableTools}\n graphDimensions={graphDimensions}\n model={model}\n showLabels={labelsEnabled}\n showTitle={titleEnabled}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|
|
1
|
+
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","configuration","availableTools","arrows","left","right","up","down","toolbarTools","classes","onConfigurationChanged","imageSupport","authoring","coordinatesOnHover","graphDimensions","labels","padding","scoringType","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","titleEnabled","defaultImageMaxWidth","defaultImageMaxHeight","labelsPlaceholders","top","bottom","label","Properties","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","placeholder","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA6CC,kBAA7C,CAAQD,KAAR;AAAA,IAAeE,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jB7C,EAAAA,KAAK,EAAE2C,sBAAUE,MAAV,CAAiBC,UALP;AAMjB5C,EAAAA,aAAa,EAAEyC,sBAAUE,MAAV,CAAiBC;AANf,C;iCADRlD,S,kBAUW;AAAEc,EAAAA,OAAO,EAAE;AAAX,C;;eAiOT,wBAAW7B,MAAX,EAAmBe,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = theme => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n content: {\n marginTop: theme.spacing.unit * 2\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n }\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { availableTools } = configuration || {};\n let { arrows } = model || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }\n }\n\n const toolbarTools = intersection(availableTools || [], model.toolbarTools || []);\n\n onModelChanged && onModelChanged({ ...model, arrows, toolbarTools });\n };\n\n onRationaleChange = rationale => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = prompt => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = teacherInstructions => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport\n } = this.props;\n const {\n arrows = {},\n authoring = {},\n availableTools = [],\n coordinatesOnHover = {},\n graphDimensions = {},\n labels = {},\n padding = {},\n prompt = {},\n title = {},\n rationale = {},\n scoringType = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n maxImageWidth = {},\n maxImageHeight = {}\n } = configuration || {};\n const {\n labelsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled\n } = model || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n const labelsPlaceholders = {\n top: labels.top,\n right: labels.right,\n bottom: labels.bottom,\n left: labels.left,\n };\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': {\n arrows: arrows.settings && checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down\n }),\n titleEnabled: title.settings && toggle(title.label),\n padding: padding.settings && toggle(padding.label),\n labelsEnabled: labels.settings && toggle(labels.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n },\n Properties: {\n 'authoring.enabled':\n authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, ['dichotomous', 'partial scoring'])\n }\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific\n criteria. The student will draw the line by clicking on two points\n on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label || 'Rationale'}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoring={authoring}\n availableTools={availableTools}\n graphDimensions={graphDimensions}\n labelsPlaceholders={labelsPlaceholders}\n model={model}\n showLabels={labelsEnabled}\n showTitle={titleEnabled}\n titlePlaceholder={title.placeholder}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|
|
@@ -112,7 +112,11 @@ var _default = {
|
|
|
112
112
|
labels: {
|
|
113
113
|
settings: true,
|
|
114
114
|
label: 'Graph Labels',
|
|
115
|
-
enabled: true
|
|
115
|
+
enabled: true,
|
|
116
|
+
top: 'Click here to add a top label',
|
|
117
|
+
right: 'Click here to add a right label',
|
|
118
|
+
bottom: 'Click here to add a bottom label',
|
|
119
|
+
left: 'Click here to add a left label'
|
|
116
120
|
},
|
|
117
121
|
prompt: {
|
|
118
122
|
settings: true,
|
|
@@ -137,7 +141,8 @@ var _default = {
|
|
|
137
141
|
title: {
|
|
138
142
|
settings: true,
|
|
139
143
|
label: 'Graph Title',
|
|
140
|
-
enabled: true
|
|
144
|
+
enabled: true,
|
|
145
|
+
placeholder: 'Click here to add a title for this graph'
|
|
141
146
|
},
|
|
142
147
|
availableTools: allTools,
|
|
143
148
|
spellCheck: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["tools","allTools","model","answers","arrows","left","right","up","down","backgroundMarks","domain","min","max","step","labelStep","axisLabel","graph","width","height","includeAxes","labels","labelsEnabled","padding","prompt","range","rationale","standardGrid","title","titleEnabled","toolbarTools","coordinatesOnHover","promptEnabled","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","configuration","authoring","settings","label","enabled","includeAxesEnabled","standardGridEnabled","graphDimensions","scoringType","studentInstructions","teacherInstructions","availableTools","spellCheck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K;AA4CbI,IAAAA,eAAe,EAAE;AACfL,MAAAA,QAAQ,EAAE,KADK;AAEfC,MAAAA,KAAK,EAAE,kBAFQ;AAGfC,MAAAA,OAAO,EAAE,IAHM;AAIf5B,MAAAA,GAAG,EAAE,GAJU;AAKfC,MAAAA,GAAG,EAAE,GALU;AAMfC,MAAAA,IAAI,EAAE;AANS,KA5CJ;AAoDbS,IAAAA,OAAO,EAAE;AACPe,MAAAA,QAAQ,EAAE,KADH;AAEPC,MAAAA,KAAK,EAAE;AAFA,KApDI;AAwDblB,IAAAA,MAAM,EAAE;AACNiB,MAAAA,QAAQ,EAAE,IADJ;AAENC,MAAAA,KAAK,EAAE,cAFD;AAGNC,MAAAA,OAAO,EAAE;
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["tools","allTools","model","answers","arrows","left","right","up","down","backgroundMarks","domain","min","max","step","labelStep","axisLabel","graph","width","height","includeAxes","labels","labelsEnabled","padding","prompt","range","rationale","standardGrid","title","titleEnabled","toolbarTools","coordinatesOnHover","promptEnabled","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","configuration","authoring","settings","label","enabled","includeAxesEnabled","standardGridEnabled","graphDimensions","top","bottom","scoringType","studentInstructions","teacherInstructions","placeholder","availableTools","spellCheck","maxImageWidth","maxImageHeight"],"mappings":";;;;;;;AAAA;;AAEA,sBAA0BA,eAA1B,CAAQC,QAAR;AAAA,IAAQA,QAAR,gCAAmB,EAAnB;eAEe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,EADJ;AAELC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,IADA;AAENC,MAAAA,KAAK,EAAE,IAFD;AAGNC,MAAAA,EAAE,EAAE,IAHE;AAINC,MAAAA,IAAI,EAAE;AAJA,KAFH;AAQLC,IAAAA,eAAe,EAAE,EARZ;AASLC,IAAAA,MAAM,EAAE;AACNC,MAAAA,GAAG,EAAE,CAAC,CADA;AAENC,MAAAA,GA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B,IAAAA,cAAc,EAAE;AACdL,MAAAA,mBAAmB,EAAE,GADP;AAEdxB,MAAAA,MAAM,EAAE,GAFM;AAGdE,MAAAA,SAAS,EAAE;AAHG;AA1GH;AA5CF,C","sourcesContent":["import { tools } from '@pie-lib/graphing';\n\nconst { allTools = [] } = tools;\n\nexport default {\n model: {\n answers: {},\n arrows: {\n left: true,\n right: true,\n up: true,\n down: true\n },\n backgroundMarks: [],\n domain: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'x'\n },\n graph: {\n width: 500,\n height: 500\n },\n includeAxes: true,\n labels: {},\n labelsEnabled: true,\n padding: true,\n prompt: '',\n range: {\n min: -5,\n max: 5,\n step: 1,\n labelStep: 1,\n axisLabel: 'y'\n },\n rationale: '',\n standardGrid: false,\n title: '',\n titleEnabled: true,\n toolbarTools: allTools,\n coordinatesOnHover: false,\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n },\n configuration: {\n authoring: {\n settings: false,\n label: 'Customize Grid Setup',\n enabled: true,\n includeAxesEnabled: true,\n standardGridEnabled: true,\n min: {\n label: 'Min Value',\n enabled: true\n },\n max: {\n label: 'Max Value',\n enabled: true\n },\n axisLabel: {\n label: 'Label',\n enabled: true\n },\n step: {\n label: 'Grid Interval',\n enabled: true\n },\n labelStep: {\n label: 'Label Interval',\n enabled: true\n }\n },\n arrows: {\n settings: true,\n label: 'Include Arrows',\n left: {\n label: 'left'\n },\n right: {\n label: 'right'\n },\n up: {\n label: 'up'\n },\n down: {\n label: 'down'\n }\n },\n graphDimensions: {\n settings: false,\n label: 'Graph Dimensions',\n enabled: true,\n min: 150,\n max: 800,\n step: 20\n },\n padding: {\n settings: false,\n label: 'Padding'\n },\n labels: {\n settings: true,\n label: 'Graph Labels',\n enabled: true,\n top: 'Click here to add a top label',\n right: 'Click here to add a right label',\n bottom: 'Click here to add a bottom label',\n left: 'Click here to add a left label'\n },\n prompt: {\n settings: true,\n label: 'Item Stem'\n },\n rationale: {\n settings: true,\n label: 'Rationale'\n },\n scoringType: {\n settings: false,\n label: 'Scoring Type'\n },\n studentInstructions: {\n settings: false,\n label: 'Student Instructions'\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions'\n },\n title: {\n settings: true,\n label: 'Graph Title',\n enabled: true,\n placeholder: 'Click here to add a title for this graph'\n },\n availableTools: allTools,\n spellCheck: {\n label: 'Spellcheck',\n settings:false,\n enabled:true\n },\n coordinatesOnHover: {\n settings: true,\n label: 'Coordinates on Hover'\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n }\n }\n};\n"],"file":"defaults.js"}
|
|
@@ -156,6 +156,17 @@ var GraphingConfig = /*#__PURE__*/function (_React$Component) {
|
|
|
156
156
|
|
|
157
157
|
onChange(updatedModel);
|
|
158
158
|
});
|
|
159
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChangeView", function (event, expanded) {
|
|
160
|
+
var _this$props$graphDime = _this.props.graphDimensions;
|
|
161
|
+
_this$props$graphDime = _this$props$graphDime === void 0 ? {} : _this$props$graphDime;
|
|
162
|
+
var enabled = _this$props$graphDime.enabled;
|
|
163
|
+
|
|
164
|
+
if (enabled) {
|
|
165
|
+
_this.setState({
|
|
166
|
+
showPixelGuides: expanded
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
});
|
|
159
170
|
|
|
160
171
|
var _ref = props.model || {},
|
|
161
172
|
_domain = _ref.domain,
|
|
@@ -172,7 +183,8 @@ var GraphingConfig = /*#__PURE__*/function (_React$Component) {
|
|
|
172
183
|
};
|
|
173
184
|
_this.state = {
|
|
174
185
|
gridValues: _gridValues,
|
|
175
|
-
labelValues: _labelValues
|
|
186
|
+
labelValues: _labelValues,
|
|
187
|
+
showPixelGuides: false
|
|
176
188
|
};
|
|
177
189
|
return _this;
|
|
178
190
|
}
|
|
@@ -188,9 +200,11 @@ var GraphingConfig = /*#__PURE__*/function (_React$Component) {
|
|
|
188
200
|
classes = _this$props4.classes,
|
|
189
201
|
_this$props4$graphDim = _this$props4.graphDimensions,
|
|
190
202
|
graphDimensions = _this$props4$graphDim === void 0 ? {} : _this$props4$graphDim,
|
|
203
|
+
labelsPlaceholders = _this$props4.labelsPlaceholders,
|
|
191
204
|
model = _this$props4.model,
|
|
192
205
|
showLabels = _this$props4.showLabels,
|
|
193
|
-
showTitle = _this$props4.showTitle
|
|
206
|
+
showTitle = _this$props4.showTitle,
|
|
207
|
+
titlePlaceholder = _this$props4.titlePlaceholder;
|
|
194
208
|
|
|
195
209
|
var _ref2 = model || {},
|
|
196
210
|
arrows = _ref2.arrows,
|
|
@@ -213,7 +227,8 @@ var GraphingConfig = /*#__PURE__*/function (_React$Component) {
|
|
|
213
227
|
|
|
214
228
|
var _this$state2 = this.state,
|
|
215
229
|
gridValues = _this$state2.gridValues,
|
|
216
|
-
labelValues = _this$state2.labelValues
|
|
230
|
+
labelValues = _this$state2.labelValues,
|
|
231
|
+
showPixelGuides = _this$state2.showPixelGuides;
|
|
217
232
|
var sizeConstraints = {
|
|
218
233
|
min: Math.max(150, min),
|
|
219
234
|
max: Math.min(800, max),
|
|
@@ -247,7 +262,8 @@ var GraphingConfig = /*#__PURE__*/function (_React$Component) {
|
|
|
247
262
|
size: graph,
|
|
248
263
|
sizeConstraints: sizeConstraints,
|
|
249
264
|
standardGrid: standardGrid,
|
|
250
|
-
onChange: this.onConfigChange
|
|
265
|
+
onChange: this.onConfigChange,
|
|
266
|
+
onChangeView: this.onChangeView
|
|
251
267
|
})), /*#__PURE__*/React.createElement("div", {
|
|
252
268
|
className: classes.graphConfig,
|
|
253
269
|
key: "graph"
|
|
@@ -269,18 +285,21 @@ var GraphingConfig = /*#__PURE__*/function (_React$Component) {
|
|
|
269
285
|
domain: domain,
|
|
270
286
|
key: "graphing-config",
|
|
271
287
|
labels: labels,
|
|
288
|
+
labelsPlaceholders: labelsPlaceholders,
|
|
272
289
|
marks: backgroundMarks,
|
|
273
290
|
onChangeLabels: this.changeLabels,
|
|
274
291
|
onChangeMarks: this.changeBackgroundMarks,
|
|
275
292
|
onChangeTitle: this.changeTitle,
|
|
276
293
|
range: range,
|
|
277
294
|
showLabels: showLabels,
|
|
295
|
+
showPixelGuides: showPixelGuides,
|
|
278
296
|
showTitle: showTitle,
|
|
279
297
|
size: {
|
|
280
298
|
width: graph.width,
|
|
281
299
|
height: graph.height
|
|
282
300
|
},
|
|
283
301
|
title: title,
|
|
302
|
+
titlePlaceholder: titlePlaceholder,
|
|
284
303
|
toolbarTools: availableTools
|
|
285
304
|
})));
|
|
286
305
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphing-config.jsx"],"names":["styles","theme","container","display","flexWrap","marginBottom","spacing","unit","gridConfig","flexDirection","marginRight","graphConfig","subtitleText","marginTop","GraphingConfig","props","backgroundMarks","model","onChange","labels","title","config","state","oldGridValues","gridValues","oldLabelValues","labelValues","updatedModel","domain","includeAxes","graph","range","standardGrid","domainConstraints","width","step","labelStep","rangeConstraints","height","setState","authoring","availableTools","classes","graphDimensions","showLabels","showTitle","arrows","coordinatesOnHover","dimensionsEnabled","enabled","min","max","sizeConstraints","Math","displayedFields","axisLabel","includeAxesEnabled","standardGridEnabled","displayGridSetup","Object","values","some","field","onConfigChange","includeArrows","changeLabels","changeBackgroundMarks","changeTitle","React","Component","PropTypes","object","isRequired","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,SAAS,EAAE;AACTC,MAAAA,OAAO,EAAE,MADA;AAETC,MAAAA,QAAQ,EAAE,MAFD;AAGTC,MAAAA,YAAY,EAAEJ,KAAK,CAACK,OAAN,CA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T;AAEjBhC,EAAAA,SAAS,EAAE8B,sBAAUC,MAFJ;AAGjB5B,EAAAA,eAAe,EAAE2B,sBAAUC,MAHV;AAIjBtD,EAAAA,KAAK,EAAEqD,sBAAUC,MAAV,CAAiBC,UAJP;AAKjBtD,EAAAA,QAAQ,EAAEoD,sBAAUG,IAAV,CAAeD;AALR,C;AA6KpB;;eAEc,wBAAWxE,MAAX,EAAmBc,cAAnB,C","sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GraphContainer, GridSetup } from '@pie-lib/graphing';\nimport { Typography } from '@material-ui/core';\nimport { withStyles } from '@material-ui/core/styles';\nimport { applyConstraints, getGridValues, getLabelValues } from './utils';\n\nconst styles = theme => ({\n container: {\n display: 'flex',\n flexWrap: 'wrap',\n marginBottom: theme.spacing.unit * 7\n },\n gridConfig: {\n display: 'flex',\n flexDirection: 'column',\n marginRight: theme.spacing.unit * 4,\n marginBottom: theme.spacing.unit * 3\n },\n graphConfig: {\n display: 'flex',\n flexDirection: 'column'\n },\n subtitleText: {\n marginTop: theme.spacing.unit * 1.5,\n marginBottom: theme.spacing.unit\n }\n});\n\nexport class GraphingConfig extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n authoring: PropTypes.object,\n graphDimensions: PropTypes.object,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n };\n\n constructor(props) {\n super(props);\n const { domain, range, graph } = props.model || {};\n\n const gridValues = {\n domain: getGridValues(domain, graph.width, true),\n range: getGridValues(range, graph.height, true)\n };\n const labelValues = {\n domain: getLabelValues(domain.step),\n range: getLabelValues(range.step)\n };\n\n this.state = { gridValues, labelValues };\n };\n\n changeBackgroundMarks = backgroundMarks => {\n const model = { ...this.props.model, backgroundMarks };\n\n this.props.onChange(model);\n };\n\n changeLabels = labels => {\n const { model, onChange } = this.props;\n\n onChange({ ...model, labels });\n };\n\n changeTitle = title => {\n const { model, onChange } = this.props;\n\n onChange({ ...model, title });\n };\n\n onConfigChange = config => {\n const { model, onChange } = this.props;\n const { gridValues: oldGridValues, labelValues: oldLabelValues } = this.state;\n const updatedModel = { ...model, ...config };\n const { domain, includeAxes, graph, range, standardGrid } = updatedModel;\n const gridValues = { domain: [], range: [] };\n const labelValues = { domain: [], range: [] };\n\n if (includeAxes) {\n const domainConstraints = applyConstraints(domain, graph.width, oldGridValues.domain, oldLabelValues.domain);\n\n gridValues.domain = domainConstraints.gridValues || [];\n labelValues.domain = domainConstraints.labelValues || [];\n }\n\n if (standardGrid) {\n gridValues.range = gridValues.domain;\n labelValues.range = labelValues.domain;\n range.step = domain.step;\n range.labelStep = domain.labelStep;\n } else {\n if (includeAxes) {\n const rangeConstraints = applyConstraints(range, graph.height, oldGridValues.range, oldLabelValues.range);\n\n gridValues.range = rangeConstraints.gridValues || [];\n labelValues.range = rangeConstraints.labelValues || [];\n }\n }\n\n this.setState({ gridValues, labelValues });\n onChange(updatedModel);\n };\n\n render() {\n const {\n authoring = {},\n availableTools = [],\n classes,\n graphDimensions = {},\n model,\n showLabels,\n showTitle\n } = this.props;\n const {\n arrows,\n backgroundMarks,\n coordinatesOnHover,\n domain,\n includeAxes,\n labels,\n range,\n standardGrid,\n title\n } = model || {};\n const graph = (model || {}).graph || {};\n const { enabled: dimensionsEnabled, min, max, step } = graphDimensions || {};\n const { gridValues, labelValues } = this.state;\n\n const sizeConstraints = {\n min: Math.max(150, min),\n max: Math.min(800, max),\n step: step >= 1 ? Math.min(200, step) : 20\n };\n\n const displayedFields = {\n axisLabel: authoring.axisLabel,\n dimensionsEnabled,\n includeAxesEnabled: authoring.includeAxesEnabled,\n labelStep: authoring.labelStep,\n min: authoring.min,\n max: authoring.max,\n standardGridEnabled: authoring.standardGridEnabled,\n step: authoring.step\n };\n\n const displayGridSetup = authoring.enabled &&\n Object.values(displayedFields).some(field => typeof field === 'object' ? field.enabled : field);\n\n return (\n <div className={classes.container}>\n <div className={classes.gridConfig}>\n {displayGridSetup && (\n <GridSetup\n displayedFields={displayedFields}\n domain={domain}\n dimensionsEnabled={dimensionsEnabled}\n gridValues={gridValues}\n includeAxes={includeAxes}\n labelValues={labelValues}\n range={range}\n size={graph}\n sizeConstraints={sizeConstraints}\n standardGrid={standardGrid}\n onChange={this.onConfigChange}\n />\n )}\n </div>\n\n <div className={classes.graphConfig} key=\"graph\">\n <Typography component=\"div\" variant=\"subheading\">\n <span>Define Graph Attributes</span>\n </Typography>\n\n <Typography component=\"div\" variant=\"body1\" className={classes.subtitleText}>\n <span>Use this interface to add/edit a title and/or labels, and to set background shapes</span>\n </Typography>\n\n <GraphContainer\n axesSettings={{ includeArrows: arrows }}\n backgroundMarks={[]}\n coordinatesOnHover={coordinatesOnHover}\n collapsibleToolbar={true}\n collapsibleToolbarTitle={'Add Background Shapes to Graph'}\n domain={domain}\n key=\"graphing-config\"\n labels={labels}\n marks={backgroundMarks}\n onChangeLabels={this.changeLabels}\n onChangeMarks={this.changeBackgroundMarks}\n onChangeTitle={this.changeTitle}\n range={range}\n showLabels={showLabels}\n showTitle={showTitle}\n size={{ width: graph.width, height: graph.height }}\n title={title}\n toolbarTools={availableTools}\n />\n </div>\n </div>\n );\n }\n};\n\nexport default withStyles(styles)(GraphingConfig);\n"],"file":"graphing-config.js"}
|
|
1
|
+
{"version":3,"sources":["../src/graphing-config.jsx"],"names":["styles","theme","container","display","flexWrap","marginBottom","spacing","unit","gridConfig","flexDirection","marginRight","graphConfig","subtitleText","marginTop","GraphingConfig","props","backgroundMarks","model","onChange","labels","title","config","state","oldGridValues","gridValues","oldLabelValues","labelValues","updatedModel","domain","includeAxes","graph","range","standardGrid","domainConstraints","width","step","labelStep","rangeConstraints","height","setState","event","expanded","graphDimensions","enabled","showPixelGuides","authoring","availableTools","classes","labelsPlaceholders","showLabels","showTitle","titlePlaceholder","arrows","coordinatesOnHover","dimensionsEnabled","min","max","sizeConstraints","Math","displayedFields","axisLabel","includeAxesEnabled","standardGridEnabled","displayGridSetup","Object","values","some","field","onConfigChange","onChangeView","includeArrows","changeL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} from '@pie-lib/graphing';\nimport { Typography } from '@material-ui/core';\nimport { withStyles } from '@material-ui/core/styles';\nimport { applyConstraints, getGridValues, getLabelValues } from './utils';\n\nconst styles = theme => ({\n container: {\n display: 'flex',\n flexWrap: 'wrap',\n marginBottom: theme.spacing.unit * 7\n },\n gridConfig: {\n display: 'flex',\n flexDirection: 'column',\n marginRight: theme.spacing.unit * 4,\n marginBottom: theme.spacing.unit * 3\n },\n graphConfig: {\n display: 'flex',\n flexDirection: 'column'\n },\n subtitleText: {\n marginTop: theme.spacing.unit * 1.5,\n marginBottom: theme.spacing.unit\n }\n});\n\nexport class GraphingConfig extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n authoring: PropTypes.object,\n graphDimensions: PropTypes.object,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n };\n\n constructor(props) {\n super(props);\n const { domain, range, graph } = props.model || {};\n\n const gridValues = {\n domain: getGridValues(domain, graph.width, true),\n range: getGridValues(range, graph.height, true)\n };\n const labelValues = {\n domain: getLabelValues(domain.step),\n range: getLabelValues(range.step)\n };\n\n this.state = { gridValues, labelValues, showPixelGuides: false };\n };\n\n changeBackgroundMarks = backgroundMarks => {\n const model = { ...this.props.model, backgroundMarks };\n\n this.props.onChange(model);\n };\n\n changeLabels = labels => {\n const { model, onChange } = this.props;\n\n onChange({ ...model, labels });\n };\n\n changeTitle = title => {\n const { model, onChange } = this.props;\n\n onChange({ ...model, title });\n };\n\n onConfigChange = config => {\n const { model, onChange } = this.props;\n const { gridValues: oldGridValues, labelValues: oldLabelValues } = this.state;\n const updatedModel = { ...model, ...config };\n const { domain, includeAxes, graph, range, standardGrid } = updatedModel;\n const gridValues = { domain: [], range: [] };\n const labelValues = { domain: [], range: [] };\n\n if (includeAxes) {\n const domainConstraints = applyConstraints(domain, graph.width, oldGridValues.domain, oldLabelValues.domain);\n\n gridValues.domain = domainConstraints.gridValues || [];\n labelValues.domain = domainConstraints.labelValues || [];\n }\n\n if (standardGrid) {\n gridValues.range = gridValues.domain;\n labelValues.range = labelValues.domain;\n range.step = domain.step;\n range.labelStep = domain.labelStep;\n } else {\n if (includeAxes) {\n const rangeConstraints = applyConstraints(range, graph.height, oldGridValues.range, oldLabelValues.range);\n\n gridValues.range = rangeConstraints.gridValues || [];\n labelValues.range = rangeConstraints.labelValues || [];\n }\n }\n\n this.setState({ gridValues, labelValues });\n onChange(updatedModel);\n };\n\n onChangeView = (event, expanded) => {\n const { graphDimensions: { enabled } = {}} = this.props;\n\n if (enabled) {\n this.setState({ showPixelGuides: expanded });\n }\n };\n\n render() {\n const {\n authoring = {},\n availableTools = [],\n classes,\n graphDimensions = {},\n labelsPlaceholders,\n model,\n showLabels,\n showTitle,\n titlePlaceholder\n } = this.props;\n const {\n arrows,\n backgroundMarks,\n coordinatesOnHover,\n domain,\n includeAxes,\n labels,\n range,\n standardGrid,\n title\n } = model || {};\n const graph = (model || {}).graph || {};\n const { enabled: dimensionsEnabled, min, max, step } = graphDimensions || {};\n const { gridValues, labelValues, showPixelGuides } = this.state;\n\n const sizeConstraints = {\n min: Math.max(150, min),\n max: Math.min(800, max),\n step: step >= 1 ? Math.min(200, step) : 20\n };\n\n const displayedFields = {\n axisLabel: authoring.axisLabel,\n dimensionsEnabled,\n includeAxesEnabled: authoring.includeAxesEnabled,\n labelStep: authoring.labelStep,\n min: authoring.min,\n max: authoring.max,\n standardGridEnabled: authoring.standardGridEnabled,\n step: authoring.step\n };\n\n const displayGridSetup = authoring.enabled &&\n Object.values(displayedFields).some(field => typeof field === 'object' ? field.enabled : field);\n\n return (\n <div className={classes.container}>\n <div className={classes.gridConfig}>\n {displayGridSetup && (\n <GridSetup\n displayedFields={displayedFields}\n domain={domain}\n dimensionsEnabled={dimensionsEnabled}\n gridValues={gridValues}\n includeAxes={includeAxes}\n labelValues={labelValues}\n range={range}\n size={graph}\n sizeConstraints={sizeConstraints}\n standardGrid={standardGrid}\n onChange={this.onConfigChange}\n onChangeView={this.onChangeView}\n />\n )}\n </div>\n\n <div className={classes.graphConfig} key=\"graph\">\n <Typography component=\"div\" variant=\"subheading\">\n <span>Define Graph Attributes</span>\n </Typography>\n\n <Typography component=\"div\" variant=\"body1\" className={classes.subtitleText}>\n <span>Use this interface to add/edit a title and/or labels, and to set background shapes</span>\n </Typography>\n\n <GraphContainer\n axesSettings={{ includeArrows: arrows }}\n backgroundMarks={[]}\n coordinatesOnHover={coordinatesOnHover}\n collapsibleToolbar={true}\n collapsibleToolbarTitle={'Add Background Shapes to Graph'}\n domain={domain}\n key=\"graphing-config\"\n labels={labels}\n labelsPlaceholders={labelsPlaceholders}\n marks={backgroundMarks}\n onChangeLabels={this.changeLabels}\n onChangeMarks={this.changeBackgroundMarks}\n onChangeTitle={this.changeTitle}\n range={range}\n showLabels={showLabels}\n showPixelGuides={showPixelGuides}\n showTitle={showTitle}\n size={{ width: graph.width, height: graph.height }}\n title={title}\n titlePlaceholder={titlePlaceholder}\n toolbarTools={availableTools}\n />\n </div>\n </div>\n );\n }\n};\n\nexport default withStyles(styles)(GraphingConfig);\n"],"file":"graphing-config.js"}
|
package/docs/config-schema.json
CHANGED
|
@@ -251,9 +251,29 @@
|
|
|
251
251
|
}
|
|
252
252
|
},
|
|
253
253
|
"labels": {
|
|
254
|
-
"title": "
|
|
254
|
+
"title": "LabelsConfigProp",
|
|
255
255
|
"type": "object",
|
|
256
256
|
"properties": {
|
|
257
|
+
"top": {
|
|
258
|
+
"description": "Indicates the placeholder for the top label",
|
|
259
|
+
"type": "string",
|
|
260
|
+
"title": "top"
|
|
261
|
+
},
|
|
262
|
+
"right": {
|
|
263
|
+
"description": "Indicates the placeholder for the right label",
|
|
264
|
+
"type": "string",
|
|
265
|
+
"title": "right"
|
|
266
|
+
},
|
|
267
|
+
"bottom": {
|
|
268
|
+
"description": "Indicates the placeholder for the bottom label",
|
|
269
|
+
"type": "string",
|
|
270
|
+
"title": "bottom"
|
|
271
|
+
},
|
|
272
|
+
"left": {
|
|
273
|
+
"description": "Indicates the placeholder for the left label",
|
|
274
|
+
"type": "string",
|
|
275
|
+
"title": "left"
|
|
276
|
+
},
|
|
257
277
|
"settings": {
|
|
258
278
|
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
259
279
|
"type": "boolean",
|
|
@@ -263,6 +283,11 @@
|
|
|
263
283
|
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
264
284
|
"type": "string",
|
|
265
285
|
"title": "label"
|
|
286
|
+
},
|
|
287
|
+
"enabled": {
|
|
288
|
+
"description": "Indicates the value of the item if it affects config-ui\n(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)",
|
|
289
|
+
"type": "boolean",
|
|
290
|
+
"title": "enabled"
|
|
266
291
|
}
|
|
267
292
|
}
|
|
268
293
|
},
|
|
@@ -363,9 +388,14 @@
|
|
|
363
388
|
}
|
|
364
389
|
},
|
|
365
390
|
"title": {
|
|
366
|
-
"title": "
|
|
391
|
+
"title": "TitleConfigProp",
|
|
367
392
|
"type": "object",
|
|
368
393
|
"properties": {
|
|
394
|
+
"placeholder": {
|
|
395
|
+
"description": "Indicates the placeholder for the title label",
|
|
396
|
+
"type": "string",
|
|
397
|
+
"title": "placeholder"
|
|
398
|
+
},
|
|
369
399
|
"settings": {
|
|
370
400
|
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
371
401
|
"type": "boolean",
|
|
@@ -695,10 +725,56 @@
|
|
|
695
725
|
}
|
|
696
726
|
}
|
|
697
727
|
},
|
|
698
|
-
"
|
|
699
|
-
"title": "
|
|
728
|
+
"LabelsConfigProp": {
|
|
729
|
+
"title": "LabelsConfigProp",
|
|
700
730
|
"type": "object",
|
|
701
731
|
"properties": {
|
|
732
|
+
"top": {
|
|
733
|
+
"description": "Indicates the placeholder for the top label",
|
|
734
|
+
"type": "string",
|
|
735
|
+
"title": "top"
|
|
736
|
+
},
|
|
737
|
+
"right": {
|
|
738
|
+
"description": "Indicates the placeholder for the right label",
|
|
739
|
+
"type": "string",
|
|
740
|
+
"title": "right"
|
|
741
|
+
},
|
|
742
|
+
"bottom": {
|
|
743
|
+
"description": "Indicates the placeholder for the bottom label",
|
|
744
|
+
"type": "string",
|
|
745
|
+
"title": "bottom"
|
|
746
|
+
},
|
|
747
|
+
"left": {
|
|
748
|
+
"description": "Indicates the placeholder for the left label",
|
|
749
|
+
"type": "string",
|
|
750
|
+
"title": "left"
|
|
751
|
+
},
|
|
752
|
+
"settings": {
|
|
753
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
754
|
+
"type": "boolean",
|
|
755
|
+
"title": "settings"
|
|
756
|
+
},
|
|
757
|
+
"label": {
|
|
758
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
759
|
+
"type": "string",
|
|
760
|
+
"title": "label"
|
|
761
|
+
},
|
|
762
|
+
"enabled": {
|
|
763
|
+
"description": "Indicates the value of the item if it affects config-ui\n(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)",
|
|
764
|
+
"type": "boolean",
|
|
765
|
+
"title": "enabled"
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
},
|
|
769
|
+
"TitleConfigProp": {
|
|
770
|
+
"title": "TitleConfigProp",
|
|
771
|
+
"type": "object",
|
|
772
|
+
"properties": {
|
|
773
|
+
"placeholder": {
|
|
774
|
+
"description": "Indicates the placeholder for the title label",
|
|
775
|
+
"type": "string",
|
|
776
|
+
"title": "placeholder"
|
|
777
|
+
},
|
|
702
778
|
"settings": {
|
|
703
779
|
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
704
780
|
"type": "boolean",
|
|
@@ -192,6 +192,22 @@ Indicates the label for the item that has to be displayed in the Settings Panel
|
|
|
192
192
|
|
|
193
193
|
Properties of the `labels` object:
|
|
194
194
|
|
|
195
|
+
## `top` (string)
|
|
196
|
+
|
|
197
|
+
Indicates the placeholder for the top label
|
|
198
|
+
|
|
199
|
+
## `right` (string)
|
|
200
|
+
|
|
201
|
+
Indicates the placeholder for the right label
|
|
202
|
+
|
|
203
|
+
## `bottom` (string)
|
|
204
|
+
|
|
205
|
+
Indicates the placeholder for the bottom label
|
|
206
|
+
|
|
207
|
+
## `left` (string)
|
|
208
|
+
|
|
209
|
+
Indicates the placeholder for the left label
|
|
210
|
+
|
|
195
211
|
## `settings` (boolean)
|
|
196
212
|
|
|
197
213
|
Indicates if the item has to be displayed in the Settings Panel
|
|
@@ -200,6 +216,11 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
200
216
|
|
|
201
217
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
202
218
|
|
|
219
|
+
## `enabled` (boolean)
|
|
220
|
+
|
|
221
|
+
Indicates the value of the item if it affects config-ui
|
|
222
|
+
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
223
|
+
|
|
203
224
|
# `prompt` (object)
|
|
204
225
|
|
|
205
226
|
Properties of the `prompt` object:
|
|
@@ -276,6 +297,10 @@ Indicates the label for the item that has to be displayed in the Settings Panel
|
|
|
276
297
|
|
|
277
298
|
Properties of the `title` object:
|
|
278
299
|
|
|
300
|
+
## `placeholder` (string)
|
|
301
|
+
|
|
302
|
+
Indicates the placeholder for the title label
|
|
303
|
+
|
|
279
304
|
## `settings` (boolean)
|
|
280
305
|
|
|
281
306
|
Indicates if the item has to be displayed in the Settings Panel
|
|
@@ -533,9 +558,46 @@ Indicates the maximum value for the graph width and height
|
|
|
533
558
|
|
|
534
559
|
Indicates the increase/decrease value for the graph width and height
|
|
535
560
|
|
|
536
|
-
## `
|
|
561
|
+
## `LabelsConfigProp` (object)
|
|
562
|
+
|
|
563
|
+
Properties of the `LabelsConfigProp` object:
|
|
564
|
+
|
|
565
|
+
### `top` (string)
|
|
566
|
+
|
|
567
|
+
Indicates the placeholder for the top label
|
|
568
|
+
|
|
569
|
+
### `right` (string)
|
|
570
|
+
|
|
571
|
+
Indicates the placeholder for the right label
|
|
572
|
+
|
|
573
|
+
### `bottom` (string)
|
|
574
|
+
|
|
575
|
+
Indicates the placeholder for the bottom label
|
|
576
|
+
|
|
577
|
+
### `left` (string)
|
|
578
|
+
|
|
579
|
+
Indicates the placeholder for the left label
|
|
580
|
+
|
|
581
|
+
### `settings` (boolean)
|
|
582
|
+
|
|
583
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
584
|
+
|
|
585
|
+
### `label` (string)
|
|
586
|
+
|
|
587
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
588
|
+
|
|
589
|
+
### `enabled` (boolean)
|
|
590
|
+
|
|
591
|
+
Indicates the value of the item if it affects config-ui
|
|
592
|
+
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
593
|
+
|
|
594
|
+
## `TitleConfigProp` (object)
|
|
595
|
+
|
|
596
|
+
Properties of the `TitleConfigProp` object:
|
|
597
|
+
|
|
598
|
+
### `placeholder` (string)
|
|
537
599
|
|
|
538
|
-
|
|
600
|
+
Indicates the placeholder for the title label
|
|
539
601
|
|
|
540
602
|
### `settings` (boolean)
|
|
541
603
|
|
package/docs/pie-schema.json
CHANGED
|
@@ -2043,10 +2043,56 @@
|
|
|
2043
2043
|
}
|
|
2044
2044
|
}
|
|
2045
2045
|
},
|
|
2046
|
-
"
|
|
2047
|
-
"title": "
|
|
2046
|
+
"LabelsConfigProp": {
|
|
2047
|
+
"title": "LabelsConfigProp",
|
|
2048
2048
|
"type": "object",
|
|
2049
2049
|
"properties": {
|
|
2050
|
+
"top": {
|
|
2051
|
+
"description": "Indicates the placeholder for the top label",
|
|
2052
|
+
"type": "string",
|
|
2053
|
+
"title": "top"
|
|
2054
|
+
},
|
|
2055
|
+
"right": {
|
|
2056
|
+
"description": "Indicates the placeholder for the right label",
|
|
2057
|
+
"type": "string",
|
|
2058
|
+
"title": "right"
|
|
2059
|
+
},
|
|
2060
|
+
"bottom": {
|
|
2061
|
+
"description": "Indicates the placeholder for the bottom label",
|
|
2062
|
+
"type": "string",
|
|
2063
|
+
"title": "bottom"
|
|
2064
|
+
},
|
|
2065
|
+
"left": {
|
|
2066
|
+
"description": "Indicates the placeholder for the left label",
|
|
2067
|
+
"type": "string",
|
|
2068
|
+
"title": "left"
|
|
2069
|
+
},
|
|
2070
|
+
"settings": {
|
|
2071
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
2072
|
+
"type": "boolean",
|
|
2073
|
+
"title": "settings"
|
|
2074
|
+
},
|
|
2075
|
+
"label": {
|
|
2076
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
2077
|
+
"type": "string",
|
|
2078
|
+
"title": "label"
|
|
2079
|
+
},
|
|
2080
|
+
"enabled": {
|
|
2081
|
+
"description": "Indicates the value of the item if it affects config-ui\n(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)",
|
|
2082
|
+
"type": "boolean",
|
|
2083
|
+
"title": "enabled"
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
},
|
|
2087
|
+
"TitleConfigProp": {
|
|
2088
|
+
"title": "TitleConfigProp",
|
|
2089
|
+
"type": "object",
|
|
2090
|
+
"properties": {
|
|
2091
|
+
"placeholder": {
|
|
2092
|
+
"description": "Indicates the placeholder for the title label",
|
|
2093
|
+
"type": "string",
|
|
2094
|
+
"title": "placeholder"
|
|
2095
|
+
},
|
|
2050
2096
|
"settings": {
|
|
2051
2097
|
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
2052
2098
|
"type": "boolean",
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -455,9 +455,46 @@ Indicates the maximum value for the graph width and height
|
|
|
455
455
|
|
|
456
456
|
Indicates the increase/decrease value for the graph width and height
|
|
457
457
|
|
|
458
|
-
## `
|
|
458
|
+
## `LabelsConfigProp` (object)
|
|
459
459
|
|
|
460
|
-
Properties of the `
|
|
460
|
+
Properties of the `LabelsConfigProp` object:
|
|
461
|
+
|
|
462
|
+
### `top` (string)
|
|
463
|
+
|
|
464
|
+
Indicates the placeholder for the top label
|
|
465
|
+
|
|
466
|
+
### `right` (string)
|
|
467
|
+
|
|
468
|
+
Indicates the placeholder for the right label
|
|
469
|
+
|
|
470
|
+
### `bottom` (string)
|
|
471
|
+
|
|
472
|
+
Indicates the placeholder for the bottom label
|
|
473
|
+
|
|
474
|
+
### `left` (string)
|
|
475
|
+
|
|
476
|
+
Indicates the placeholder for the left label
|
|
477
|
+
|
|
478
|
+
### `settings` (boolean)
|
|
479
|
+
|
|
480
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
481
|
+
|
|
482
|
+
### `label` (string)
|
|
483
|
+
|
|
484
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
485
|
+
|
|
486
|
+
### `enabled` (boolean)
|
|
487
|
+
|
|
488
|
+
Indicates the value of the item if it affects config-ui
|
|
489
|
+
(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
|
|
490
|
+
|
|
491
|
+
## `TitleConfigProp` (object)
|
|
492
|
+
|
|
493
|
+
Properties of the `TitleConfigProp` object:
|
|
494
|
+
|
|
495
|
+
### `placeholder` (string)
|
|
496
|
+
|
|
497
|
+
Indicates the placeholder for the title label
|
|
461
498
|
|
|
462
499
|
### `settings` (boolean)
|
|
463
500
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "3.5.4-next.
|
|
7
|
+
"version": "3.5.4-next.1169+0b62242d4",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"author": "",
|
|
26
26
|
"license": "ISC",
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "0b62242d44e666e59a8d8d9df369c45deb508cdf",
|
|
28
28
|
"main": "lib/index.js",
|
|
29
29
|
"module": "src/index.js"
|
|
30
30
|
}
|