@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.
Files changed (217) hide show
  1. package/dist/author/configure.d.ts +27 -0
  2. package/dist/author/configure.d.ts.map +1 -0
  3. package/dist/author/configure.js +190 -0
  4. package/dist/author/correct-response.d.ts +34 -0
  5. package/dist/author/correct-response.d.ts.map +1 -0
  6. package/dist/author/correct-response.js +206 -0
  7. package/dist/author/defaults.d.ts +239 -0
  8. package/dist/author/defaults.d.ts.map +1 -0
  9. package/dist/author/defaults.js +339 -0
  10. package/dist/author/graphing-config.d.ts +34 -0
  11. package/dist/author/graphing-config.d.ts.map +1 -0
  12. package/dist/author/graphing-config.js +238 -0
  13. package/dist/author/index.d.ts +63 -0
  14. package/dist/author/index.d.ts.map +1 -0
  15. package/dist/author/index.js +87 -0
  16. package/dist/author/utils.d.ts +47 -0
  17. package/dist/author/utils.d.ts.map +1 -0
  18. package/dist/author/utils.js +474 -0
  19. package/dist/controller/defaults.d.ts +65 -0
  20. package/dist/controller/defaults.d.ts.map +1 -0
  21. package/dist/controller/defaults.js +54 -0
  22. package/dist/controller/index.d.ts +25 -0
  23. package/dist/controller/index.d.ts.map +1 -0
  24. package/dist/controller/index.js +112 -0
  25. package/dist/controller/utils.d.ts +21 -0
  26. package/dist/controller/utils.d.ts.map +1 -0
  27. package/dist/controller/utils.js +42 -0
  28. package/dist/delivery/index.d.ts +23 -0
  29. package/dist/delivery/index.d.ts.map +1 -0
  30. package/dist/delivery/index.js +62 -0
  31. package/dist/delivery/main.d.ts +32 -0
  32. package/dist/delivery/main.d.ts.map +1 -0
  33. package/dist/delivery/main.js +198 -0
  34. package/dist/delivery/utils.d.ts +13 -0
  35. package/dist/delivery/utils.d.ts.map +1 -0
  36. package/dist/delivery/utils.js +220 -0
  37. package/dist/graphing-solution-set.css +2 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.iife.d.ts +9 -0
  41. package/dist/index.iife.d.ts.map +1 -0
  42. package/dist/index.iife.js +373 -0
  43. package/dist/index.js +2 -0
  44. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js +6 -0
  45. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js +16 -0
  46. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js +16 -0
  47. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js +6 -0
  48. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js +16 -0
  49. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js +6 -0
  50. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js +6 -0
  51. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js +11 -0
  52. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js +13 -0
  53. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
  54. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js +5 -0
  55. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js +6 -0
  56. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_apply.js +12 -0
  57. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js +7 -0
  58. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js +10 -0
  59. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludes.js +7 -0
  60. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludesWith.js +7 -0
  61. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  62. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js +7 -0
  63. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js +7 -0
  64. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js +7 -0
  65. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js +10 -0
  66. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js +8 -0
  67. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js +8 -0
  68. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js +8 -0
  69. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js +12 -0
  70. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js +57 -0
  71. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js +14 -0
  72. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseDifference.js +23 -0
  73. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFindIndex.js +7 -0
  74. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseFlatten.js +13 -0
  75. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  76. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
  77. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIndexOf.js +9 -0
  78. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js +9 -0
  79. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js +8 -0
  80. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js +30 -0
  81. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js +9 -0
  82. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNaN.js +6 -0
  83. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js +11 -0
  84. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js +9 -0
  85. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  86. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js +12 -0
  87. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js +13 -0
  88. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js +9 -0
  89. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSet.js +22 -0
  90. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js +14 -0
  91. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js +7 -0
  92. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js +15 -0
  93. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js +8 -0
  94. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUniq.js +27 -0
  95. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js +6 -0
  96. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js +10 -0
  97. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  98. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js +10 -0
  99. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js +8 -0
  100. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js +8 -0
  101. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js +8 -0
  102. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  103. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js +8 -0
  104. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js +14 -0
  105. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js +8 -0
  106. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  107. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js +5 -0
  108. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_createSet.js +9 -0
  109. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js +10 -0
  110. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js +35 -0
  111. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js +35 -0
  112. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js +32 -0
  113. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
  114. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js +9 -0
  115. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  116. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js +8 -0
  117. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js +9 -0
  118. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js +5 -0
  119. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +14 -0
  120. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js +10 -0
  121. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  122. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js +23 -0
  123. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js +6 -0
  124. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js +7 -0
  125. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js +7 -0
  126. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js +13 -0
  127. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js +9 -0
  128. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js +9 -0
  129. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js +8 -0
  130. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js +33 -0
  131. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js +9 -0
  132. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isFlattenable.js +10 -0
  133. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js +8 -0
  134. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js +11 -0
  135. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js +7 -0
  136. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js +11 -0
  137. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js +8 -0
  138. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js +6 -0
  139. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js +9 -0
  140. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js +8 -0
  141. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js +7 -0
  142. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js +8 -0
  143. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js +13 -0
  144. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  145. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js +7 -0
  146. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js +7 -0
  147. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js +8 -0
  148. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js +9 -0
  149. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js +11 -0
  150. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js +5 -0
  151. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js +5 -0
  152. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  153. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js +9 -0
  154. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
  155. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js +8 -0
  156. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js +13 -0
  157. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
  158. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js +7 -0
  159. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js +6 -0
  160. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js +9 -0
  161. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js +6 -0
  162. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js +14 -0
  163. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js +7 -0
  164. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js +7 -0
  165. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js +6 -0
  166. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js +6 -0
  167. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js +16 -0
  168. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_strictIndexOf.js +7 -0
  169. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js +10 -0
  170. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js +10 -0
  171. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js +15 -0
  172. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js +8 -0
  173. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/constant.js +8 -0
  174. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/differenceWith.js +12 -0
  175. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/eq.js +6 -0
  176. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/identity.js +6 -0
  177. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js +10 -0
  178. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js +4 -0
  179. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js +8 -0
  180. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  181. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js +6 -0
  182. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js +21 -0
  183. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js +7 -0
  184. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js +11 -0
  185. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js +7 -0
  186. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isMap.js +7 -0
  187. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
  188. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
  189. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSet.js +7 -0
  190. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
  191. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js +7 -0
  192. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keys.js +9 -0
  193. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js +9 -0
  194. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/last.js +7 -0
  195. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/memoize.js +16 -0
  196. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/noop.js +4 -0
  197. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/set.js +7 -0
  198. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js +6 -0
  199. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js +6 -0
  200. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/toString.js +7 -0
  201. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/uniq.js +7 -0
  202. package/dist/node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/uniqWith.js +7 -0
  203. package/package.json +70 -0
  204. package/src/author/configure.tsx +266 -0
  205. package/src/author/correct-response.tsx +408 -0
  206. package/src/author/defaults.tsx +366 -0
  207. package/src/author/graphing-config.tsx +318 -0
  208. package/src/author/index.ts +176 -0
  209. package/src/author/utils.ts +577 -0
  210. package/src/controller/defaults.ts +72 -0
  211. package/src/controller/index.ts +313 -0
  212. package/src/controller/utils.ts +195 -0
  213. package/src/delivery/index.ts +159 -0
  214. package/src/delivery/main.tsx +361 -0
  215. package/src/delivery/utils.ts +465 -0
  216. package/src/index.iife.ts +16 -0
  217. package/src/index.ts +1 -0
