@pie-element/graphing-solution-set 6.1.1-next.0 → 6.1.1-next.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +1 -0
- package/CHANGELOG.md +846 -0
- package/LICENSE.md +5 -0
- package/README.md +20 -0
- package/configure/CHANGELOG.json +1 -0
- package/configure/CHANGELOG.md +806 -0
- package/configure/lib/configure.js +312 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/correct-response.js +435 -0
- package/configure/lib/correct-response.js.map +1 -0
- package/configure/lib/defaults.js +357 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/graphing-config.js +408 -0
- package/configure/lib/graphing-config.js.map +1 -0
- package/configure/lib/index.js +163 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +630 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +29 -0
- package/controller/CHANGELOG.json +1 -0
- package/controller/CHANGELOG.md +671 -0
- package/controller/lib/defaults.js +69 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +351 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +212 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +22 -0
- package/demo-gss.gif +0 -0
- package/docs/config-schema.json +1560 -0
- package/docs/config-schema.json.md +1114 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +54 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +6 -0
- package/docs/pie-schema.json +1800 -0
- package/docs/pie-schema.json.md +952 -0
- package/lib/index.js +164 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +355 -0
- package/lib/main.js.map +1 -0
- package/lib/utils.js +515 -0
- package/lib/utils.js.map +1 -0
- package/package.json +22 -57
- package/dist/author/configure.d.ts +0 -26
- package/dist/author/configure.js +0 -190
- package/dist/author/correct-response.d.ts +0 -33
- package/dist/author/correct-response.js +0 -206
- package/dist/author/defaults.d.ts +0 -238
- package/dist/author/defaults.js +0 -339
- package/dist/author/graphing-config.d.ts +0 -33
- package/dist/author/graphing-config.js +0 -238
- package/dist/author/index.d.ts +0 -62
- package/dist/author/index.js +0 -87
- package/dist/author/utils.d.ts +0 -46
- package/dist/author/utils.js +0 -474
- package/dist/controller/defaults.d.ts +0 -64
- package/dist/controller/defaults.js +0 -54
- package/dist/controller/index.d.ts +0 -24
- package/dist/controller/index.js +0 -112
- package/dist/controller/utils.d.ts +0 -20
- package/dist/controller/utils.js +0 -42
- package/dist/delivery/index.d.ts +0 -22
- package/dist/delivery/index.js +0 -62
- package/dist/delivery/main.d.ts +0 -31
- package/dist/delivery/main.js +0 -198
- package/dist/delivery/utils.d.ts +0 -12
- package/dist/delivery/utils.js +0 -220
- package/dist/graphing-solution-set.css +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -404
- package/dist/index.js +0 -2
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +0 -22
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/set.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqWith.js +0 -7
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/graphing-solution-set/controller/src/utils.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
export declare const equalSegment: (segment1: any, segment2: any) => any;
|
|
10
|
-
export declare const sortedAnswers: (answers: any) => {};
|
|
11
|
-
export declare const equalLine: (line1: any, line2: any) => boolean;
|
|
12
|
-
export declare const constructSegmentsFromPoints: (points: any) => any;
|
|
13
|
-
export declare const removeDuplicateSegments: (segments: any) => any;
|
|
14
|
-
export declare const removeInvalidSegments: (segments: any) => any;
|
|
15
|
-
export declare const equalPolygon: (poly1: any, poly2: any) => boolean;
|
|
16
|
-
export declare const equalMarks: {
|
|
17
|
-
line: (sessAnswer: any, mark: any) => boolean;
|
|
18
|
-
polygon: (sessAnswer: any, poly: any) => boolean;
|
|
19
|
-
};
|
|
20
|
-
export declare const removeInvalidAnswers: (answers: any) => any;
|
package/dist/controller/utils.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js";
|
|
2
|
-
import t from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js";
|
|
3
|
-
import n from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js";
|
|
4
|
-
import r from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqWith.js";
|
|
5
|
-
//#region src/controller/utils.ts
|
|
6
|
-
var i = (e, n) => t(e.from, n.from) && t(e.to, n.to) || t(e.to, n.from) && t(e.from, n.to), a = (e) => Object.keys(e || {}).sort().reduce((t, n) => (n !== "correctAnswer" && (t[n] = e[n]), t), {}), o = (e) => {
|
|
7
|
-
e = {
|
|
8
|
-
...e,
|
|
9
|
-
to: { ...e.to },
|
|
10
|
-
from: { ...e.from }
|
|
11
|
-
};
|
|
12
|
-
let t = e.from.x, n = e.from.y, r = e.to.x, i = e.to.y;
|
|
13
|
-
return {
|
|
14
|
-
a: i - n,
|
|
15
|
-
b: t - r,
|
|
16
|
-
c: r * n - t * i
|
|
17
|
-
};
|
|
18
|
-
}, s = (e) => Math.round(e * 1e4) / 1e4, c = (e, t) => {
|
|
19
|
-
let { a: r, b: i, c: a } = o(e), { a: c, b: l, c: u } = o(t), d = [];
|
|
20
|
-
if (c !== 0) d.push(s(r / c));
|
|
21
|
-
else if (r !== c) return !1;
|
|
22
|
-
if (l !== 0) d.push(s(i / l));
|
|
23
|
-
else if (i !== l) return !1;
|
|
24
|
-
if (u !== 0) d.push(s(a / u));
|
|
25
|
-
else if (a !== u) return !1;
|
|
26
|
-
return n(d).length === 1 && e.fill === t.fill;
|
|
27
|
-
}, l = (e) => (e || []).map((t, n) => ({
|
|
28
|
-
from: t,
|
|
29
|
-
to: e[(n + 1) % e.length]
|
|
30
|
-
})), u = (e) => (e ||= [], r(e, (e, t) => i(e, t))), d = (e) => (e ||= [], e.filter((e) => !t(e.from, e.to))), f = (t, n) => {
|
|
31
|
-
let { points: r } = t, { points: a } = n, o = l(r), s = l(a), c = u(d(o)), f = u(d(s)), p = e(c, f, i), m = e(f, c, i);
|
|
32
|
-
return (!p || !p.length) && (!m || !m.length);
|
|
33
|
-
}, p = {
|
|
34
|
-
line: (e, t) => c(e, t),
|
|
35
|
-
polygon: (e, t) => f(e, t)
|
|
36
|
-
}, m = (e) => e && Number.isFinite(e.x) && Number.isFinite(e.y), h = {
|
|
37
|
-
point: m,
|
|
38
|
-
line: (e) => e && h.point(e.from) && h.point(e.to),
|
|
39
|
-
polygon: (e) => e && e.points && e.points.length && (e.points.filter((e) => m(e)) || []).length === e.points.length
|
|
40
|
-
}, g = (e) => e ? (e || []).filter(({ type: e, ...t }) => h[e] ? h[e](t) : !1) : [];
|
|
41
|
-
//#endregion
|
|
42
|
-
export { p as equalMarks, g as removeInvalidAnswers, a as sortedAnswers };
|
package/dist/delivery/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/graphing-solution-set/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import Main from './main.js';
|
|
10
|
-
export { Main as Component };
|
|
11
|
-
export default class Graphing extends HTMLElement {
|
|
12
|
-
constructor();
|
|
13
|
-
set model(m: any);
|
|
14
|
-
set session(s: any);
|
|
15
|
-
get session(): any;
|
|
16
|
-
connectedCallback(): void;
|
|
17
|
-
isComplete: (answer: any) => boolean;
|
|
18
|
-
changeAnswers: any;
|
|
19
|
-
setGssData: any;
|
|
20
|
-
_render(): void;
|
|
21
|
-
disconnectedCallback(): void;
|
|
22
|
-
}
|
package/dist/delivery/index.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { findSectionsInSolutionSet as e, removeInvalidAnswers as t } from "./utils.js";
|
|
2
|
-
import n from "./main.js";
|
|
3
|
-
import r from "react";
|
|
4
|
-
import { createRoot as i } from "react-dom/client";
|
|
5
|
-
import { SessionChangedEvent as a } from "@pie-element/shared-player-events";
|
|
6
|
-
import { renderMath as o } from "@pie-element/shared-math-rendering-mathjax";
|
|
7
|
-
//#region src/delivery/index.ts
|
|
8
|
-
var s = class extends HTMLElement {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(), this._root = null;
|
|
11
|
-
}
|
|
12
|
-
set model(e) {
|
|
13
|
-
this._model = e, this._render();
|
|
14
|
-
}
|
|
15
|
-
set session(t) {
|
|
16
|
-
this._session = t, this._session.answer || (this._session.answer = []);
|
|
17
|
-
let { answer: n } = this._session || {}, { gssLineData: r, domain: i, range: a } = this._model, o = n && n.filter((e) => e.type === "polygon").length > 0;
|
|
18
|
-
r.numberOfLines === 1 ? this._model.gssData = {
|
|
19
|
-
numberOfLines: 1,
|
|
20
|
-
selectedTool: o ? "solutionSet" : "lineA",
|
|
21
|
-
sections: [],
|
|
22
|
-
lineA: { lineType: n && n.length > 0 ? n[0].fill : "Solid" }
|
|
23
|
-
} : this._model.gssData = {
|
|
24
|
-
numberOfLines: 2,
|
|
25
|
-
selectedTool: o ? "solutionSet" : "lineA",
|
|
26
|
-
sections: [],
|
|
27
|
-
lineA: { lineType: n && n.length > 0 ? n[0].fill : "Solid" },
|
|
28
|
-
lineB: { lineType: n && n.length > 1 ? n[1].fill : "Solid" }
|
|
29
|
-
}, o && (this._model.gssData = e(this._model.gssData, n, i, a)), this._render();
|
|
30
|
-
}
|
|
31
|
-
get session() {
|
|
32
|
-
return this._session;
|
|
33
|
-
}
|
|
34
|
-
connectedCallback() {
|
|
35
|
-
this._render();
|
|
36
|
-
}
|
|
37
|
-
isComplete = (e) => Array.isArray(e) && e.length > 0;
|
|
38
|
-
changeAnswers = (e, n) => {
|
|
39
|
-
let { gssData: r } = this._model;
|
|
40
|
-
r.selectedTool === "lineA" && e.length > 0 && (e[0].fill = r.lineA.lineType), r.selectedTool === "lineB" && e.length > 1 && (e[1].fill = r.lineB.lineType), e.length === 0 && (r.selectedTool = "lineA", this._model.gssData = r), n ? this._session.answer = e : this._session.answer = t(e), this.dispatchEvent(new a(this.tagName.toLowerCase(), this.isComplete(this._session.answer))), this._render();
|
|
41
|
-
};
|
|
42
|
-
setGssData = (e, t) => {
|
|
43
|
-
this._model.gssData = e, this._session = t, this.dispatchEvent(new a(this.tagName.toLowerCase(), this.isComplete(this._session.answer))), this._render();
|
|
44
|
-
};
|
|
45
|
-
_render() {
|
|
46
|
-
if (!this._model || !this._session) return;
|
|
47
|
-
let e = r.createElement(n, {
|
|
48
|
-
model: this._model,
|
|
49
|
-
session: this._session,
|
|
50
|
-
onAnswersChange: this.changeAnswers,
|
|
51
|
-
setGssData: this.setGssData
|
|
52
|
-
});
|
|
53
|
-
this._root ||= i(this), this._root.render(e), queueMicrotask(() => {
|
|
54
|
-
o(this);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
disconnectedCallback() {
|
|
58
|
-
this._root && this._root.unmount();
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
//#endregion
|
|
62
|
-
export { n as Component, s as default };
|
package/dist/delivery/main.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/graphing-solution-set/src/main.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
export declare class Main extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
model: PropTypes.Validator<object>;
|
|
14
|
-
session: PropTypes.Validator<object>;
|
|
15
|
-
onAnswersChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
-
};
|
|
17
|
-
state: {
|
|
18
|
-
showingCorrect: boolean;
|
|
19
|
-
dialog: {
|
|
20
|
-
open: boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
handleAlertDialog: (open: any, callback: any) => void;
|
|
24
|
-
toggleCorrect: (showingCorrect: any) => void;
|
|
25
|
-
onResetClick: any;
|
|
26
|
-
onSolutionSetSelected: any;
|
|
27
|
-
onChangeGssLineData: any;
|
|
28
|
-
handleGssDataChange: any;
|
|
29
|
-
render(): React.JSX.Element;
|
|
30
|
-
}
|
|
31
|
-
export default Main;
|
package/dist/delivery/main.js
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { checkIfLinesAreAdded as e, findSectionsInSolutionSet as t, pointInsidePolygon as n } from "./utils.js";
|
|
2
|
-
import r from "react";
|
|
3
|
-
import i from "prop-types";
|
|
4
|
-
import { styled as a } from "@mui/material/styles";
|
|
5
|
-
import { GraphContainer as o } from "@pie-lib/graphing-solution-set";
|
|
6
|
-
import * as s from "@pie-lib/render-ui";
|
|
7
|
-
import { Collapsible as c, PreviewPrompt as l, UiLayout as u, color as d, hasMedia as f, hasText as p } from "@pie-lib/render-ui";
|
|
8
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
-
import g from "@pie-lib/correct-answer-toggle";
|
|
10
|
-
import { AlertDialog as _ } from "@pie-lib/config-ui";
|
|
11
|
-
//#region src/delivery/main.tsx
|
|
12
|
-
function v(e) {
|
|
13
|
-
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
14
|
-
}
|
|
15
|
-
function y(e, t) {
|
|
16
|
-
return !e || v(e) ? e : v(e.default) ? e.default : t && v(e[t]) ? e[t] : t && v(e[t]?.default) ? e[t].default : e;
|
|
17
|
-
}
|
|
18
|
-
var b = y(u, "UiLayout") || y(T.UiLayout, "UiLayout"), x = y(l, "PreviewPrompt") || y(T.PreviewPrompt, "PreviewPrompt"), S = y(c, "Collapsible") || y(T.Collapsible, "Collapsible"), C = s, w = C.default, T = w && typeof w == "object" ? w : C, E = a(b)({
|
|
19
|
-
color: d.text(),
|
|
20
|
-
backgroundColor: d.background()
|
|
21
|
-
}), D = a(S)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), O = a(o)(({ theme: e }) => ({
|
|
22
|
-
marginTop: e.spacing(2),
|
|
23
|
-
marginBottom: e.spacing(2)
|
|
24
|
-
})), k = class extends r.Component {
|
|
25
|
-
static propTypes = {
|
|
26
|
-
model: i.object.isRequired,
|
|
27
|
-
session: i.object.isRequired,
|
|
28
|
-
onAnswersChange: i.func
|
|
29
|
-
};
|
|
30
|
-
state = {
|
|
31
|
-
showingCorrect: !1,
|
|
32
|
-
dialog: { open: !1 }
|
|
33
|
-
};
|
|
34
|
-
handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
|
|
35
|
-
toggleCorrect = (e) => this.setState({ showingCorrect: e });
|
|
36
|
-
onResetClick = () => {
|
|
37
|
-
let { model: e, session: t, setGssData: n } = this.props, { gssData: r } = e;
|
|
38
|
-
this.setState({ dialog: {
|
|
39
|
-
open: !0,
|
|
40
|
-
title: "Warning",
|
|
41
|
-
text: "This will remove all the elements added on the graph and reset graph to original state. Are you sure you want to continue?",
|
|
42
|
-
onConfirm: () => {
|
|
43
|
-
t.answer = [], r.selectedTool = "lineA", r.lineA.lineType = "Solid", r.lineB && (r.lineB.lineType = "Solid"), n(r, t), this.handleAlertDialog(!1);
|
|
44
|
-
},
|
|
45
|
-
onClose: () => this.handleAlertDialog(!1)
|
|
46
|
-
} });
|
|
47
|
-
};
|
|
48
|
-
onSolutionSetSelected = (e) => {
|
|
49
|
-
let { model: t, session: r, setGssData: i } = this.props, { gssData: a, disabled: o } = t;
|
|
50
|
-
if (!o) {
|
|
51
|
-
for (let t of a.sections) if (n(e, t)) {
|
|
52
|
-
let e = {
|
|
53
|
-
points: t,
|
|
54
|
-
building: !1,
|
|
55
|
-
type: "polygon",
|
|
56
|
-
closed: !0,
|
|
57
|
-
isSolution: !0
|
|
58
|
-
};
|
|
59
|
-
r.answer = r.answer.filter((e) => e.type !== "polygon"), r.answer.push(e);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
i(a, r);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
onChangeGssLineData = (n, r) => {
|
|
66
|
-
let { model: i, session: a } = this.props, { domain: o, range: s, disabled: c } = i;
|
|
67
|
-
if (!c) if (n.selectedTool === "solutionSet") {
|
|
68
|
-
let i = a.answer.filter((e) => e.type !== "polygon");
|
|
69
|
-
if (!e(n, i)) n.selectedTool = r, this.setState({ dialog: {
|
|
70
|
-
open: !0,
|
|
71
|
-
title: "Warning",
|
|
72
|
-
text: "Please define the line(s) and then select a solution set for the item.",
|
|
73
|
-
onConfirm: () => this.handleAlertDialog(!1)
|
|
74
|
-
} });
|
|
75
|
-
else {
|
|
76
|
-
let e = a.answer.filter((e) => e.type !== "polygon");
|
|
77
|
-
n = t(n, e, o, s);
|
|
78
|
-
}
|
|
79
|
-
this.handleGssDataChange(n, a);
|
|
80
|
-
} else {
|
|
81
|
-
let e = a.answer.filter((e) => e.type === "polygon");
|
|
82
|
-
r === "solutionSet" && e.length > 0 ? this.setState({ dialog: {
|
|
83
|
-
open: !0,
|
|
84
|
-
title: "Warning",
|
|
85
|
-
text: "Changing a line after adding a solution set will clear your selected solution set. Click 'Clear Solution Set' to change the line. Otherwise, click 'Cancel'.",
|
|
86
|
-
onConfirm: () => {
|
|
87
|
-
a.answer = a.answer.filter((e) => e.type !== "polygon"), this.handleGssDataChange(n, a), this.handleAlertDialog(!1);
|
|
88
|
-
},
|
|
89
|
-
onConfirmText: "CLEAR SOLUTION SET",
|
|
90
|
-
onClose: () => {
|
|
91
|
-
n.selectedTool = r, this.handleGssDataChange(n, a), this.handleAlertDialog(!1);
|
|
92
|
-
}
|
|
93
|
-
} }) : this.handleGssDataChange(n, a);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
handleGssDataChange = (e, t) => {
|
|
97
|
-
let { setGssData: n } = this.props;
|
|
98
|
-
t.answer && t.answer.length > 0 && t.answer[0] && e.lineA && (t.answer[0].fill = e.lineA.lineType), t.answer && t.answer.length > 1 && t.answer[1] && e.lineB && (t.answer[1].fill = e.lineB.lineType), (e.selectedTool === "lineB" && t.answer.length === 0 || e.selectedTool === "lineB" && t.answer[0].building) && (this.setState({ dialog: {
|
|
99
|
-
open: !0,
|
|
100
|
-
title: "Warning",
|
|
101
|
-
text: "Please add Line A to the graph before adding Line B",
|
|
102
|
-
onConfirm: () => this.handleAlertDialog(!1)
|
|
103
|
-
} }), e.selectedTool = "lineA"), e.selectedTool === "lineA" && t.answer.length > 1 && t.answer[1].building && (this.setState({ dialog: {
|
|
104
|
-
open: !0,
|
|
105
|
-
title: "Warning",
|
|
106
|
-
text: "Please add Line B to the graph before switching to Line A",
|
|
107
|
-
onConfirm: () => this.handleAlertDialog(!1)
|
|
108
|
-
} }), e.selectedTool = "lineB"), n(e, t);
|
|
109
|
-
};
|
|
110
|
-
render() {
|
|
111
|
-
let { model: e, onAnswersChange: t, session: n } = this.props, { showingCorrect: r, dialog: i } = this.state, { answer: a } = n || {}, { answersCorrected: o, arrows: s, coordinatesOnHover: c, correctResponse: l, defaultTool: u, disabled: d, domain: v, extraCSSRules: y, labels: b, labelsEnabled: C, prompt: w, range: T, rationale: k, size: A, showToggle: j, title: M, titleEnabled: N, teacherInstructions: P, language: F, gssLineData: I, gssData: L } = e || {}, R = o || a || [], z = e.rationale && (p(e.rationale) || f(e.rationale));
|
|
112
|
-
return /* @__PURE__ */ h(E, {
|
|
113
|
-
extraCSSRules: y,
|
|
114
|
-
children: [
|
|
115
|
-
e.teacherInstructions && (p(e.teacherInstructions) || f(e.teacherInstructions)) && /* @__PURE__ */ m(D, {
|
|
116
|
-
labels: {
|
|
117
|
-
hidden: "Show Teacher Instructions",
|
|
118
|
-
visible: "Hide Teacher Instructions"
|
|
119
|
-
},
|
|
120
|
-
children: /* @__PURE__ */ m(x, { prompt: P })
|
|
121
|
-
}),
|
|
122
|
-
w && /* @__PURE__ */ m(x, {
|
|
123
|
-
className: "prompt",
|
|
124
|
-
prompt: w
|
|
125
|
-
}),
|
|
126
|
-
/* @__PURE__ */ m(g, {
|
|
127
|
-
show: j,
|
|
128
|
-
toggled: r,
|
|
129
|
-
onToggle: this.toggleCorrect,
|
|
130
|
-
language: F
|
|
131
|
-
}),
|
|
132
|
-
r && j ? /* @__PURE__ */ m(O, {
|
|
133
|
-
axesSettings: { includeArrows: s },
|
|
134
|
-
coordinatesOnHover: c,
|
|
135
|
-
disabled: !0,
|
|
136
|
-
disabledLabels: !0,
|
|
137
|
-
disabledTitle: !0,
|
|
138
|
-
domain: v,
|
|
139
|
-
labels: b,
|
|
140
|
-
marks: l.map((e) => ({
|
|
141
|
-
...e,
|
|
142
|
-
correctness: "correct"
|
|
143
|
-
})),
|
|
144
|
-
onChangeMarks: t,
|
|
145
|
-
range: T,
|
|
146
|
-
showLabels: C,
|
|
147
|
-
showTitle: N,
|
|
148
|
-
size: A,
|
|
149
|
-
title: M,
|
|
150
|
-
language: F,
|
|
151
|
-
gssLineData: I,
|
|
152
|
-
onChangeGssLineData: this.onChangeGssLineData,
|
|
153
|
-
onSolutionSetSelected: this.onSolutionSetSelected,
|
|
154
|
-
toolbarTools: ["line", "polygon"]
|
|
155
|
-
}) : /* @__PURE__ */ m(O, {
|
|
156
|
-
axesSettings: { includeArrows: s },
|
|
157
|
-
coordinatesOnHover: c,
|
|
158
|
-
defaultTool: u,
|
|
159
|
-
disabled: d,
|
|
160
|
-
disabledLabels: !0,
|
|
161
|
-
disabledTitle: !0,
|
|
162
|
-
domain: v,
|
|
163
|
-
labels: b,
|
|
164
|
-
marks: R,
|
|
165
|
-
onChangeMarks: t,
|
|
166
|
-
onCustomReset: this.onResetClick,
|
|
167
|
-
range: T,
|
|
168
|
-
showLabels: C,
|
|
169
|
-
showTitle: N,
|
|
170
|
-
size: A,
|
|
171
|
-
title: M,
|
|
172
|
-
language: F,
|
|
173
|
-
gssLineData: L,
|
|
174
|
-
onChangeGssLineData: this.onChangeGssLineData,
|
|
175
|
-
onSolutionSetSelected: this.onSolutionSetSelected,
|
|
176
|
-
toolbarTools: ["line", "polygon"]
|
|
177
|
-
}),
|
|
178
|
-
z && /* @__PURE__ */ m(S, {
|
|
179
|
-
labels: {
|
|
180
|
-
hidden: "Show Rationale",
|
|
181
|
-
visible: "Hide Rationale"
|
|
182
|
-
},
|
|
183
|
-
children: /* @__PURE__ */ m(x, { prompt: k })
|
|
184
|
-
}),
|
|
185
|
-
/* @__PURE__ */ m(_, {
|
|
186
|
-
open: i.open,
|
|
187
|
-
title: i.title,
|
|
188
|
-
text: i.text,
|
|
189
|
-
onClose: i.onClose,
|
|
190
|
-
onConfirm: i.onConfirm,
|
|
191
|
-
onConfirmText: i.onConfirmText ? i.onConfirmText : "OK"
|
|
192
|
-
})
|
|
193
|
-
]
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
//#endregion
|
|
198
|
-
export { k as default };
|
package/dist/delivery/utils.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/graphing-solution-set/src/utils.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
export declare const findSectionsInSolutionSet: (gssLineData: any, answers: any, domain: any, range: any) => any;
|
|
10
|
-
export declare const pointInsidePolygon: (point: any, polygon: any) => boolean;
|
|
11
|
-
export declare const checkIfLinesAreAdded: (gssLineData: any, answer: any) => boolean | undefined;
|
|
12
|
-
export declare const removeInvalidAnswers: (answers: any) => any;
|
package/dist/delivery/utils.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
var e = {
|
|
2
|
-
line: (t) => t && e.point(t.from) && e.point(t.to),
|
|
3
|
-
point: (e) => e && Number.isFinite(e.x) && Number.isFinite(e.y)
|
|
4
|
-
}, t = (e, t) => Number(Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2).toFixed(3)), n = (e, n) => {
|
|
5
|
-
let r = e, i = !1, a = [...n];
|
|
6
|
-
a.push(n[0]);
|
|
7
|
-
for (let e = 0; e < a.length - 1; e++) {
|
|
8
|
-
let n = a[e], o = a[e + 1];
|
|
9
|
-
if (t(n, r) + t(r, o) === t(n, o)) {
|
|
10
|
-
i = !0;
|
|
11
|
-
break;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return i;
|
|
15
|
-
}, r = (e, t, n, r, i, a, o, s) => {
|
|
16
|
-
let c, l = (s - a) * (n - e) - (o - i) * (r - t);
|
|
17
|
-
return l === 0 ? null : (c = ((o - i) * (t - a) - (s - a) * (e - i)) / l, {
|
|
18
|
-
x: Number((e + c * (n - e)).toFixed(3)),
|
|
19
|
-
y: Number((t + c * (r - t)).toFixed(3))
|
|
20
|
-
});
|
|
21
|
-
}, i = (e, t, n) => e.x > t.min && e.x < t.max && e.y > n.min && e.y < n.max, a = (e, t, n) => e.x >= t.min && e.x <= t.max && e.y >= n.min && e.y <= n.max, o = (e, t, n) => {
|
|
22
|
-
let i = [], o = [
|
|
23
|
-
[
|
|
24
|
-
t.max,
|
|
25
|
-
n.max,
|
|
26
|
-
t.max,
|
|
27
|
-
n.min
|
|
28
|
-
],
|
|
29
|
-
[
|
|
30
|
-
t.min,
|
|
31
|
-
n.max,
|
|
32
|
-
t.min,
|
|
33
|
-
n.min
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
t.min,
|
|
37
|
-
n.max,
|
|
38
|
-
t.max,
|
|
39
|
-
n.max
|
|
40
|
-
],
|
|
41
|
-
[
|
|
42
|
-
t.min,
|
|
43
|
-
n.min,
|
|
44
|
-
t.max,
|
|
45
|
-
n.min
|
|
46
|
-
]
|
|
47
|
-
];
|
|
48
|
-
for (let s = 0; s < o.length; s++) {
|
|
49
|
-
let c = r(e.from.x, e.from.y, e.to.x, e.to.y, o[s][0], o[s][1], o[s][2], o[s][3]);
|
|
50
|
-
c && a(c, t, n) && i.push(c);
|
|
51
|
-
}
|
|
52
|
-
return i;
|
|
53
|
-
}, s = (e) => {
|
|
54
|
-
e.sort((e, t) => e.y - t.y);
|
|
55
|
-
let t = (e[0].y + e[e.length - 1].y) / 2;
|
|
56
|
-
e.sort((e, t) => t.x - e.x);
|
|
57
|
-
let n = {
|
|
58
|
-
x: (e[0].x + e[e.length - 1].x) / 2,
|
|
59
|
-
y: t
|
|
60
|
-
}, r;
|
|
61
|
-
e.forEach((e) => {
|
|
62
|
-
let t = Math.atan2(e.y - n.y, e.x - n.x);
|
|
63
|
-
r ? t < r && (t += Math.PI * 2) : r = t, e.angle = t;
|
|
64
|
-
}), e.sort((e, t) => e.angle - t.angle);
|
|
65
|
-
let i = e.reverse();
|
|
66
|
-
return i.unshift(i.pop()), i.map(({ angle: e, ...t }) => t);
|
|
67
|
-
}, c = (e, t) => e.x * t.x + e.y * t.y, l = (e) => Math.sqrt(e.x * e.x + e.y * e.y), u = (e, t) => {
|
|
68
|
-
let n = c(e, t), r = l(e), i = l(t);
|
|
69
|
-
return Math.acos(n / (r * i));
|
|
70
|
-
}, d = (e, t, n, r) => {
|
|
71
|
-
let i = {
|
|
72
|
-
x: t.x - e.x,
|
|
73
|
-
y: t.y - e.y
|
|
74
|
-
}, a = {
|
|
75
|
-
x: n.x - e.x,
|
|
76
|
-
y: n.y - e.y
|
|
77
|
-
}, o = {
|
|
78
|
-
x: r.x - e.x,
|
|
79
|
-
y: r.y - e.y
|
|
80
|
-
}, s = u(i, o) + u(a, o);
|
|
81
|
-
return Math.abs(s - u(i, a)) < 1e-4;
|
|
82
|
-
}, f = (e) => e.filter((t, n) => n === e.findIndex((e) => t.x === e.x && t.y === e.y)), p = (e) => {
|
|
83
|
-
for (let t = 0; t < e.length; t++) e[t] = e[t].filter((n, r) => r === e[t].findIndex((e) => n.x === e.x && n.y === e.y));
|
|
84
|
-
e = e.filter((e) => e.length > 2);
|
|
85
|
-
for (let t = 0; t < e.length; t++) e[t] = s(e[t]);
|
|
86
|
-
return e;
|
|
87
|
-
}, m = (e, t, n) => {
|
|
88
|
-
let r = [];
|
|
89
|
-
return r.push([].concat(e)), r.push([].concat(e)), e[0].x === t.max && e[1].y === n.max || e[1].x === t.max && e[0].y === n.max ? (r[0].push({
|
|
90
|
-
x: t.max,
|
|
91
|
-
y: n.max
|
|
92
|
-
}), r[1].push({
|
|
93
|
-
x: t.min,
|
|
94
|
-
y: n.max
|
|
95
|
-
}, {
|
|
96
|
-
x: t.min,
|
|
97
|
-
y: n.min
|
|
98
|
-
}, {
|
|
99
|
-
x: t.max,
|
|
100
|
-
y: n.min
|
|
101
|
-
})) : e[0].x === t.min && e[1].y === n.max || e[1].x === t.min && e[0].y === n.max ? (r[0].push({
|
|
102
|
-
x: t.min,
|
|
103
|
-
y: n.max
|
|
104
|
-
}), r[1].push({
|
|
105
|
-
x: t.max,
|
|
106
|
-
y: n.max
|
|
107
|
-
}, {
|
|
108
|
-
x: t.max,
|
|
109
|
-
y: n.min
|
|
110
|
-
}, {
|
|
111
|
-
x: t.min,
|
|
112
|
-
y: n.min
|
|
113
|
-
})) : e[0].x === t.min && e[1].y === n.min || e[1].x === t.min && e[0].y === n.min ? (r[0].push({
|
|
114
|
-
x: t.min,
|
|
115
|
-
y: n.min
|
|
116
|
-
}), r[1].push({
|
|
117
|
-
x: t.max,
|
|
118
|
-
y: n.min
|
|
119
|
-
}, {
|
|
120
|
-
x: t.max,
|
|
121
|
-
y: n.max
|
|
122
|
-
}, {
|
|
123
|
-
x: t.min,
|
|
124
|
-
y: n.max
|
|
125
|
-
})) : e[0].x === t.max && e[1].y === n.min || e[1].x === t.max && e[0].y === n.min ? (r[0].push({
|
|
126
|
-
x: t.max,
|
|
127
|
-
y: n.min
|
|
128
|
-
}), r[1].push({
|
|
129
|
-
x: t.min,
|
|
130
|
-
y: n.min
|
|
131
|
-
}, {
|
|
132
|
-
x: t.min,
|
|
133
|
-
y: n.max
|
|
134
|
-
}, {
|
|
135
|
-
x: t.max,
|
|
136
|
-
y: n.max
|
|
137
|
-
})) : e[0].x === t.min && e[1].x === t.max || e[0].x === t.max && e[1].x === t.min ? (r[0].push({
|
|
138
|
-
x: t.min,
|
|
139
|
-
y: n.max
|
|
140
|
-
}, {
|
|
141
|
-
x: t.max,
|
|
142
|
-
y: n.max
|
|
143
|
-
}), r[1].push({
|
|
144
|
-
x: t.min,
|
|
145
|
-
y: n.min
|
|
146
|
-
}, {
|
|
147
|
-
x: t.max,
|
|
148
|
-
y: n.min
|
|
149
|
-
})) : (e[0].y === n.min && e[1].y === n.max || e[0].y === n.max && e[1].y === n.min) && (r[0].push({
|
|
150
|
-
x: t.min,
|
|
151
|
-
y: n.min
|
|
152
|
-
}, {
|
|
153
|
-
x: t.min,
|
|
154
|
-
y: n.max
|
|
155
|
-
}), r[1].push({
|
|
156
|
-
x: t.max,
|
|
157
|
-
y: n.min
|
|
158
|
-
}, {
|
|
159
|
-
x: t.max,
|
|
160
|
-
y: n.max
|
|
161
|
-
})), p(r);
|
|
162
|
-
}, h = (e, t, a, s) => {
|
|
163
|
-
let c = t[0], l = t[1], u = [
|
|
164
|
-
{
|
|
165
|
-
x: a.min,
|
|
166
|
-
y: s.min
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
x: a.min,
|
|
170
|
-
y: s.max
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
x: a.max,
|
|
174
|
-
y: s.min
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
x: a.max,
|
|
178
|
-
y: s.max
|
|
179
|
-
}
|
|
180
|
-
], h = r(c.from.x, c.from.y, c.to.x, c.to.y, l.from.x, l.from.y, l.to.x, l.to.y), g = [], _ = o(c, a, s);
|
|
181
|
-
_ = f(_);
|
|
182
|
-
let v = o(l, a, s);
|
|
183
|
-
if (v = f(v), h && i(h, a, s)) for (let e = 0; e < _.length; e++) for (let t = 0; t < v.length; t++) {
|
|
184
|
-
let n = [], r = [];
|
|
185
|
-
n.push(h), n.push(_[e]), n.push(v[t]);
|
|
186
|
-
for (let i = 0; i < u.length; i++) d(h, _[e], v[t], u[i]) ? n.push(u[i]) : r.push(u[i]);
|
|
187
|
-
u = r, g.push(n);
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
let e = m(_, a, s), t = m(v, a, s);
|
|
191
|
-
for (let t = 0; t < e.length; t++) n(v[0], e[t]) && n(v[1], e[t]) || g.push(e[t]);
|
|
192
|
-
for (let e = 0; e < t.length; e++) n(_[0], t[e]) && n(_[1], t[e]) || g.push(t[e]);
|
|
193
|
-
for (let e = 0; e < g.length; e++) u = u.filter(function(t) {
|
|
194
|
-
return !g[e].some(function(e) {
|
|
195
|
-
return t.x === e.x && t.y === e.y;
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
let r = u.concat(_, v);
|
|
199
|
-
g.push(r);
|
|
200
|
-
}
|
|
201
|
-
return p(g);
|
|
202
|
-
}, g = (e, t, n, r) => (e.numberOfLines === 1 ? e.sections = m(o(t[0], n, r), n, r) : e.sections = h(e, t, n, r), e), _ = (e, t) => {
|
|
203
|
-
let n = t.length, r = e.x, i = e.y, a = !1, o = t[0], s;
|
|
204
|
-
for (let e = 1; e <= n; e++) {
|
|
205
|
-
if (s = t[e % n], i > Math.min(o.y, s.y) && i <= Math.max(o.y, s.y) && r <= Math.max(o.x, s.x)) {
|
|
206
|
-
let e = (i - o.y) * (s.x - o.x) / (s.y - o.y) + o.x;
|
|
207
|
-
(o.x === s.x || r <= e) && (a = !a);
|
|
208
|
-
}
|
|
209
|
-
o = s;
|
|
210
|
-
}
|
|
211
|
-
return a;
|
|
212
|
-
}, v = (e, t) => {
|
|
213
|
-
if (t.length === 0) return !1;
|
|
214
|
-
if (e.numberOfLines === 1) {
|
|
215
|
-
if (t.length === 1) return !t[0].building;
|
|
216
|
-
} else if (t.length !== 2) return !1;
|
|
217
|
-
else return !t[1].building;
|
|
218
|
-
}, y = (t) => t ? (t || []).filter(({ type: t, ...n }) => e[t] ? e[t](n) : !1) : [];
|
|
219
|
-
//#endregion
|
|
220
|
-
export { v as checkIfLinesAreAdded, g as findSectionsInSolutionSet, _ as pointInsidePolygon, y as removeInvalidAnswers };
|