@pie-element/graphing-solution-set 0.1.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/dist/author/configure.d.ts +27 -0
- package/dist/author/configure.d.ts.map +1 -0
- package/dist/author/configure.js +190 -0
- package/dist/author/correct-response.d.ts +34 -0
- package/dist/author/correct-response.d.ts.map +1 -0
- package/dist/author/correct-response.js +206 -0
- package/dist/author/defaults.d.ts +239 -0
- package/dist/author/defaults.d.ts.map +1 -0
- package/dist/author/defaults.js +339 -0
- package/dist/author/graphing-config.d.ts +34 -0
- package/dist/author/graphing-config.d.ts.map +1 -0
- package/dist/author/graphing-config.js +238 -0
- package/dist/author/index.d.ts +63 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +87 -0
- package/dist/author/utils.d.ts +47 -0
- package/dist/author/utils.d.ts.map +1 -0
- package/dist/author/utils.js +474 -0
- package/dist/controller/defaults.d.ts +65 -0
- package/dist/controller/defaults.d.ts.map +1 -0
- package/dist/controller/defaults.js +54 -0
- package/dist/controller/index.d.ts +25 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/controller/index.js +112 -0
- package/dist/controller/utils.d.ts +21 -0
- package/dist/controller/utils.d.ts.map +1 -0
- package/dist/controller/utils.js +42 -0
- package/dist/delivery/index.d.ts +23 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +62 -0
- package/dist/delivery/main.d.ts +32 -0
- package/dist/delivery/main.d.ts.map +1 -0
- package/dist/delivery/main.js +198 -0
- package/dist/delivery/utils.d.ts +13 -0
- package/dist/delivery/utils.d.ts.map +1 -0
- package/dist/delivery/utils.js +220 -0
- package/dist/graphing-solution-set.css +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.iife.d.ts +9 -0
- package/dist/index.iife.d.ts.map +1 -0
- package/dist/index.iife.js +373 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludesWith.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseDifference.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFindIndex.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFlatten.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIndexOf.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNaN.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSet.js +22 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUniq.js +27 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isFlattenable.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_strictIndexOf.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/differenceWith.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/last.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/noop.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/set.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/uniq.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/uniqWith.js +7 -0
- package/package.json +70 -0
- package/src/author/configure.tsx +266 -0
- package/src/author/correct-response.tsx +408 -0
- package/src/author/defaults.tsx +366 -0
- package/src/author/graphing-config.tsx +318 -0
- package/src/author/index.ts +176 -0
- package/src/author/utils.ts +577 -0
- package/src/controller/defaults.ts +72 -0
- package/src/controller/index.ts +313 -0
- package/src/controller/utils.ts +195 -0
- package/src/delivery/index.ts +159 -0
- package/src/delivery/main.tsx +361 -0
- package/src/delivery/utils.ts +465 -0
- package/src/index.iife.ts +16 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/graphing-solution-set/configure/src/defaults.js
|
|
4
|
+
* @auto-generated
|
|
5
|
+
*
|
|
6
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
+
* Manual edits will be overwritten on next sync.
|
|
8
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* This file contains the default configuration for the Graphing Solution Set Item Type.
|
|
13
|
+
* Model is similar to the one used in graphing item type except for the gssLineData object which handles
|
|
14
|
+
* the configuration for the lines and the solution set.
|
|
15
|
+
*
|
|
16
|
+
* Same model is used in controller default.js
|
|
17
|
+
* */
|
|
18
|
+
export default {
|
|
19
|
+
model: {
|
|
20
|
+
answers: {
|
|
21
|
+
correctAnswer: {
|
|
22
|
+
name: 'Correct Answer',
|
|
23
|
+
marks: [],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
arrows: {
|
|
27
|
+
left: true,
|
|
28
|
+
right: true,
|
|
29
|
+
up: true,
|
|
30
|
+
down: true,
|
|
31
|
+
},
|
|
32
|
+
marks: [],
|
|
33
|
+
defaultGridConfiguration: 0,
|
|
34
|
+
domain: {
|
|
35
|
+
min: -5,
|
|
36
|
+
max: 5,
|
|
37
|
+
step: 1,
|
|
38
|
+
labelStep: 1,
|
|
39
|
+
axisLabel: 'x',
|
|
40
|
+
},
|
|
41
|
+
graph: {
|
|
42
|
+
width: 500,
|
|
43
|
+
height: 500,
|
|
44
|
+
},
|
|
45
|
+
gssLineData: {
|
|
46
|
+
numberOfLines: 1,
|
|
47
|
+
selectedTool: 'lineA',
|
|
48
|
+
sections: [],
|
|
49
|
+
lineA: {
|
|
50
|
+
lineType: 'Solid',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
includeAxes: true,
|
|
54
|
+
labels: {},
|
|
55
|
+
labelsEnabled: true,
|
|
56
|
+
padding: true,
|
|
57
|
+
prompt: '',
|
|
58
|
+
range: {
|
|
59
|
+
min: -5,
|
|
60
|
+
max: 5,
|
|
61
|
+
step: 1,
|
|
62
|
+
labelStep: 1,
|
|
63
|
+
axisLabel: 'y',
|
|
64
|
+
},
|
|
65
|
+
rationale: '',
|
|
66
|
+
standardGrid: false,
|
|
67
|
+
title: '',
|
|
68
|
+
coordinatesOnHover: false,
|
|
69
|
+
promptEnabled: true,
|
|
70
|
+
rationaleEnabled: true,
|
|
71
|
+
teacherInstructionsEnabled: true,
|
|
72
|
+
studentInstructionsEnabled: true,
|
|
73
|
+
},
|
|
74
|
+
configuration: {
|
|
75
|
+
authoring: {
|
|
76
|
+
settings: false,
|
|
77
|
+
label: 'Customize Grid Setup',
|
|
78
|
+
enabled: true,
|
|
79
|
+
includeAxesEnabled: false,
|
|
80
|
+
standardGridEnabled: true,
|
|
81
|
+
min: {
|
|
82
|
+
label: 'Min Value',
|
|
83
|
+
enabled: true,
|
|
84
|
+
},
|
|
85
|
+
max: {
|
|
86
|
+
label: 'Max Value',
|
|
87
|
+
enabled: true,
|
|
88
|
+
},
|
|
89
|
+
axisLabel: {
|
|
90
|
+
label: 'Label',
|
|
91
|
+
enabled: true,
|
|
92
|
+
},
|
|
93
|
+
step: {
|
|
94
|
+
label: 'Grid Interval',
|
|
95
|
+
enabled: true,
|
|
96
|
+
},
|
|
97
|
+
labelStep: {
|
|
98
|
+
label: 'Label Interval',
|
|
99
|
+
enabled: true,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
arrows: {
|
|
103
|
+
settings: true,
|
|
104
|
+
label: 'Include Arrows',
|
|
105
|
+
left: {
|
|
106
|
+
label: 'left',
|
|
107
|
+
},
|
|
108
|
+
right: {
|
|
109
|
+
label: 'right',
|
|
110
|
+
},
|
|
111
|
+
up: {
|
|
112
|
+
label: 'up',
|
|
113
|
+
},
|
|
114
|
+
down: {
|
|
115
|
+
label: 'down',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
gridConfigurations: [
|
|
119
|
+
{
|
|
120
|
+
label: '4-quadrant coordinate grid, -10 to 10',
|
|
121
|
+
arrows: {
|
|
122
|
+
left: true,
|
|
123
|
+
right: true,
|
|
124
|
+
up: true,
|
|
125
|
+
down: true,
|
|
126
|
+
},
|
|
127
|
+
domain: {
|
|
128
|
+
min: -10,
|
|
129
|
+
max: 10,
|
|
130
|
+
step: 1,
|
|
131
|
+
padding: 0,
|
|
132
|
+
labelStep: 1,
|
|
133
|
+
axisLabel: '<i>x</i>',
|
|
134
|
+
},
|
|
135
|
+
graph: {
|
|
136
|
+
width: 480,
|
|
137
|
+
height: 480,
|
|
138
|
+
},
|
|
139
|
+
includeAxes: true,
|
|
140
|
+
labels: {
|
|
141
|
+
top: '',
|
|
142
|
+
right: '',
|
|
143
|
+
bottom: '',
|
|
144
|
+
left: '',
|
|
145
|
+
},
|
|
146
|
+
padding: true,
|
|
147
|
+
range: {
|
|
148
|
+
min: -10,
|
|
149
|
+
max: 10,
|
|
150
|
+
step: 1,
|
|
151
|
+
padding: 0,
|
|
152
|
+
labelStep: 1,
|
|
153
|
+
axisLabel: '<i>y</i>',
|
|
154
|
+
},
|
|
155
|
+
standardGrid: true,
|
|
156
|
+
title: '',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: '0 to 10 on both axes',
|
|
160
|
+
arrows: {
|
|
161
|
+
left: false,
|
|
162
|
+
right: true,
|
|
163
|
+
up: true,
|
|
164
|
+
down: false,
|
|
165
|
+
},
|
|
166
|
+
domain: {
|
|
167
|
+
min: 0,
|
|
168
|
+
max: 10,
|
|
169
|
+
step: 1,
|
|
170
|
+
padding: 0,
|
|
171
|
+
labelStep: 1,
|
|
172
|
+
axisLabel: '<i>x</i>',
|
|
173
|
+
},
|
|
174
|
+
graph: {
|
|
175
|
+
width: 480,
|
|
176
|
+
height: 480,
|
|
177
|
+
},
|
|
178
|
+
includeAxes: true,
|
|
179
|
+
labels: {
|
|
180
|
+
top: '',
|
|
181
|
+
right: '',
|
|
182
|
+
bottom: '',
|
|
183
|
+
left: '',
|
|
184
|
+
},
|
|
185
|
+
padding: true,
|
|
186
|
+
range: {
|
|
187
|
+
min: 0,
|
|
188
|
+
max: 10,
|
|
189
|
+
step: 1,
|
|
190
|
+
padding: 0,
|
|
191
|
+
labelStep: 1,
|
|
192
|
+
axisLabel: '<i>y</i>',
|
|
193
|
+
},
|
|
194
|
+
standardGrid: true,
|
|
195
|
+
title: '',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
label: '0 to 20 on both axes',
|
|
199
|
+
arrows: {
|
|
200
|
+
left: false,
|
|
201
|
+
right: true,
|
|
202
|
+
up: true,
|
|
203
|
+
down: false,
|
|
204
|
+
},
|
|
205
|
+
domain: {
|
|
206
|
+
min: 0,
|
|
207
|
+
max: 20,
|
|
208
|
+
step: 1,
|
|
209
|
+
padding: 0,
|
|
210
|
+
labelStep: 1,
|
|
211
|
+
axisLabel: '<i>x</i>',
|
|
212
|
+
},
|
|
213
|
+
graph: {
|
|
214
|
+
width: 480,
|
|
215
|
+
height: 480,
|
|
216
|
+
},
|
|
217
|
+
includeAxes: true,
|
|
218
|
+
labels: {
|
|
219
|
+
top: '',
|
|
220
|
+
right: '',
|
|
221
|
+
bottom: '',
|
|
222
|
+
left: '',
|
|
223
|
+
},
|
|
224
|
+
padding: true,
|
|
225
|
+
range: {
|
|
226
|
+
min: 0,
|
|
227
|
+
max: 20,
|
|
228
|
+
step: 1,
|
|
229
|
+
padding: 0,
|
|
230
|
+
labelStep: 1,
|
|
231
|
+
axisLabel: '<i>y</i>',
|
|
232
|
+
},
|
|
233
|
+
standardGrid: true,
|
|
234
|
+
title: '',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: 'Sample Data Graph',
|
|
238
|
+
arrows: {
|
|
239
|
+
left: false,
|
|
240
|
+
right: true,
|
|
241
|
+
up: true,
|
|
242
|
+
down: false,
|
|
243
|
+
},
|
|
244
|
+
domain: {
|
|
245
|
+
min: 0,
|
|
246
|
+
max: 30,
|
|
247
|
+
step: 1,
|
|
248
|
+
padding: 0,
|
|
249
|
+
labelStep: 2,
|
|
250
|
+
axisLabel: '<i>t</i>',
|
|
251
|
+
},
|
|
252
|
+
graph: {
|
|
253
|
+
width: 480,
|
|
254
|
+
height: 480,
|
|
255
|
+
},
|
|
256
|
+
includeAxes: true,
|
|
257
|
+
labels: {
|
|
258
|
+
top: '',
|
|
259
|
+
right: '',
|
|
260
|
+
bottom: 'Time (seconds)',
|
|
261
|
+
left: 'Distance (meters)',
|
|
262
|
+
},
|
|
263
|
+
padding: true,
|
|
264
|
+
range: {
|
|
265
|
+
min: 0,
|
|
266
|
+
max: 80,
|
|
267
|
+
step: 5,
|
|
268
|
+
padding: 0,
|
|
269
|
+
labelStep: 10,
|
|
270
|
+
axisLabel: '<i>d</i>',
|
|
271
|
+
},
|
|
272
|
+
standardGrid: false,
|
|
273
|
+
title: 'Distance as a function of time',
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
graphDimensions: {
|
|
277
|
+
settings: false,
|
|
278
|
+
label: 'Graph Dimensions',
|
|
279
|
+
enabled: true,
|
|
280
|
+
min: 150,
|
|
281
|
+
max: 800,
|
|
282
|
+
step: 20,
|
|
283
|
+
},
|
|
284
|
+
padding: {
|
|
285
|
+
settings: false,
|
|
286
|
+
label: 'Padding',
|
|
287
|
+
},
|
|
288
|
+
labels: {
|
|
289
|
+
settings: true,
|
|
290
|
+
label: 'Graph Labels',
|
|
291
|
+
enabled: true,
|
|
292
|
+
top: 'Click here to add a top label',
|
|
293
|
+
right: 'Click here to add a right label',
|
|
294
|
+
bottom: 'Click here to add a bottom label',
|
|
295
|
+
left: 'Click here to add a left label',
|
|
296
|
+
},
|
|
297
|
+
prompt: {
|
|
298
|
+
settings: true,
|
|
299
|
+
label: 'Item Stem',
|
|
300
|
+
},
|
|
301
|
+
rationale: {
|
|
302
|
+
settings: true,
|
|
303
|
+
label: 'Rationale',
|
|
304
|
+
},
|
|
305
|
+
scoringType: {
|
|
306
|
+
settings: false,
|
|
307
|
+
label: 'Scoring Type',
|
|
308
|
+
},
|
|
309
|
+
studentInstructions: {
|
|
310
|
+
settings: false,
|
|
311
|
+
label: 'Student Instructions',
|
|
312
|
+
},
|
|
313
|
+
teacherInstructions: {
|
|
314
|
+
settings: true,
|
|
315
|
+
label: 'Teacher Instructions',
|
|
316
|
+
},
|
|
317
|
+
title: {
|
|
318
|
+
settings: true,
|
|
319
|
+
label: 'Graph Title',
|
|
320
|
+
enabled: true,
|
|
321
|
+
placeholder: 'Click here to add a title for this graph',
|
|
322
|
+
},
|
|
323
|
+
instruction: {
|
|
324
|
+
settings: false,
|
|
325
|
+
label:
|
|
326
|
+
'Graphing Solution Set items involve plotting one or two lines on a graph and then selecting the correct area that represents the solution set. To create one, first configure the grid, then select if one or two lines will be offered and if the lines should be solid or dashed. After defining the line(s), define the correct answer by clicking the area that represents the solution set.',
|
|
327
|
+
},
|
|
328
|
+
settingsPanelDisabled: false,
|
|
329
|
+
spellCheck: {
|
|
330
|
+
label: 'Spellcheck',
|
|
331
|
+
settings: false,
|
|
332
|
+
enabled: true,
|
|
333
|
+
},
|
|
334
|
+
coordinatesOnHover: {
|
|
335
|
+
settings: true,
|
|
336
|
+
label: 'Coordinates on Hover',
|
|
337
|
+
},
|
|
338
|
+
maxImageWidth: {
|
|
339
|
+
teacherInstructions: 300,
|
|
340
|
+
prompt: 300,
|
|
341
|
+
rationale: 300,
|
|
342
|
+
},
|
|
343
|
+
maxImageHeight: {
|
|
344
|
+
teacherInstructions: 300,
|
|
345
|
+
prompt: 300,
|
|
346
|
+
rationale: 300,
|
|
347
|
+
},
|
|
348
|
+
withRubric: {
|
|
349
|
+
settings: false,
|
|
350
|
+
label: 'Add Rubric',
|
|
351
|
+
},
|
|
352
|
+
language: {
|
|
353
|
+
settings: false,
|
|
354
|
+
label: 'Specify Language',
|
|
355
|
+
enabled: false,
|
|
356
|
+
},
|
|
357
|
+
languageChoices: {
|
|
358
|
+
label: 'Language Choices',
|
|
359
|
+
options: [],
|
|
360
|
+
},
|
|
361
|
+
mathMlOptions: {
|
|
362
|
+
mmlOutput: false,
|
|
363
|
+
mmlEditing: false,
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
};
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @synced-from pie-elements/packages/graphing-solution-set/configure/src/graphing-config.jsx
|
|
4
|
+
* @auto-generated
|
|
5
|
+
*
|
|
6
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
+
* Manual edits will be overwritten on next sync.
|
|
8
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
13
|
+
import { GraphContainer, GridSetup } from '@pie-lib/graphing-solution-set';
|
|
14
|
+
import { AlertDialog } from '@pie-lib/config-ui';
|
|
15
|
+
import { MenuItem, Select, Typography, OutlinedInput } from '@mui/material';
|
|
16
|
+
import { styled } from '@mui/material/styles';
|
|
17
|
+
import { applyConstraints, filterPlotableMarks, getGridValues, getLabelValues } from './utils.js';
|
|
18
|
+
import { isEqual, cloneDeep } from 'lodash-es';
|
|
19
|
+
|
|
20
|
+
const Container: any = styled('div')(({ theme }) => ({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexWrap: 'wrap',
|
|
23
|
+
marginBottom: theme.spacing(2.5),
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
const GridConfigWrapper: any = styled('div')(({ theme }) => ({
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
marginRight: theme.spacing(3),
|
|
30
|
+
marginBottom: theme.spacing(2.5),
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
const GraphConfig: any = styled('div')({
|
|
34
|
+
display: 'flex',
|
|
35
|
+
flexDirection: 'column',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const SubtitleText: any = styled(Typography)(({ theme }) => ({
|
|
39
|
+
marginTop: theme.spacing(1.5),
|
|
40
|
+
marginBottom: theme.spacing(1),
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
const GridConfig: any = styled('div')(({ theme }) => ({
|
|
44
|
+
display: 'flex',
|
|
45
|
+
flexWrap: 'wrap',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
width: '100%',
|
|
48
|
+
marginBottom: theme.spacing(2.5),
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
const GridConfigLabel: any = styled(Typography)(({ theme }) => ({
|
|
52
|
+
padding: `0 ${theme.spacing(1)}`,
|
|
53
|
+
}));
|
|
54
|
+
|
|
55
|
+
const GridConfigSelect: any = styled(Select)({
|
|
56
|
+
flex: '1',
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export class GraphingConfig extends React.Component {
|
|
60
|
+
static propTypes = {
|
|
61
|
+
availableTools: PropTypes.array,
|
|
62
|
+
authoring: PropTypes.object,
|
|
63
|
+
dimensionsEnabled: PropTypes.bool,
|
|
64
|
+
graphDimensions: PropTypes.object,
|
|
65
|
+
gridConfigurations: PropTypes.array,
|
|
66
|
+
labelsPlaceholders: PropTypes.object,
|
|
67
|
+
model: PropTypes.object.isRequired,
|
|
68
|
+
onChange: PropTypes.func.isRequired,
|
|
69
|
+
showLabels: PropTypes.bool,
|
|
70
|
+
showTitle: PropTypes.bool,
|
|
71
|
+
titlePlaceholder: PropTypes.string,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
constructor(props) {
|
|
75
|
+
super(props);
|
|
76
|
+
const { domain, range, graph } = props.model || {};
|
|
77
|
+
const gridValues = {
|
|
78
|
+
domain: getGridValues(domain, graph.width, true),
|
|
79
|
+
range: getGridValues(range, graph.height, true),
|
|
80
|
+
};
|
|
81
|
+
const labelValues = {
|
|
82
|
+
domain: getLabelValues(domain.step),
|
|
83
|
+
range: getLabelValues(range.step),
|
|
84
|
+
};
|
|
85
|
+
this.state = {
|
|
86
|
+
gridValues,
|
|
87
|
+
labelValues,
|
|
88
|
+
showPixelGuides: false,
|
|
89
|
+
dialog: { isOpened: false },
|
|
90
|
+
domain: { ...domain },
|
|
91
|
+
range: { ...range },
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* Function to change labels
|
|
97
|
+
* @param {object} labels - labels object
|
|
98
|
+
* */
|
|
99
|
+
changeLabels: any = (labels) => {
|
|
100
|
+
const { model, onChange } = this.props;
|
|
101
|
+
onChange({ ...model, labels });
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
* Function to change title
|
|
106
|
+
* @param {string} title - title string
|
|
107
|
+
* */
|
|
108
|
+
changeTitle: any = (title) => {
|
|
109
|
+
const { model, onChange } = this.props;
|
|
110
|
+
onChange({ ...model, title });
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/*
|
|
114
|
+
* Function to change grid configuration
|
|
115
|
+
* @param {object} config - grid configuration object
|
|
116
|
+
* @param {number} newSelectedGrid - new selected grid
|
|
117
|
+
* */
|
|
118
|
+
onConfigChange: any = (config, newSelectedGrid) => {
|
|
119
|
+
const { model, onChange } = this.props;
|
|
120
|
+
const { defaultGridConfiguration: oldSelectedGrid = 0 } = model;
|
|
121
|
+
const { gridValues: oldGridValues, labelValues: oldLabelValues, domain: oldDomain, range: oldRange } = this.state;
|
|
122
|
+
const updatedModel = { ...model, ...config };
|
|
123
|
+
const { answers, domain, includeAxes = true, graph, range, standardGrid } = updatedModel;
|
|
124
|
+
const gridValues = { domain: [], range: [] };
|
|
125
|
+
const labelValues = { domain: [], range: [] };
|
|
126
|
+
const selectedGrid = newSelectedGrid >= 0 ? newSelectedGrid : oldSelectedGrid;
|
|
127
|
+
if (includeAxes) {
|
|
128
|
+
const domainConstraints = applyConstraints(domain, graph.width, oldGridValues.domain, oldLabelValues.domain);
|
|
129
|
+
gridValues.domain = domainConstraints.gridValues || [];
|
|
130
|
+
labelValues.domain = domainConstraints.labelValues || [];
|
|
131
|
+
}
|
|
132
|
+
if (standardGrid) {
|
|
133
|
+
gridValues.range = gridValues.domain;
|
|
134
|
+
labelValues.range = labelValues.domain;
|
|
135
|
+
range.step = domain.step;
|
|
136
|
+
range.labelStep = domain.labelStep;
|
|
137
|
+
} else {
|
|
138
|
+
if (includeAxes) {
|
|
139
|
+
const rangeConstraints = applyConstraints(range, graph.height, oldGridValues.range, oldLabelValues.range);
|
|
140
|
+
gridValues.range = rangeConstraints.gridValues || [];
|
|
141
|
+
labelValues.range = rangeConstraints.labelValues || [];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const filteredAnswers = cloneDeep(answers);
|
|
145
|
+
filteredAnswers.correctAnswer.marks = answers.correctAnswer.marks.filter((mark) => mark.type !== 'polygon');
|
|
146
|
+
const plotableAnswers = filterPlotableMarks(domain, range, filteredAnswers);
|
|
147
|
+
if (!isEqual(filteredAnswers, plotableAnswers)) {
|
|
148
|
+
this.setState({
|
|
149
|
+
dialog: {
|
|
150
|
+
isOpened: true,
|
|
151
|
+
onClose: () =>
|
|
152
|
+
this.setState({ dialog: { isOpened: false } }, onChange({ ...model, domain: oldDomain, range: oldRange })),
|
|
153
|
+
onConfirm: () => {
|
|
154
|
+
updatedModel.gssLineData.sections = [];
|
|
155
|
+
updatedModel.gssLineData.selectedTool = 'lineA';
|
|
156
|
+
this.setState(
|
|
157
|
+
{
|
|
158
|
+
gridValues,
|
|
159
|
+
labelValues,
|
|
160
|
+
dialog: { isOpened: false },
|
|
161
|
+
domain: { ...domain },
|
|
162
|
+
range: { ...range },
|
|
163
|
+
},
|
|
164
|
+
onChange({ ...updatedModel, answers: plotableAnswers, defaultGridConfiguration: selectedGrid }),
|
|
165
|
+
);
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
this.setState({ gridValues, labelValues, domain: { ...domain }, range: { ...range } });
|
|
172
|
+
onChange({ ...updatedModel, defaultGridConfiguration: selectedGrid });
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/*
|
|
176
|
+
* Function to change view
|
|
177
|
+
* @param {object} event - event object
|
|
178
|
+
* @param {boolean} expanded - expanded boolean
|
|
179
|
+
* */
|
|
180
|
+
onChangeView: any = (event, expanded) => {
|
|
181
|
+
const { graphDimensions: { enabled } = {} } = this.props;
|
|
182
|
+
if (enabled) {
|
|
183
|
+
this.setState({ showPixelGuides: expanded });
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/*
|
|
188
|
+
* Function to change grid configuration
|
|
189
|
+
* @param {object} event - event object
|
|
190
|
+
* */
|
|
191
|
+
changeGridConfiguration: any = (event) => {
|
|
192
|
+
const { gridConfigurations } = this.props;
|
|
193
|
+
const { value } = event.target;
|
|
194
|
+
this.onConfigChange(gridConfigurations?.[value] || {}, value);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/*
|
|
198
|
+
* Render the component
|
|
199
|
+
* */
|
|
200
|
+
render() {
|
|
201
|
+
const {
|
|
202
|
+
authoring = {},
|
|
203
|
+
gridConfigurations = [],
|
|
204
|
+
graphDimensions = {},
|
|
205
|
+
labelsPlaceholders,
|
|
206
|
+
model,
|
|
207
|
+
showLabels,
|
|
208
|
+
dimensionsEnabled,
|
|
209
|
+
showTitle,
|
|
210
|
+
titlePlaceholder,
|
|
211
|
+
mathMlOptions = {},
|
|
212
|
+
} = this.props;
|
|
213
|
+
const { arrows, coordinatesOnHover, defaultGridConfiguration, domain, labels, range, standardGrid, title } =
|
|
214
|
+
model || {};
|
|
215
|
+
const graph = (model || {}).graph || {};
|
|
216
|
+
const { min, max, step } = graphDimensions || {};
|
|
217
|
+
const { dialog = {}, gridValues, labelValues, showPixelGuides } = this.state;
|
|
218
|
+
const sizeConstraints = {
|
|
219
|
+
min: Math.max(150, min),
|
|
220
|
+
max: Math.min(800, max),
|
|
221
|
+
step: step >= 1 ? Math.min(200, step) : 20,
|
|
222
|
+
};
|
|
223
|
+
const displayedFields = {
|
|
224
|
+
axisLabel: authoring.axisLabel,
|
|
225
|
+
dimensionsEnabled,
|
|
226
|
+
includeAxesEnabled: false, //Setting false by default as per requirement
|
|
227
|
+
labelStep: authoring.labelStep,
|
|
228
|
+
min: authoring.min,
|
|
229
|
+
max: authoring.max,
|
|
230
|
+
standardGridEnabled: authoring.standardGridEnabled,
|
|
231
|
+
step: authoring.step,
|
|
232
|
+
};
|
|
233
|
+
const displayGridSetup =
|
|
234
|
+
authoring.enabled &&
|
|
235
|
+
Object.values(displayedFields).some((field) => (typeof field === 'object' ? field.enabled : field));
|
|
236
|
+
return (
|
|
237
|
+
<Container>
|
|
238
|
+
<GridConfigWrapper>
|
|
239
|
+
{gridConfigurations && gridConfigurations.length ? (
|
|
240
|
+
<GridConfig>
|
|
241
|
+
<GridConfigLabel component="div" variant="h6">
|
|
242
|
+
Grid Configuration
|
|
243
|
+
</GridConfigLabel>
|
|
244
|
+
<GridConfigSelect
|
|
245
|
+
input={<OutlinedInput labelWidth={10} />}
|
|
246
|
+
displayEmpty
|
|
247
|
+
onChange={this.changeGridConfiguration}
|
|
248
|
+
value={defaultGridConfiguration}
|
|
249
|
+
MenuProps={{ transitionDuration: { enter: 225, exit: 195 } }}
|
|
250
|
+
>
|
|
251
|
+
{(gridConfigurations || []).map((config, index) => (
|
|
252
|
+
<MenuItem key={index} value={index}>
|
|
253
|
+
{config.label}
|
|
254
|
+
</MenuItem>
|
|
255
|
+
))}
|
|
256
|
+
</GridConfigSelect>
|
|
257
|
+
</GridConfig>
|
|
258
|
+
) : null}
|
|
259
|
+
{displayGridSetup && (
|
|
260
|
+
<GridSetup
|
|
261
|
+
displayedFields={displayedFields}
|
|
262
|
+
domain={domain}
|
|
263
|
+
gridValues={gridValues}
|
|
264
|
+
includeAxes={true} //Setting true by default as per requirement
|
|
265
|
+
labelValues={labelValues}
|
|
266
|
+
range={range}
|
|
267
|
+
size={graph}
|
|
268
|
+
sizeConstraints={sizeConstraints}
|
|
269
|
+
standardGrid={standardGrid}
|
|
270
|
+
onChange={this.onConfigChange}
|
|
271
|
+
onChangeView={this.onChangeView}
|
|
272
|
+
/>
|
|
273
|
+
)}
|
|
274
|
+
</GridConfigWrapper>
|
|
275
|
+
<GraphConfig key="graph">
|
|
276
|
+
<Typography component="div" variant="h6">
|
|
277
|
+
Define Graph Attributes
|
|
278
|
+
</Typography>
|
|
279
|
+
<SubtitleText component="div" variant="body1">
|
|
280
|
+
Use this interface to add/edit a title and/or labels
|
|
281
|
+
</SubtitleText>
|
|
282
|
+
<GraphContainer
|
|
283
|
+
axesSettings={{ includeArrows: arrows }}
|
|
284
|
+
backgroundMarks={[]}
|
|
285
|
+
coordinatesOnHover={coordinatesOnHover}
|
|
286
|
+
collapsibleToolbar={true}
|
|
287
|
+
collapsibleToolbarTitle={'Add Background Shapes to Graph'}
|
|
288
|
+
domain={domain}
|
|
289
|
+
key="graphing-config"
|
|
290
|
+
labels={labels}
|
|
291
|
+
labelsPlaceholders={labelsPlaceholders}
|
|
292
|
+
marks={[]}
|
|
293
|
+
onChangeLabels={this.changeLabels}
|
|
294
|
+
onChangeTitle={this.changeTitle}
|
|
295
|
+
range={range}
|
|
296
|
+
showLabels={showLabels}
|
|
297
|
+
showPixelGuides={showPixelGuides}
|
|
298
|
+
showTitle={showTitle}
|
|
299
|
+
size={{ width: graph.width, height: graph.height }}
|
|
300
|
+
title={title}
|
|
301
|
+
titlePlaceholder={titlePlaceholder}
|
|
302
|
+
disableToolbar={true}
|
|
303
|
+
mathMlOptions={mathMlOptions}
|
|
304
|
+
/>
|
|
305
|
+
</GraphConfig>
|
|
306
|
+
<AlertDialog
|
|
307
|
+
open={dialog.isOpened}
|
|
308
|
+
title="Warning"
|
|
309
|
+
text="This change would make it impossible for students to plot one or more graph objects in the current correct answers. If you proceed, all such graph objects will be removed from the correct answers."
|
|
310
|
+
onClose={dialog.onClose}
|
|
311
|
+
onConfirm={dialog.onConfirm}
|
|
312
|
+
/>
|
|
313
|
+
</Container>
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export default GraphingConfig;
|