pict-section-formeditor 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +118 -0
  3. package/docs/.nojekyll +0 -0
  4. package/docs/README.md +162 -0
  5. package/docs/_sidebar.md +23 -0
  6. package/docs/_topbar.md +5 -0
  7. package/docs/cover.md +12 -0
  8. package/docs/css/docuserve.css +73 -0
  9. package/docs/index.html +39 -0
  10. package/docs/retold-catalog.json +224 -0
  11. package/docs/retold-keyword-index.json +46846 -0
  12. package/example_applications/form_editor/.quackage.json +10 -0
  13. package/example_applications/form_editor/FormEditor-Example-Application.js +226 -0
  14. package/example_applications/form_editor/html/icon-chooser.html +375 -0
  15. package/example_applications/form_editor/html/index.html +54 -0
  16. package/example_applications/form_editor/package.json +50 -0
  17. package/package.json +55 -0
  18. package/sample_manifests/Complex-Table.json +974 -0
  19. package/sample_manifests/Distill-Example.json +200 -0
  20. package/sample_manifests/Gradebook-Assignment.json +38 -0
  21. package/sample_manifests/Gradebook-Student.json +40 -0
  22. package/sample_manifests/Manyfest-Editor.json +347 -0
  23. package/sample_manifests/Simple-Form.json +232 -0
  24. package/sample_manifests/Simple-Table.json +79 -0
  25. package/source/Pict-Section-FormEditor-DefaultConfiguration.js +3321 -0
  26. package/source/Pict-Section-FormEditor.js +35 -0
  27. package/source/providers/Pict-Provider-ChildPictManager-Application.js +40 -0
  28. package/source/providers/Pict-Provider-ChildPictManager.js +238 -0
  29. package/source/providers/Pict-Provider-FormEditorDocumentation.js +356 -0
  30. package/source/providers/Pict-Provider-FormEditorDragDrop.js +535 -0
  31. package/source/providers/Pict-Provider-FormEditorIconography.js +1002 -0
  32. package/source/providers/Pict-Provider-FormEditorManifestOps.js +1443 -0
  33. package/source/providers/Pict-Provider-FormEditorRendering.js +730 -0
  34. package/source/providers/Pict-Provider-FormEditorUtilities.js +862 -0
  35. package/source/providers/Pict-Provider-PreviewCSS.js +42 -0
  36. package/source/views/PictView-FormEditor-InlineEditing.js +309 -0
  37. package/source/views/PictView-FormEditor-InputTypePicker.js +532 -0
  38. package/source/views/PictView-FormEditor-PropertiesPanel.js +7730 -0
  39. package/source/views/PictView-FormEditor.js +681 -0
  40. package/test/Pict-Section-FormEditor_tests.js +4102 -0
  41. package/user-documentation/.pict_documentation_topics.json +695 -0
  42. package/user-documentation/Getting-Started.md +32 -0
  43. package/user-documentation/Groups.md +52 -0
  44. package/user-documentation/Inputs.md +98 -0
  45. package/user-documentation/Sections.md +36 -0
  46. package/user-documentation/Shortcuts.md +44 -0
  47. package/user-documentation/Solver-Expression-Walkthrough.md +176 -0
  48. package/user-documentation/Solver-Expressions-Advanced.md +344 -0
  49. package/user-documentation/Solver-Functions.md +213 -0
  50. package/user-documentation/Solvers.md +81 -0
  51. package/user-documentation/ToC.md +18 -0
  52. package/user-documentation/solverfunctions/abs.md +84 -0
  53. package/user-documentation/solverfunctions/aggregationhistogram.md +83 -0
  54. package/user-documentation/solverfunctions/aggregationhistogrambyobject.md +64 -0
  55. package/user-documentation/solverfunctions/arrayconcat.md +64 -0
  56. package/user-documentation/solverfunctions/avg.md +81 -0
  57. package/user-documentation/solverfunctions/bucketset.md +69 -0
  58. package/user-documentation/solverfunctions/ceil.md +70 -0
  59. package/user-documentation/solverfunctions/cleanvaluearray.md +66 -0
  60. package/user-documentation/solverfunctions/cleanvalueobject.md +68 -0
  61. package/user-documentation/solverfunctions/colorgroupbackground.md +60 -0
  62. package/user-documentation/solverfunctions/colorinputbackground.md +62 -0
  63. package/user-documentation/solverfunctions/colorinputbackgroundtabular.md +64 -0
  64. package/user-documentation/solverfunctions/colorsectionbackground.md +59 -0
  65. package/user-documentation/solverfunctions/compare.md +72 -0
  66. package/user-documentation/solverfunctions/concat.md +73 -0
  67. package/user-documentation/solverfunctions/concatraw.md +73 -0
  68. package/user-documentation/solverfunctions/cos.md +75 -0
  69. package/user-documentation/solverfunctions/count.md +73 -0
  70. package/user-documentation/solverfunctions/countset.md +65 -0
  71. package/user-documentation/solverfunctions/countsetelements.md +63 -0
  72. package/user-documentation/solverfunctions/createarrayfromabsolutevalues.md +63 -0
  73. package/user-documentation/solverfunctions/createvalueobjectbyhashes.md +69 -0
  74. package/user-documentation/solverfunctions/cumulativesummation.md +96 -0
  75. package/user-documentation/solverfunctions/dateadddays.md +79 -0
  76. package/user-documentation/solverfunctions/dateaddhours.md +74 -0
  77. package/user-documentation/solverfunctions/dateaddmilliseconds.md +65 -0
  78. package/user-documentation/solverfunctions/dateaddminutes.md +72 -0
  79. package/user-documentation/solverfunctions/dateaddmonths.md +74 -0
  80. package/user-documentation/solverfunctions/dateaddseconds.md +66 -0
  81. package/user-documentation/solverfunctions/dateaddweeks.md +73 -0
  82. package/user-documentation/solverfunctions/dateaddyears.md +74 -0
  83. package/user-documentation/solverfunctions/datedaydifference.md +84 -0
  84. package/user-documentation/solverfunctions/datefromparts.md +81 -0
  85. package/user-documentation/solverfunctions/datehourdifference.md +64 -0
  86. package/user-documentation/solverfunctions/datemathadd.md +72 -0
  87. package/user-documentation/solverfunctions/datemilliseconddifference.md +64 -0
  88. package/user-documentation/solverfunctions/dateminutedifference.md +64 -0
  89. package/user-documentation/solverfunctions/datemonthdifference.md +66 -0
  90. package/user-documentation/solverfunctions/dateseconddifference.md +64 -0
  91. package/user-documentation/solverfunctions/dateweekdifference.md +65 -0
  92. package/user-documentation/solverfunctions/dateyeardifference.md +64 -0
  93. package/user-documentation/solverfunctions/differencearrays.md +59 -0
  94. package/user-documentation/solverfunctions/disablesolverordinal.md +58 -0
  95. package/user-documentation/solverfunctions/distributionhistogram.md +96 -0
  96. package/user-documentation/solverfunctions/distributionhistogrambyobject.md +64 -0
  97. package/user-documentation/solverfunctions/enablesolverordinal.md +57 -0
  98. package/user-documentation/solverfunctions/entryinset.md +72 -0
  99. package/user-documentation/solverfunctions/euler.md +77 -0
  100. package/user-documentation/solverfunctions/exp.md +74 -0
  101. package/user-documentation/solverfunctions/findfirstvaluebyexactmatch.md +67 -0
  102. package/user-documentation/solverfunctions/findfirstvaluebystringincludes.md +67 -0
  103. package/user-documentation/solverfunctions/flatten.md +76 -0
  104. package/user-documentation/solverfunctions/floor.md +70 -0
  105. package/user-documentation/solverfunctions/gaussianelimination.md +75 -0
  106. package/user-documentation/solverfunctions/generatearrayofobjectsfromsets.md +70 -0
  107. package/user-documentation/solverfunctions/generatehtmlhexcolor.md +67 -0
  108. package/user-documentation/solverfunctions/getvalue.md +90 -0
  109. package/user-documentation/solverfunctions/getvaluearray.md +64 -0
  110. package/user-documentation/solverfunctions/getvalueobject.md +67 -0
  111. package/user-documentation/solverfunctions/hidesections.md +58 -0
  112. package/user-documentation/solverfunctions/if.md +109 -0
  113. package/user-documentation/solverfunctions/iterativeseries.md +107 -0
  114. package/user-documentation/solverfunctions/join.md +75 -0
  115. package/user-documentation/solverfunctions/joinraw.md +64 -0
  116. package/user-documentation/solverfunctions/largestinset.md +63 -0
  117. package/user-documentation/solverfunctions/leastsquares.md +66 -0
  118. package/user-documentation/solverfunctions/linest.md +58 -0
  119. package/user-documentation/solverfunctions/log.md +74 -0
  120. package/user-documentation/solverfunctions/logvalues.md +65 -0
  121. package/user-documentation/solverfunctions/match.md +71 -0
  122. package/user-documentation/solverfunctions/matrixinverse.md +67 -0
  123. package/user-documentation/solverfunctions/matrixmultiply.md +71 -0
  124. package/user-documentation/solverfunctions/matrixtranspose.md +72 -0
  125. package/user-documentation/solverfunctions/matrixvectormultiply.md +69 -0
  126. package/user-documentation/solverfunctions/max.md +73 -0
  127. package/user-documentation/solverfunctions/mean.md +63 -0
  128. package/user-documentation/solverfunctions/median.md +79 -0
  129. package/user-documentation/solverfunctions/min.md +73 -0
  130. package/user-documentation/solverfunctions/mode.md +66 -0
  131. package/user-documentation/solverfunctions/objectkeystoarray.md +66 -0
  132. package/user-documentation/solverfunctions/objectvaluessortbyexternalobjectarray.md +65 -0
  133. package/user-documentation/solverfunctions/objectvaluestoarray.md +67 -0
  134. package/user-documentation/solverfunctions/percent.md +75 -0
  135. package/user-documentation/solverfunctions/pi.md +77 -0
  136. package/user-documentation/solverfunctions/polynomialregression.md +69 -0
  137. package/user-documentation/solverfunctions/predict.md +71 -0
  138. package/user-documentation/solverfunctions/rad.md +85 -0
  139. package/user-documentation/solverfunctions/randomfloat.md +63 -0
  140. package/user-documentation/solverfunctions/randomfloatbetween.md +72 -0
  141. package/user-documentation/solverfunctions/randomfloatupto.md +65 -0
  142. package/user-documentation/solverfunctions/randominteger.md +56 -0
  143. package/user-documentation/solverfunctions/randomintegerbetween.md +72 -0
  144. package/user-documentation/solverfunctions/randomintegerupto.md +64 -0
  145. package/user-documentation/solverfunctions/refreshtabularsection.md +57 -0
  146. package/user-documentation/solverfunctions/resolvehtmlentities.md +64 -0
  147. package/user-documentation/solverfunctions/round.md +111 -0
  148. package/user-documentation/solverfunctions/runsolvers.md +49 -0
  149. package/user-documentation/solverfunctions/setconcatenate.md +64 -0
  150. package/user-documentation/solverfunctions/setgroupvisibility.md +60 -0
  151. package/user-documentation/solverfunctions/setsectionvisibility.md +59 -0
  152. package/user-documentation/solverfunctions/setsolverordinalenabled.md +59 -0
  153. package/user-documentation/solverfunctions/settabularrowlength.md +57 -0
  154. package/user-documentation/solverfunctions/setvalue.md +65 -0
  155. package/user-documentation/solverfunctions/showsections.md +58 -0
  156. package/user-documentation/solverfunctions/sin.md +83 -0
  157. package/user-documentation/solverfunctions/slice.md +80 -0
  158. package/user-documentation/solverfunctions/smallestinset.md +63 -0
  159. package/user-documentation/solverfunctions/sortarray.md +58 -0
  160. package/user-documentation/solverfunctions/sorthistogram.md +70 -0
  161. package/user-documentation/solverfunctions/sorthistogrambykeys.md +69 -0
  162. package/user-documentation/solverfunctions/sortset.md +75 -0
  163. package/user-documentation/solverfunctions/sqrt.md +85 -0
  164. package/user-documentation/solverfunctions/stdev.md +81 -0
  165. package/user-documentation/solverfunctions/stdeva.md +58 -0
  166. package/user-documentation/solverfunctions/stdevp.md +83 -0
  167. package/user-documentation/solverfunctions/stringcountsegments.md +66 -0
  168. package/user-documentation/solverfunctions/stringgetsegments.md +74 -0
  169. package/user-documentation/solverfunctions/subtractingsummation.md +66 -0
  170. package/user-documentation/solverfunctions/sum.md +78 -0
  171. package/user-documentation/solverfunctions/tan.md +78 -0
  172. package/user-documentation/solverfunctions/tofixed.md +75 -0
  173. package/user-documentation/solverfunctions/unionarrays.md +59 -0
  174. package/user-documentation/solverfunctions/uniquearray.md +58 -0
  175. package/user-documentation/solverfunctions/var.md +67 -0
  176. package/user-documentation/solverfunctions/vara.md +58 -0
  177. package/user-documentation/solverfunctions/varp.md +66 -0
  178. package/user-documentation/solverfunctions/when.md +98 -0