@@ -0,0 +1,465 @@
1
+ // @ts-nocheck
2
+ /**
3
+ * @synced-from pie-elements/packages/graphing-solution-set/src/utils.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
+ * Check if a line is complete
13
+ * @param {Object} item - mark object
14
+ * */
15
+ const completeFromTo = (item) => item && completeMark.point(item.from) && completeMark.point(item.to);
16
+
17
+ /*
18
+ * Check if a point is correct and complete
19
+ * @param {Object} point - point object
20
+ * */
21
+ const completePoint = (point) => point && Number.isFinite(point.x) && Number.isFinite(point.y);
22
+
23
+ /*
24
+ * Complete mark object for line and point
25
+ * */
26
+ const completeMark = {
27
+ line: completeFromTo,
28
+ point: completePoint,
29
+ };
30
+
31
+ //////////////////////////////////////////////////////////////////////////////////
32
+ // BELOW FUNCTIONS ARE USED IN configure/src/utils as well
33
+ //////////////////////////////////////////////////////////////////////////////////
34
+
35
+ /*
36
+ * Function to calculate the distance between two points
37
+ * @param {Object} a - point a
38
+ * @param {Object} b - point b
39
+ * */
40
+ const distance = (a, b) => {
41
+ return Number(Math.sqrt((a.x - b.x) ** 2 + (a.y - b.y) ** 2).toFixed(3));
42
+ };
43
+
44
+ /*
45
+ * Function to check if a point lies on edges of a polygon
46
+ * @param {Object} point - point object
47
+ * @param {Array} polygon - polygon points array
48
+ * */
49
+ const pointInPolygon = (point, polygon) => {
50
+ let c = point;
51
+ let inside = false;
52
+ let clonePolygon = [...polygon];
53
+ clonePolygon.push(polygon[0]);
54
+ for (let i = 0; i < clonePolygon.length - 1; i++) {
55
+ let a = clonePolygon[i];
56
+ let b = clonePolygon[i + 1];
57
+ // check if point is on the edge
58
+ if (distance(a, c) + distance(c, b) === distance(a, b)) {
59
+ inside = true;
60
+ break;
61
+ }
62
+ }
63
+ return inside;
64
+ };
65
+
66
+ /*
67
+ * Function to get the intersection point of two lines
68
+ * @param {Number} x1 - x coordinate of point 1 of line 1
69
+ * @param {Number} y1 - y coordinate of point 1 of line 1
70
+ * @param {Number} x2 - x coordinate of point 2 of line 1
71
+ * @param {Number} y2 - y coordinate of point 2 of line 1
72
+ * @param {Number} x3 - x coordinate of point 1 of line 2
73
+ * @param {Number} y3 - y coordinate of point 1 of line 2
74
+ * @param {Number} x4 - x coordinate of point 2 of line 2
75
+ * @param {Number} y4 - y coordinate of point 2 of line 2
76
+ * */
77
+ const lineIntersect = (x1, y1, x2, y2, x3, y3, x4, y4) => {
78
+ let ua,
79
+ denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
80
+ if (denominator === 0) {
81
+ return null;
82
+ }
83
+ ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;
84
+ return {
85
+ x: Number((x1 + ua * (x2 - x1)).toFixed(3)),
86
+ y: Number((y1 + ua * (y2 - y1)).toFixed(3)),
87
+ };
88
+ };
89
+
90
+ /*
91
+ * Check if a point is inside the graph
92
+ * @param {Object} point - point object
93
+ * @param {Object} domain - domain object
94
+ * @param {Object} range - range object
95
+ * */
96
+ const isPointInsideGraph = (point, domain, range) => {
97
+ return point.x > domain.min && point.x < domain.max && point.y > range.min && point.y < range.max;
98
+ };
99
+
100
+ /*
101
+ * Check if a point is on or inside the graph
102
+ * @param {Object} point - point object
103
+ * @param {Object} domain - domain object
104
+ * @param {Object} range - range object
105
+ * */
106
+ const isPointOnOrInsideGraph = (point, domain, range) => {
107
+ return point.x >= domain.min && point.x <= domain.max && point.y >= range.min && point.y <= range.max;
108
+ };
109
+
110
+ /*
111
+ * Find the intersection point of a mark with the graph
112
+ * @param {Object} mark - mark object
113
+ * @param {Object} domain - domain object
114
+ * @param {Object} range - range object
115
+ * */
116
+ const findIntersectionPointForMark = (mark, domain, range) => {
117
+ let intersectionPoint = [];
118
+ let tempData = [
119
+ [domain.max, range.max, domain.max, range.min],
120
+ [domain.min, range.max, domain.min, range.min],
121
+ [domain.min, range.max, domain.max, range.max],
122
+ [domain.min, range.min, domain.max, range.min],
123
+ ];
124
+ for (let i = 0; i < tempData.length; i++) {
125
+ let intersection = lineIntersect(
126
+ mark.from.x,
127
+ mark.from.y,
128
+ mark.to.x,
129
+ mark.to.y,
130
+ tempData[i][0],
131
+ tempData[i][1],
132
+ tempData[i][2],
133
+ tempData[i][3],
134
+ );
135
+ if (intersection && isPointOnOrInsideGraph(intersection, domain, range)) {
136
+ intersectionPoint.push(intersection);
137
+ }
138
+ }
139
+ return intersectionPoint;
140
+ };
141
+
142
+ /*
143
+ * Sort points in clockwise direction for a polygon
144
+ * @param {Array} points - points array
145
+ * */
146
+ const sortPointsClockWise = (points) => {
147
+ // Find min max to get center and Sort from top to bottom
148
+ points.sort((a, b) => a.y - b.y);
149
+ // Get center y
150
+ const cy = (points[0].y + points[points.length - 1].y) / 2;
151
+ // Sort from right to left
152
+ points.sort((a, b) => b.x - a.x);
153
+ // Get center x
154
+ const cx = (points[0].x + points[points.length - 1].x) / 2;
155
+ // Center point
156
+ const center = { x: cx, y: cy };
157
+ // As the points are sorted from right to left the first point is the rightmost Starting angle used to reference other angles
158
+ let startAng;
159
+ points.forEach((point) => {
160
+ let ang = Math.atan2(point.y - center.y, point.x - center.x);
161
+ if (!startAng) {
162
+ startAng = ang;
163
+ } else {
164
+ if (ang < startAng) {
165
+ // ensure that all points are clockwise of the start point
166
+ ang += Math.PI * 2;
167
+ }
168
+ }
169
+ point.angle = ang; // add the angle to the point
170
+ });
171
+ // first sort clockwise
172
+ points.sort((a, b) => a.angle - b.angle);
173
+ // then reverse the order
174
+ const ccwPoints = points.reverse();
175
+ // move the last point back to the start
176
+ ccwPoints.unshift(ccwPoints.pop());
177
+ return ccwPoints.map(({ angle, ...attr }) => attr);
178
+ };
179
+
180
+ /*
181
+ * Function to calculate the dot product of two vectors
182
+ * @param {Object} v1 - point 1
183
+ * @param {Object} v2 - point 2
184
+ * */
185
+ const dotProduct = (v1, v2) => {
186
+ return v1.x * v2.x + v1.y * v2.y;
187
+ };
188
+
189
+ /*
190
+ * Function to calculate the magnitude of a vector
191
+ * @param {Object} v - point object
192
+ * */
193
+ const magnitude = (v) => {
194
+ return Math.sqrt(v.x * v.x + v.y * v.y);
195
+ };
196
+
197
+ /*
198
+ * Function to calculate the angle between two vectors in radians
199
+ * @param {Object} v1 - point 1
200
+ * @param {Object} v2 - point 2
201
+ * */
202
+ const angleBetweenVectors = (v1, v2) => {
203
+ const dot = dotProduct(v1, v2);
204
+ const magV1 = magnitude(v1);
205
+ const magV2 = magnitude(v2);
206
+ // Ensure the dot product is within the domain of the acos function
207
+ return Math.acos(dot / (magV1 * magV2));
208
+ };
209
+
210
+ /*
211
+ * Function to check if a point lies between the angle formed by two lines
212
+ * @param {Object} commonPoint - common point of the two lines
213
+ * @param {Object} point1 - point 1 of cone
214
+ * @param {Object} point2 - point 2 of cone
215
+ * @param {Object} testPoint - point to be tested
216
+ * */
217
+ const pointInAngle = (commonPoint, point1, point2, testPoint) => {
218
+ const vector1 = { x: point1.x - commonPoint.x, y: point1.y - commonPoint.y };
219
+ const vector2 = { x: point2.x - commonPoint.x, y: point2.y - commonPoint.y };
220
+ const testVector = { x: testPoint.x - commonPoint.x, y: testPoint.y - commonPoint.y };
221
+ const angle1 = angleBetweenVectors(vector1, testVector);
222
+ const angle2 = angleBetweenVectors(vector2, testVector);
223
+ const angleSum = angle1 + angle2;
224
+ // Check if the sum of angles is approximately equal to the angle between the two lines
225
+ // You may need to adjust the tolerance (e.g., 0.0001) based on your specific requirements
226
+ const tolerance = 0.0001;
227
+ return Math.abs(angleSum - angleBetweenVectors(vector1, vector2)) < tolerance;
228
+ };
229
+
230
+ /*
231
+ * Function to remove duplicate points from an array
232
+ * @param {Array} array - array of points
233
+ * */
234
+ const removeDuplicatesFromArray = (array) => {
235
+ return array.filter((obj, index) => {
236
+ return index === array.findIndex((o) => obj.x === o.x && obj.y === o.y);
237
+ });
238
+ };
239
+
240
+ /*
241
+ * Function to remove duplicate points and filter sections
242
+ * @param {Array} sections - array of sections
243
+ * */
244
+ const removeDuplicateAndFilterSections = (sections) => {
245
+ //removing duplicate points.
246
+ for (let i = 0; i < sections.length; i++) {
247
+ sections[i] = sections[i].filter((obj, index) => {
248
+ return index === sections[i].findIndex((o) => obj.x === o.x && obj.y === o.y);
249
+ });
250
+ }
251
+ //removing arrays with two points
252
+ sections = sections.filter((section) => section.length > 2);
253
+ //sorting the points in clockwise direction
254
+ for (let i = 0; i < sections.length; i++) {
255
+ sections[i] = sortPointsClockWise(sections[i]);
256
+ }
257
+ return sections;
258
+ };
259
+
260
+ /*
261
+ * Function to find sections in solution set for one line
262
+ * @param {Array} intersectionPoint - intersection point
263
+ * @param {Object} domain - domain object
264
+ * @param {Object} range - range object
265
+ * */
266
+ const findSectionsInSolutionSetForOneLine = (intersectionPoint, domain, range) => {
267
+ let sections = [];
268
+ sections.push([].concat(intersectionPoint));
269
+ sections.push([].concat(intersectionPoint));
270
+ if (
271
+ (intersectionPoint[0].x === domain.max && intersectionPoint[1].y === range.max) ||
272
+ (intersectionPoint[1].x === domain.max && intersectionPoint[0].y === range.max)
273
+ ) {
274
+ sections[0].push({ x: domain.max, y: range.max });
275
+ sections[1].push({ x: domain.min, y: range.max }, { x: domain.min, y: range.min }, { x: domain.max, y: range.min });
276
+ } else if (
277
+ (intersectionPoint[0].x === domain.min && intersectionPoint[1].y === range.max) ||
278
+ (intersectionPoint[1].x === domain.min && intersectionPoint[0].y === range.max)
279
+ ) {
280
+ sections[0].push({ x: domain.min, y: range.max });
281
+ sections[1].push({ x: domain.max, y: range.max }, { x: domain.max, y: range.min }, { x: domain.min, y: range.min });
282
+ } else if (
283
+ (intersectionPoint[0].x === domain.min && intersectionPoint[1].y === range.min) ||
284
+ (intersectionPoint[1].x === domain.min && intersectionPoint[0].y === range.min)
285
+ ) {
286
+ sections[0].push({ x: domain.min, y: range.min });
287
+ sections[1].push({ x: domain.max, y: range.min }, { x: domain.max, y: range.max }, { x: domain.min, y: range.max });
288
+ } else if (
289
+ (intersectionPoint[0].x === domain.max && intersectionPoint[1].y === range.min) ||
290
+ (intersectionPoint[1].x === domain.max && intersectionPoint[0].y === range.min)
291
+ ) {
292
+ sections[0].push({ x: domain.max, y: range.min });
293
+ sections[1].push({ x: domain.min, y: range.min }, { x: domain.min, y: range.max }, { x: domain.max, y: range.max });
294
+ } else if (
295
+ (intersectionPoint[0].x === domain.min && intersectionPoint[1].x === domain.max) ||
296
+ (intersectionPoint[0].x === domain.max && intersectionPoint[1].x === domain.min)
297
+ ) {
298
+ sections[0].push({ x: domain.min, y: range.max }, { x: domain.max, y: range.max });
299
+ sections[1].push({ x: domain.min, y: range.min }, { x: domain.max, y: range.min });
300
+ } else if (
301
+ (intersectionPoint[0].y === range.min && intersectionPoint[1].y === range.max) ||
302
+ (intersectionPoint[0].y === range.max && intersectionPoint[1].y === range.min)
303
+ ) {
304
+ sections[0].push({ x: domain.min, y: range.min }, { x: domain.min, y: range.max });
305
+ sections[1].push({ x: domain.max, y: range.min }, { x: domain.max, y: range.max });
306
+ }
307
+ return removeDuplicateAndFilterSections(sections);
308
+ };
309
+
310
+ /*
311
+ * Function to find sections in solution set for two lines
312
+ * @param {Object} gssLineData - graphing solution set line data
313
+ * @param {Array} answers - answers array
314
+ * @param {Object} domain - domain object
315
+ * @param {Object} range - range object
316
+ * */
317
+ const findSectionsInSolutionSetForTwoLines = (gssLineData, answers, domain, range) => {
318
+ let mark1 = answers[0];
319
+ let mark2 = answers[1];
320
+ let cornerPoints = [
321
+ { x: domain.min, y: range.min },
322
+ { x: domain.min, y: range.max },
323
+ { x: domain.max, y: range.min },
324
+ { x: domain.max, y: range.max },
325
+ ];
326
+ let intersectPoint = lineIntersect(
327
+ mark1.from.x,
328
+ mark1.from.y,
329
+ mark1.to.x,
330
+ mark1.to.y,
331
+ mark2.from.x,
332
+ mark2.from.y,
333
+ mark2.to.x,
334
+ mark2.to.y,
335
+ );
336
+ let sections = [];
337
+ let intersectionPoint1 = findIntersectionPointForMark(mark1, domain, range);
338
+ intersectionPoint1 = removeDuplicatesFromArray(intersectionPoint1);
339
+ let intersectionPoint2 = findIntersectionPointForMark(mark2, domain, range);
340
+ intersectionPoint2 = removeDuplicatesFromArray(intersectionPoint2);
341
+ if (intersectPoint && isPointInsideGraph(intersectPoint, domain, range)) {
342
+ for (let i = 0; i < intersectionPoint1.length; i++) {
343
+ for (let j = 0; j < intersectionPoint2.length; j++) {
344
+ let bucket = [];
345
+ let newCornerPoints = [];
346
+ bucket.push(intersectPoint);
347
+ bucket.push(intersectionPoint1[i]);
348
+ bucket.push(intersectionPoint2[j]);
349
+ for (let k = 0; k < cornerPoints.length; k++) {
350
+ if (pointInAngle(intersectPoint, intersectionPoint1[i], intersectionPoint2[j], cornerPoints[k])) {
351
+ bucket.push(cornerPoints[k]);
352
+ } else {
353
+ newCornerPoints.push(cornerPoints[k]);
354
+ }
355
+ }
356
+ cornerPoints = newCornerPoints;
357
+ sections.push(bucket);
358
+ }
359
+ }
360
+ } else {
361
+ let sections1 = findSectionsInSolutionSetForOneLine(intersectionPoint1, domain, range);
362
+ let sections2 = findSectionsInSolutionSetForOneLine(intersectionPoint2, domain, range);
363
+ for (let i = 0; i < sections1.length; i++) {
364
+ if (
365
+ !(pointInPolygon(intersectionPoint2[0], sections1[i]) && pointInPolygon(intersectionPoint2[1], sections1[i]))
366
+ ) {
367
+ sections.push(sections1[i]);
368
+ }
369
+ }
370
+ for (let i = 0; i < sections2.length; i++) {
371
+ if (
372
+ !(pointInPolygon(intersectionPoint1[0], sections2[i]) && pointInPolygon(intersectionPoint1[1], sections2[i]))
373
+ ) {
374
+ sections.push(sections2[i]);
375
+ }
376
+ }
377
+ for (let i = 0; i < sections.length; i++) {
378
+ cornerPoints = cornerPoints.filter(function (o1) {
379
+ return !sections[i].some(function (o2) {
380
+ return o1.x === o2.x && o1.y === o2.y;
381
+ });
382
+ });
383
+ }
384
+ let sections3 = cornerPoints.concat(intersectionPoint1, intersectionPoint2);
385
+ sections.push(sections3);
386
+ }
387
+ return removeDuplicateAndFilterSections(sections);
388
+ };
389
+
390
+ /*
391
+ * Function to find sections in solution set
392
+ * @param {Object} gssLineData - graphing solution set line data
393
+ * @param {Array} answers - answers array
394
+ * @param {Object} domain - domain object
395
+ * @param {Object} range - range object
396
+ * */
397
+ export const findSectionsInSolutionSet = (gssLineData, answers, domain, range) => {
398
+ if (gssLineData.numberOfLines === 1) {
399
+ const intersectionPoint = findIntersectionPointForMark(answers[0], domain, range);
400
+ gssLineData.sections = findSectionsInSolutionSetForOneLine(intersectionPoint, domain, range);
401
+ } else {
402
+ gssLineData.sections = findSectionsInSolutionSetForTwoLines(gssLineData, answers, domain, range);
403
+ }
404
+ return gssLineData;
405
+ };
406
+
407
+ /*
408
+ * Function to check if a point is inside a polygon
409
+ * @param {Object} point - point to be checked
410
+ * @param {Array} polygon - polygon points array
411
+ * */
412
+ export const pointInsidePolygon = (point, polygon) => {
413
+ const num_vertices = polygon.length;
414
+ const x = point.x;
415
+ const y = point.y;
416
+ let inside = false;
417
+ let p1 = polygon[0];
418
+ let p2;
419
+ for (let i = 1; i <= num_vertices; i++) {
420
+ p2 = polygon[i % num_vertices];
421
+ if (y > Math.min(p1.y, p2.y)) {
422
+ if (y <= Math.max(p1.y, p2.y)) {
423
+ if (x <= Math.max(p1.x, p2.x)) {
424
+ const x_intersection = ((y - p1.y) * (p2.x - p1.x)) / (p2.y - p1.y) + p1.x;
425
+ if (p1.x === p2.x || x <= x_intersection) {
426
+ inside = !inside;
427
+ }
428
+ }
429
+ }
430
+ }
431
+ p1 = p2;
432
+ }
433
+ return inside;
434
+ };
435
+
436
+ /*
437
+ * Function to check if lines are added in the graph
438
+ * @param {Object} gssLineData - graphing solution set line data
439
+ * @param {Array} answer - answer array
440
+ * */
441
+ export const checkIfLinesAreAdded = (gssLineData, answer) => {
442
+ if (answer.length === 0) {
443
+ return false;
444
+ }
445
+ if (gssLineData.numberOfLines === 1) {
446
+ if (answer.length === 1) {
447
+ return !answer[0].building;
448
+ }
449
+ } else {
450
+ if (answer.length !== 2) {
451
+ return false;
452
+ } else {
453
+ return !answer[1].building;
454
+ }
455
+ }
456
+ };
457
+
458
+ /*
459
+ * Function to remove invalid answers
460
+ * @param {Array} answers - answers array
461
+ * */
462
+ export const removeInvalidAnswers = (answers) =>
463
+ answers
464
+ ? (answers || []).filter(({ type, ...answer }) => (completeMark[type] ? completeMark[type](answer) : false))
465
+ : [];
@@ -0,0 +1,16 @@
1
+ /**
2
+ * IIFE entry point for graphing-solution-set element
3
+ * This file is only used for IIFE builds and includes auto-registration
4
+ *
5
+ * @sync-generated - Auto-generated during sync from pie-elements
6
+ */
7
+
8
+ import Element from './index.js';
9
+
10
+ // Auto-register the custom element for IIFE mode
11
+ if (typeof window !== 'undefined' && !customElements.get('graphing-solution-set-element')) {
12
+ customElements.define('graphing-solution-set-element', Element);
13
+ }
14
+
15
+ // Export for IIFE global
16
+ export default Element;
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default } from './delivery/index.js';