@@ -0,0 +1,84 @@
1
+ # abs
2
+
3
+ Returns the absolute value of a number.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ abs(value)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `value` | Number/String | The value to get the absolute value of |
16
+
17
+ ## Returns
18
+
19
+ String - The absolute value (non-negative) of the input.
20
+
21
+ ## Description
22
+
23
+ The `abs` function returns the absolute value of a number, which is always non-negative. If the input is negative, it returns the positive equivalent. If already positive or zero, it returns the value unchanged.
24
+
25
+ ## Examples
26
+
27
+ ### Basic Usage
28
+
29
+ ```expression
30
+ Result = abs(-5)
31
+ // Result: "5"
32
+
33
+ Result = abs(5)
34
+ // Result: "5"
35
+
36
+ Result = abs(0)
37
+ // Result: "0"
38
+
39
+ Result = abs(-3.14159)
40
+ // Result: "3.14159"
41
+ ```
42
+
43
+ ### With Variables
44
+
45
+ ```expression
46
+ // Calculate the absolute difference between two values
47
+ Difference = abs(Value1 - Value2)
48
+ // With Value1=10, Value2=25
49
+ // Result: "15"
50
+ ```
51
+
52
+ ### In Conditional Comparisons
53
+
54
+ ```expression
55
+ // Check if two values are within a tolerance
56
+ IsClose = IF(ABS(Expected - Actual), "LT", Tolerance, "yes", "no")
57
+ ```
58
+
59
+ ### In Complex Expressions
60
+
61
+ ```expression
62
+ // Used in the unit tests to verify precision
63
+ Result = abs(ComputedValue - ExpectedValue)
64
+ // Check if within epsilon: abs(difference) < 0.00000000001
65
+ ```
66
+
67
+ ## Use Cases
68
+
69
+ - **Error calculations**: Finding the magnitude of differences
70
+ - **Distance calculations**: Distances are always positive
71
+ - **Tolerance checking**: Verifying values are within acceptable ranges
72
+ - **Data normalization**: Converting all values to positive
73
+
74
+ ## Related Functions
75
+
76
+ - [sqrt](./sqrt.md) - Square root
77
+ - [floor](./floor.md) - Floor value
78
+ - [ceil](./ceil.md) - Ceiling value
79
+
80
+ ## Notes
81
+
82
+ - Uses arbitrary precision arithmetic
83
+ - Returns a string representation of the result
84
+ - Works with the Math service's `absPrecise` method internally
@@ -0,0 +1,83 @@
1
+ # aggregationhistogram
2
+
3
+ Generates a histogram by aggregating values grouped by a key.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ aggregationhistogram(dataPath, keyProperty, valueProperty)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `dataPath` | String | Path to the data array (quoted string) |
16
+ | `keyProperty` | String | Property name to group by |
17
+ | `valueProperty` | String | Property name containing values to sum |
18
+
19
+ ## Returns
20
+
21
+ Object - A histogram object with keys and their aggregated values.
22
+
23
+ ## Description
24
+
25
+ The `aggregationhistogram` function creates a histogram by grouping records by a key property and summing the values of another property for each group. This is useful for aggregating totals by category.
26
+
27
+ ## Examples
28
+
29
+ ### Basic Usage
30
+
31
+ ```expression
32
+ // Given AppData.Teams:
33
+ // [
34
+ // { Team: 'Mariners', States: 'Washington', Score: 100 },
35
+ // { Team: 'Yankees', States: 'New York', Score: 200 },
36
+ // { Team: 'Mets', States: 'New York', Score: 50 },
37
+ // { Team: 'Giants', States: 'California', Score: 45 },
38
+ // { Team: 'Dodgers', States: 'California', Score: 5 },
39
+ // { Team: 'Astros', States: 'Texas', Score: 75 }
40
+ // ]
41
+
42
+ Result = aggregationhistogram("AppData.Teams", "States", "Score")
43
+ // Result: {
44
+ // 'Washington': '100',
45
+ // 'New York': '250', // 200 + 50
46
+ // 'California': '50', // 45 + 5
47
+ // 'Texas': '75'
48
+ // }
49
+ ```
50
+
51
+ ### Population by State
52
+
53
+ ```expression
54
+ // Aggregate city populations by state
55
+ AggregationResult = aggregationHistogram("AppData.Cities", "state", "population")
56
+ // Result: { 'Alabama': '1279813', 'Colorado': '...', ... }
57
+ ```
58
+
59
+ ### With Further Processing
60
+
61
+ ```expression
62
+ // Sum all aggregated values
63
+ Total = SUM(FLATTEN(AppData.DestinationObject.AggregationResult))
64
+ ```
65
+
66
+ ## Use Cases
67
+
68
+ - **Sales by region**: Sum revenue by territory
69
+ - **Population statistics**: Aggregate population by state/country
70
+ - **Inventory**: Total items by category
71
+ - **Financial reporting**: Sum transactions by account
72
+
73
+ ## Related Functions
74
+
75
+ - [aggregationhistogrambyobject](./aggregationhistogrambyobject.md) - Takes object directly instead of path
76
+ - [distributionhistogram](./distributionhistogram.md) - Count occurrences instead of sum
77
+ - [sum](./sum.md) - Simple sum of values
78
+
79
+ ## Notes
80
+
81
+ - The data path must be a quoted string
82
+ - Uses arbitrary precision arithmetic for summing
83
+ - Works with the Math service's `histogramAggregationByExactValueFromInternalState` method
@@ -0,0 +1,64 @@
1
+ # aggregationhistogrambyobject
2
+
3
+ Generates an aggregation histogram from an object directly.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ aggregationhistogrambyobject(object, keyProperty, valueProperty)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `object` | Array | Array of objects to aggregate |
16
+ | `keyProperty` | String | Property name to group by |
17
+ | `valueProperty` | String | Property name containing values to sum |
18
+
19
+ ## Returns
20
+
21
+ Object - A histogram object with keys and their aggregated values.
22
+
23
+ ## Description
24
+
25
+ The `aggregationhistogrambyobject` function is similar to `aggregationhistogram` but takes an object/array directly instead of a data path string. This is useful when working with data that's already in a variable.
26
+
27
+ ## Examples
28
+
29
+ ### Basic Usage
30
+
31
+ ```expression
32
+ // Given array of team data
33
+ Teams = [
34
+ { Team: 'Mariners', State: 'WA', Score: 100 },
35
+ { Team: 'Yankees', State: 'NY', Score: 200 },
36
+ { Team: 'Mets', State: 'NY', Score: 50 }
37
+ ]
38
+
39
+ Result = AGGREGATIONHISTOGRAMBYOBJECT(Teams, "State", "Score")
40
+ // Result: { 'WA': '100', 'NY': '250' }
41
+ ```
42
+
43
+ ### With Variable Data
44
+
45
+ ```expression
46
+ SalesByRegion = AGGREGATIONHISTOGRAMBYOBJECT(FilteredData, "region", "amount")
47
+ ```
48
+
49
+ ## Use Cases
50
+
51
+ - **Dynamic data**: Aggregate data already in variables
52
+ - **Filtered data**: Aggregate after filtering
53
+ - **Chained operations**: Use in expression chains
54
+
55
+ ## Related Functions
56
+
57
+ - [aggregationhistogram](./aggregationhistogram.md) - Uses data path string
58
+ - [distributionhistogrambyobject](./distributionhistogrambyobject.md) - Count by object
59
+ - [sum](./sum.md) - Simple sum
60
+
61
+ ## Notes
62
+
63
+ - Takes array directly, not path string
64
+ - Uses the Math service's `histogramAggregationByExactValue` method
@@ -0,0 +1,64 @@
1
+ # arrayconcat
2
+
3
+ Concatenates multiple arrays into one.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ arrayconcat(array1, array2, ...)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `arrays` | Array(s) | Arrays to concatenate |
16
+
17
+ ## Returns
18
+
19
+ Array - Combined array with elements from all inputs.
20
+
21
+ ## Description
22
+
23
+ The `arrayconcat` function combines multiple arrays into a single array by appending them in order.
24
+
25
+ ## Examples
26
+
27
+ ### Basic Usage
28
+
29
+ ```expression
30
+ Result = ARRAYCONCAT([1, 2], [3, 4], [5, 6])
31
+ // Result: [1, 2, 3, 4, 5, 6]
32
+ ```
33
+
34
+ ### Two Arrays
35
+
36
+ ```expression
37
+ Combined = ARRAYCONCAT(FirstHalf, SecondHalf)
38
+ ```
39
+
40
+ ### Multiple Sources
41
+
42
+ ```expression
43
+ AllData = ARRAYCONCAT(Source1, Source2, Source3)
44
+ ```
45
+
46
+ ## Use Cases
47
+
48
+ - **Data merging**: Combine multiple arrays
49
+ - **Report building**: Aggregate data sections
50
+ - **Collection**: Gather from multiple sources
51
+ - **Batch processing**: Combine batches
52
+
53
+ ## Related Functions
54
+
55
+ - [setconcatenate](./setconcatenate.md) - Concatenate two sets
56
+ - [flatten](./flatten.md) - Flatten nested arrays
57
+ - [join](./join.md) - Join as string
58
+
59
+ ## Notes
60
+
61
+ - Accepts multiple arrays
62
+ - Order is preserved
63
+ - Does not remove duplicates
64
+ - Uses the Math service's `arrayConcat` method
@@ -0,0 +1,81 @@
1
+ # avg / mean
2
+
3
+ Calculates the arithmetic average (mean) of values in a set.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ avg(array)
9
+ mean(array)
10
+ ```
11
+
12
+ ## Parameters
13
+
14
+ | Parameter | Type | Description |
15
+ |-----------|------|-------------|
16
+ | `array` | Array | An array of numeric values |
17
+
18
+ ## Returns
19
+
20
+ String - The arithmetic mean of all values.
21
+
22
+ ## Description
23
+
24
+ The `avg` and `mean` functions are identical - both calculate the arithmetic average of a set of values. The average is computed as the sum of all values divided by the count of values.
25
+
26
+ ## Examples
27
+
28
+ ### Basic Usage
29
+
30
+ ```expression
31
+ TotalCost = MEAN(ItemCosts)
32
+ // With ItemCosts = [100, 200, 50, 45, 5]
33
+ // Result: "80"
34
+
35
+ // Using avg (same result)
36
+ Average = AVG(ItemCosts)
37
+ // Result: "80"
38
+ ```
39
+
40
+ ### Average of Computed Values
41
+
42
+ ```expression
43
+ MadeUpValueArray = ROUND(AVG(createarrayfromabsolutevalues(100, 10, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100)),2)
44
+ // Result: "550.83"
45
+ ```
46
+
47
+ ### With Cleaned Data
48
+
49
+ ```expression
50
+ // Average excluding invalid values
51
+ MadeUpValueArray = ROUND(AVG(cleanvaluearray(createarrayfromabsolutevalues(AppData.Value1, AppData.Value2, AppData.Value3, AppData.Value4, AppData.Value5), 1)),2)
52
+ // Result: "2421.54"
53
+ ```
54
+
55
+ ### Combined with Other Functions
56
+
57
+ ```expression
58
+ // Average from flattened nested data
59
+ AvgPopulation = AVG(FLATTEN(Cities[].population))
60
+ ```
61
+
62
+ ## Use Cases
63
+
64
+ - **Statistics**: Central tendency measurement
65
+ - **Performance metrics**: Average response time, throughput
66
+ - **Financial**: Average transaction value, mean return
67
+ - **Scientific data**: Mean measurements
68
+
69
+ ## Related Functions
70
+
71
+ - [sum](./sum.md) - Sum of values
72
+ - [median](./median.md) - Middle value
73
+ - [mode](./mode.md) - Most frequent value
74
+ - [count](./count.md) - Count elements
75
+
76
+ ## Notes
77
+
78
+ - `avg` and `mean` are aliases for the same function
79
+ - Uses arbitrary precision arithmetic
80
+ - Returns the arithmetic mean (sum / count)
81
+ - Works with the Math service's `meanPrecise` and `averagePrecise` methods
@@ -0,0 +1,69 @@
1
+ # bucketset
2
+
3
+ Groups values into buckets based on specified boundaries.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ bucketset(values, buckets)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `values` | Array | Array of numeric values to bucket |
16
+ | `buckets` | Array | Array of bucket boundaries |
17
+
18
+ ## Returns
19
+
20
+ Object - Histogram with bucket ranges as keys and counts as values.
21
+
22
+ ## Description
23
+
24
+ The `bucketset` function groups numeric values into buckets (ranges) based on specified boundaries. This is useful for creating histograms of continuous data.
25
+
26
+ ## Examples
27
+
28
+ ### Basic Usage
29
+
30
+ ```expression
31
+ // Group scores into ranges
32
+ Scores = [45, 62, 78, 85, 92, 55, 73, 88]
33
+ Buckets = BUCKETSET(Scores, [0, 50, 70, 90, 100])
34
+ // Result: { '0-50': 1, '50-70': 2, '70-90': 3, '90-100': 2 }
35
+ ```
36
+
37
+ ### Age Groups
38
+
39
+ ```expression
40
+ Ages = [25, 32, 45, 18, 67, 55, 42, 29]
41
+ AgeGroups = BUCKETSET(Ages, [0, 18, 30, 50, 65, 100])
42
+ // Groups: Under 18, 18-30, 30-50, 50-65, 65+
43
+ ```
44
+
45
+ ### Price Ranges
46
+
47
+ ```expression
48
+ Prices = FLATTEN(AppData.Products.price)
49
+ PriceRanges = BUCKETSET(Prices, [0, 25, 50, 100, 500])
50
+ ```
51
+
52
+ ## Use Cases
53
+
54
+ - **Analytics**: Group continuous data into ranges
55
+ - **Reporting**: Create distribution charts
56
+ - **Demographics**: Age/income brackets
57
+ - **Grading**: Score ranges
58
+
59
+ ## Related Functions
60
+
61
+ - [distributionhistogram](./distributionhistogram.md) - Count by exact values
62
+ - [sorthistogram](./sorthistogram.md) - Sort bucketed results
63
+ - [count](./count.md) - Simple count
64
+
65
+ ## Notes
66
+
67
+ - Bucket boundaries define range edges
68
+ - Values fall into the appropriate range
69
+ - Uses the Math service's `bucketSet` method
@@ -0,0 +1,70 @@
1
+ # ceil
2
+
3
+ Returns the smallest integer greater than or equal to a number.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ ceil(value)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `value` | Number/String | The value to ceiling |
16
+
17
+ ## Returns
18
+
19
+ String - The smallest integer greater than or equal to the input.
20
+
21
+ ## Description
22
+
23
+ The `ceil` function rounds a number up to the nearest integer. For positive numbers, this rounds away from zero. For negative numbers, it rounds toward zero (less negative).
24
+
25
+ ## Examples
26
+
27
+ ### Basic Usage
28
+
29
+ ```expression
30
+ Result = ceil(3.2)
31
+ // Result: "4"
32
+
33
+ Result = ceil(3.7)
34
+ // Result: "4"
35
+
36
+ Result = ceil(3.0)
37
+ // Result: "3"
38
+
39
+ Result = ceil(-2.7)
40
+ // Result: "-2" (rounds toward zero)
41
+ ```
42
+
43
+ ### With Expressions
44
+
45
+ ```expression
46
+ // Calculate pages needed
47
+ PagesNeeded = ceil(TotalItems / ItemsPerPage)
48
+
49
+ // Calculate containers required
50
+ ContainersNeeded = ceil(TotalVolume / ContainerCapacity)
51
+ ```
52
+
53
+ ## Use Cases
54
+
55
+ - **Resource allocation**: Calculating minimum containers/pages needed
56
+ - **Time calculations**: Rounding up to next hour/day
57
+ - **Inventory planning**: Ensuring sufficient stock
58
+ - **Pricing**: Rounding up prices
59
+
60
+ ## Related Functions
61
+
62
+ - [floor](./floor.md) - Round down
63
+ - [round](./round.md) - Round to nearest
64
+ - [tofixed](./tofixed.md) - Format to fixed decimal places
65
+
66
+ ## Notes
67
+
68
+ - Uses arbitrary precision arithmetic
69
+ - Returns a string representation
70
+ - For negative numbers, ceil(-2.7) = -2, not -3
@@ -0,0 +1,66 @@
1
+ # cleanvaluearray
2
+
3
+ Gets a value from an array with default for missing values.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ cleanvaluearray(array, index, defaultValue)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `array` | Array | The array to retrieve from |
16
+ | `index` | Number | Zero-based index |
17
+ | `defaultValue` | Any | Value to return if index is out of bounds or value is undefined |
18
+
19
+ ## Returns
20
+
21
+ Any - The value at the index, or the default value.
22
+
23
+ ## Description
24
+
25
+ The `cleanvaluearray` function retrieves a value from an array at the specified index, returning a default value if the index is out of bounds or the value is undefined/null.
26
+
27
+ ## Examples
28
+
29
+ ### Basic Usage
30
+
31
+ ```expression
32
+ Result = CLEANVALUEARRAY(["a", "b", "c"], 5, "default")
33
+ // Result: "default" (index 5 is out of bounds)
34
+ ```
35
+
36
+ ### Safe Access
37
+
38
+ ```expression
39
+ Value = CLEANVALUEARRAY(Items, Index, 0)
40
+ // Returns 0 if index invalid
41
+ ```
42
+
43
+ ### With Empty Array
44
+
45
+ ```expression
46
+ First = CLEANVALUEARRAY(MaybeEmptyArray, 0, "No items")
47
+ ```
48
+
49
+ ## Use Cases
50
+
51
+ - **Safe access**: Avoid undefined errors
52
+ - **Default values**: Provide fallbacks
53
+ - **Data processing**: Handle missing data
54
+ - **Display**: Show placeholder for missing
55
+
56
+ ## Related Functions
57
+
58
+ - [getvaluearray](./getvaluearray.md) - Get without default
59
+ - [cleanvalueobject](./cleanvalueobject.md) - Clean get from object
60
+ - [if](./if.md) - Conditional logic
61
+
62
+ ## Notes
63
+
64
+ - Returns default for undefined/null
65
+ - Returns default for out-of-bounds
66
+ - Uses the Logic service's `cleanValueArray` method
@@ -0,0 +1,68 @@
1
+ # cleanvalueobject
2
+
3
+ Gets a value from an object with default for missing values.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ cleanvalueobject(object, key, defaultValue)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `object` | Object | The object to retrieve from |
16
+ | `key` | String | The property key |
17
+ | `defaultValue` | Any | Value to return if key is missing or value is undefined |
18
+
19
+ ## Returns
20
+
21
+ Any - The property value, or the default value.
22
+
23
+ ## Description
24
+
25
+ The `cleanvalueobject` function retrieves a value from an object by key, returning a default value if the key doesn't exist or the value is undefined/null.
26
+
27
+ ## Examples
28
+
29
+ ### Basic Usage
30
+
31
+ ```expression
32
+ // Given object: { name: "John" }
33
+ Result = CLEANVALUEOBJECT(Person, "email", "no-email@example.com")
34
+ // Result: "no-email@example.com" (key doesn't exist)
35
+ ```
36
+
37
+ ### Safe Configuration
38
+
39
+ ```expression
40
+ Timeout = CLEANVALUEOBJECT(Config, "timeout", 30)
41
+ // Returns 30 if timeout not configured
42
+ ```
43
+
44
+ ### Histogram Lookup
45
+
46
+ ```expression
47
+ Count = CLEANVALUEOBJECT(Histogram, "MissingCategory", 0)
48
+ // Returns 0 if category doesn't exist
49
+ ```
50
+
51
+ ## Use Cases
52
+
53
+ - **Configuration**: Default settings
54
+ - **Data processing**: Handle missing data
55
+ - **Display**: Show placeholder text
56
+ - **Calculations**: Default numeric values
57
+
58
+ ## Related Functions
59
+
60
+ - [getvalueobject](./getvalueobject.md) - Get without default
61
+ - [cleanvaluearray](./cleanvaluearray.md) - Clean get from array
62
+ - [getvalue](./getvalue.md) - Get from data state
63
+
64
+ ## Notes
65
+
66
+ - Returns default for undefined/null
67
+ - Returns default for missing keys
68
+ - Uses the Logic service's `cleanValueObject` method