@trebco/treb 37.0.0 → 37.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/package.json +119 -0
- package/build/treb-base-types/src/api_types.d.ts +11 -0
- package/build/treb-base-types/src/api_types.js +22 -0
- package/build/treb-base-types/src/api_types.js.map +1 -0
- package/build/treb-base-types/src/area-utils.d.ts +9 -0
- package/build/treb-base-types/src/area-utils.js +50 -0
- package/build/treb-base-types/src/area-utils.js.map +1 -0
- package/build/treb-base-types/src/area.d.ts +182 -0
- package/build/treb-base-types/src/area.js +715 -0
- package/build/treb-base-types/src/area.js.map +1 -0
- package/build/treb-base-types/src/basic_types.d.ts +20 -0
- package/build/treb-base-types/src/basic_types.js +22 -0
- package/build/treb-base-types/src/basic_types.js.map +1 -0
- package/build/treb-base-types/src/cell.d.ts +167 -0
- package/build/treb-base-types/src/cell.js +432 -0
- package/build/treb-base-types/src/cell.js.map +1 -0
- package/build/treb-base-types/src/cells.d.ts +251 -0
- package/build/treb-base-types/src/cells.js +1136 -0
- package/build/treb-base-types/src/cells.js.map +1 -0
- package/build/treb-base-types/src/color.d.ts +35 -0
- package/build/treb-base-types/src/color.js +162 -0
- package/build/treb-base-types/src/color.js.map +1 -0
- package/build/treb-base-types/src/dom-utilities.d.ts +70 -0
- package/build/treb-base-types/src/dom-utilities.js +144 -0
- package/build/treb-base-types/src/dom-utilities.js.map +1 -0
- package/build/treb-base-types/src/evaluate-options.d.ts +35 -0
- package/build/treb-base-types/src/evaluate-options.js +22 -0
- package/build/treb-base-types/src/evaluate-options.js.map +1 -0
- package/build/treb-base-types/src/font-stack.d.ts +37 -0
- package/build/treb-base-types/src/font-stack.js +93 -0
- package/build/treb-base-types/src/font-stack.js.map +1 -0
- package/build/treb-base-types/src/gradient.d.ts +18 -0
- package/build/treb-base-types/src/gradient.js +86 -0
- package/build/treb-base-types/src/gradient.js.map +1 -0
- package/build/treb-base-types/src/import.d.ts +48 -0
- package/build/treb-base-types/src/import.js +22 -0
- package/build/treb-base-types/src/import.js.map +1 -0
- package/build/treb-base-types/src/index-standalone.d.ts +6 -0
- package/build/treb-base-types/src/index-standalone.js +27 -0
- package/build/treb-base-types/src/index-standalone.js.map +1 -0
- package/build/treb-base-types/src/index.d.ts +22 -0
- package/build/treb-base-types/src/index.js +45 -0
- package/build/treb-base-types/src/index.js.map +1 -0
- package/build/treb-base-types/src/layout.d.ts +22 -0
- package/build/treb-base-types/src/layout.js +22 -0
- package/build/treb-base-types/src/layout.js.map +1 -0
- package/build/treb-base-types/src/localization.d.ts +37 -0
- package/build/treb-base-types/src/localization.js +157 -0
- package/build/treb-base-types/src/localization.js.map +1 -0
- package/build/treb-base-types/src/rectangle.d.ts +51 -0
- package/build/treb-base-types/src/rectangle.js +123 -0
- package/build/treb-base-types/src/rectangle.js.map +1 -0
- package/build/treb-base-types/src/render_text.d.ts +34 -0
- package/build/treb-base-types/src/render_text.js +22 -0
- package/build/treb-base-types/src/render_text.js.map +1 -0
- package/build/treb-base-types/src/style.d.ts +214 -0
- package/build/treb-base-types/src/style.js +373 -0
- package/build/treb-base-types/src/style.js.map +1 -0
- package/build/treb-base-types/src/table.d.ts +58 -0
- package/build/treb-base-types/src/table.js +27 -0
- package/build/treb-base-types/src/table.js.map +1 -0
- package/build/treb-base-types/src/text_part.d.ts +26 -0
- package/build/treb-base-types/src/text_part.js +47 -0
- package/build/treb-base-types/src/text_part.js.map +1 -0
- package/build/treb-base-types/src/theme.d.ts +120 -0
- package/build/treb-base-types/src/theme.js +460 -0
- package/build/treb-base-types/src/theme.js.map +1 -0
- package/build/treb-base-types/src/union.d.ts +73 -0
- package/build/treb-base-types/src/union.js +61 -0
- package/build/treb-base-types/src/union.js.map +1 -0
- package/build/treb-base-types/src/value-type.d.ts +86 -0
- package/build/treb-base-types/src/value-type.js +168 -0
- package/build/treb-base-types/src/value-type.js.map +1 -0
- package/build/treb-base-types/src/worker-proxy.d.ts +95 -0
- package/build/treb-base-types/src/worker-proxy.js +221 -0
- package/build/treb-base-types/src/worker-proxy.js.map +1 -0
- package/build/treb-calculator/src/calculator.d.ts +249 -0
- package/build/treb-calculator/src/calculator.js +2755 -0
- package/build/treb-calculator/src/calculator.js.map +1 -0
- package/build/treb-calculator/src/complex-math.d.ts +75 -0
- package/build/treb-calculator/src/complex-math.js +559 -0
- package/build/treb-calculator/src/complex-math.js.map +1 -0
- package/build/treb-calculator/src/dag/array-vertex.d.ts +71 -0
- package/build/treb-calculator/src/dag/array-vertex.js +156 -0
- package/build/treb-calculator/src/dag/array-vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.d.ts +48 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.js +84 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/graph.d.ts +134 -0
- package/build/treb-calculator/src/dag/graph.js +842 -0
- package/build/treb-calculator/src/dag/graph.js.map +1 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.d.ts +58 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.js +232 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.d.ts +20 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js +25 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js.map +1 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.d.ts +43 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.js +81 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/vertex.d.ts +71 -0
- package/build/treb-calculator/src/dag/vertex.js +274 -0
- package/build/treb-calculator/src/dag/vertex.js.map +1 -0
- package/build/treb-calculator/src/descriptors.d.ts +189 -0
- package/build/treb-calculator/src/descriptors.js +22 -0
- package/build/treb-calculator/src/descriptors.js.map +1 -0
- package/build/treb-calculator/src/expression-calculator.d.ts +127 -0
- package/build/treb-calculator/src/expression-calculator.js +1033 -0
- package/build/treb-calculator/src/expression-calculator.js.map +1 -0
- package/build/treb-calculator/src/function-error.d.ts +35 -0
- package/build/treb-calculator/src/function-error.js +85 -0
- package/build/treb-calculator/src/function-error.js.map +1 -0
- package/build/treb-calculator/src/function-library.d.ts +22 -0
- package/build/treb-calculator/src/function-library.js +96 -0
- package/build/treb-calculator/src/function-library.js.map +1 -0
- package/build/treb-calculator/src/functions/base-functions.d.ts +7 -0
- package/build/treb-calculator/src/functions/base-functions.js +2611 -0
- package/build/treb-calculator/src/functions/base-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/beta.d.ts +17 -0
- package/build/treb-calculator/src/functions/beta.js +201 -0
- package/build/treb-calculator/src/functions/beta.js.map +1 -0
- package/build/treb-calculator/src/functions/checkbox.d.ts +3 -0
- package/build/treb-calculator/src/functions/checkbox.js +128 -0
- package/build/treb-calculator/src/functions/checkbox.js.map +1 -0
- package/build/treb-calculator/src/functions/complex-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/complex-functions.js +217 -0
- package/build/treb-calculator/src/functions/complex-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/date-utils.d.ts +3 -0
- package/build/treb-calculator/src/functions/date-utils.js +59 -0
- package/build/treb-calculator/src/functions/date-utils.js.map +1 -0
- package/build/treb-calculator/src/functions/finance-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/finance-functions.js +547 -0
- package/build/treb-calculator/src/functions/finance-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/fp.d.ts +2 -0
- package/build/treb-calculator/src/functions/fp.js +463 -0
- package/build/treb-calculator/src/functions/fp.js.map +1 -0
- package/build/treb-calculator/src/functions/function-utilities.d.ts +2 -0
- package/build/treb-calculator/src/functions/function-utilities.js +36 -0
- package/build/treb-calculator/src/functions/function-utilities.js.map +1 -0
- package/build/treb-calculator/src/functions/gamma.d.ts +20 -0
- package/build/treb-calculator/src/functions/gamma.js +142 -0
- package/build/treb-calculator/src/functions/gamma.js.map +1 -0
- package/build/treb-calculator/src/functions/information-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/information-functions.js +71 -0
- package/build/treb-calculator/src/functions/information-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/lambda-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/lambda-functions.js +85 -0
- package/build/treb-calculator/src/functions/lambda-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/matrix-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/matrix-functions.js +144 -0
- package/build/treb-calculator/src/functions/matrix-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/normal.d.ts +2 -0
- package/build/treb-calculator/src/functions/normal.js +32 -0
- package/build/treb-calculator/src/functions/normal.js.map +1 -0
- package/build/treb-calculator/src/functions/regex-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/regex-functions.js +188 -0
- package/build/treb-calculator/src/functions/regex-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/sparkline.d.ts +37 -0
- package/build/treb-calculator/src/functions/sparkline.js +264 -0
- package/build/treb-calculator/src/functions/sparkline.js.map +1 -0
- package/build/treb-calculator/src/functions/statistics-functions.d.ts +6 -0
- package/build/treb-calculator/src/functions/statistics-functions.js +989 -0
- package/build/treb-calculator/src/functions/statistics-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/students-t.d.ts +3 -0
- package/build/treb-calculator/src/functions/students-t.js +64 -0
- package/build/treb-calculator/src/functions/students-t.js.map +1 -0
- package/build/treb-calculator/src/functions/text-functions.d.ts +3 -0
- package/build/treb-calculator/src/functions/text-functions.js +320 -0
- package/build/treb-calculator/src/functions/text-functions.js.map +1 -0
- package/build/treb-calculator/src/index.d.ts +2 -0
- package/build/treb-calculator/src/index.js +22 -0
- package/build/treb-calculator/src/index.js.map +1 -0
- package/build/treb-calculator/src/notifier-types.d.ts +26 -0
- package/build/treb-calculator/src/notifier-types.js +22 -0
- package/build/treb-calculator/src/notifier-types.js.map +1 -0
- package/build/treb-calculator/src/primitives.d.ts +15 -0
- package/build/treb-calculator/src/primitives.js +398 -0
- package/build/treb-calculator/src/primitives.js.map +1 -0
- package/build/treb-calculator/src/utilities.d.ts +68 -0
- package/build/treb-calculator/src/utilities.js +324 -0
- package/build/treb-calculator/src/utilities.js.map +1 -0
- package/build/treb-charts/src/chart-functions.d.ts +8 -0
- package/build/treb-charts/src/chart-functions.js +209 -0
- package/build/treb-charts/src/chart-functions.js.map +1 -0
- package/build/treb-charts/src/chart-types.d.ts +233 -0
- package/build/treb-charts/src/chart-types.js +57 -0
- package/build/treb-charts/src/chart-types.js.map +1 -0
- package/build/treb-charts/src/chart-utils.d.ts +106 -0
- package/build/treb-charts/src/chart-utils.js +1060 -0
- package/build/treb-charts/src/chart-utils.js.map +1 -0
- package/build/treb-charts/src/chart.d.ts +23 -0
- package/build/treb-charts/src/chart.js +94 -0
- package/build/treb-charts/src/chart.js.map +1 -0
- package/build/treb-charts/src/default-chart-renderer.d.ts +16 -0
- package/build/treb-charts/src/default-chart-renderer.js +533 -0
- package/build/treb-charts/src/default-chart-renderer.js.map +1 -0
- package/build/treb-charts/src/index.d.ts +5 -0
- package/build/treb-charts/src/index.js +24 -0
- package/build/treb-charts/src/index.js.map +1 -0
- package/build/treb-charts/src/main.d.ts +1 -0
- package/build/treb-charts/src/main.js +34 -0
- package/build/treb-charts/src/main.js.map +1 -0
- package/build/treb-charts/src/quicksort.d.ts +1 -0
- package/build/treb-charts/src/quicksort.js +49 -0
- package/build/treb-charts/src/quicksort.js.map +1 -0
- package/build/treb-charts/src/rectangle.d.ts +18 -0
- package/build/treb-charts/src/rectangle.js +41 -0
- package/build/treb-charts/src/rectangle.js.map +1 -0
- package/build/treb-charts/src/renderer-type.d.ts +24 -0
- package/build/treb-charts/src/renderer-type.js +22 -0
- package/build/treb-charts/src/renderer-type.js.map +1 -0
- package/build/treb-charts/src/renderer.d.ts +127 -0
- package/build/treb-charts/src/renderer.js +1518 -0
- package/build/treb-charts/src/renderer.js.map +1 -0
- package/build/treb-charts/src/util.d.ts +18 -0
- package/build/treb-charts/src/util.js +71 -0
- package/build/treb-charts/src/util.js.map +1 -0
- package/build/treb-data-model/src/annotation.d.ts +167 -0
- package/build/treb-data-model/src/annotation.js +120 -0
- package/build/treb-data-model/src/annotation.js.map +1 -0
- package/build/treb-data-model/src/conditional_format.d.ts +155 -0
- package/build/treb-data-model/src/conditional_format.js +62 -0
- package/build/treb-data-model/src/conditional_format.js.map +1 -0
- package/build/treb-data-model/src/data-validation.d.ts +28 -0
- package/build/treb-data-model/src/data-validation.js +22 -0
- package/build/treb-data-model/src/data-validation.js.map +1 -0
- package/build/treb-data-model/src/data_model.d.ts +173 -0
- package/build/treb-data-model/src/data_model.js +637 -0
- package/build/treb-data-model/src/data_model.js.map +1 -0
- package/build/treb-data-model/src/index.d.ts +13 -0
- package/build/treb-data-model/src/index.js +28 -0
- package/build/treb-data-model/src/index.js.map +1 -0
- package/build/treb-data-model/src/language-model.d.ts +22 -0
- package/build/treb-data-model/src/language-model.js +22 -0
- package/build/treb-data-model/src/language-model.js.map +1 -0
- package/build/treb-data-model/src/named.d.ts +124 -0
- package/build/treb-data-model/src/named.js +372 -0
- package/build/treb-data-model/src/named.js.map +1 -0
- package/build/treb-data-model/src/serialize_options.d.ts +49 -0
- package/build/treb-data-model/src/serialize_options.js +22 -0
- package/build/treb-data-model/src/serialize_options.js.map +1 -0
- package/build/treb-data-model/src/sheet.d.ts +499 -0
- package/build/treb-data-model/src/sheet.js +2904 -0
- package/build/treb-data-model/src/sheet.js.map +1 -0
- package/build/treb-data-model/src/sheet_collection.d.ts +58 -0
- package/build/treb-data-model/src/sheet_collection.js +112 -0
- package/build/treb-data-model/src/sheet_collection.js.map +1 -0
- package/build/treb-data-model/src/sheet_selection.d.ts +42 -0
- package/build/treb-data-model/src/sheet_selection.js +39 -0
- package/build/treb-data-model/src/sheet_selection.js.map +1 -0
- package/build/treb-data-model/src/sheet_types.d.ts +104 -0
- package/build/treb-data-model/src/sheet_types.js +22 -0
- package/build/treb-data-model/src/sheet_types.js.map +1 -0
- package/build/treb-data-model/src/types.d.ts +59 -0
- package/build/treb-data-model/src/types.js +22 -0
- package/build/treb-data-model/src/types.js.map +1 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.d.ts +75 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.js +1144 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.js.map +1 -0
- package/build/treb-embed/src/custom-element/treb-global.d.ts +36 -0
- package/build/treb-embed/src/custom-element/treb-global.js +64 -0
- package/build/treb-embed/src/custom-element/treb-global.js.map +1 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.d.ts +1 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js +61 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js.map +1 -0
- package/build/treb-embed/src/embedded-spreadsheet.d.ts +1358 -0
- package/build/treb-embed/src/embedded-spreadsheet.js +5205 -0
- package/build/treb-embed/src/embedded-spreadsheet.js.map +1 -0
- package/build/treb-embed/src/index.d.ts +12 -0
- package/build/treb-embed/src/index.js +34 -0
- package/build/treb-embed/src/index.js.map +1 -0
- package/build/treb-embed/src/options.d.ts +266 -0
- package/build/treb-embed/src/options.js +56 -0
- package/build/treb-embed/src/options.js.map +1 -0
- package/build/treb-embed/src/plugin.d.ts +9 -0
- package/build/treb-embed/src/plugin.js +22 -0
- package/build/treb-embed/src/plugin.js.map +1 -0
- package/build/treb-embed/src/progress-dialog.d.ts +49 -0
- package/build/treb-embed/src/progress-dialog.js +178 -0
- package/build/treb-embed/src/progress-dialog.js.map +1 -0
- package/build/treb-embed/src/selection-state.d.ts +15 -0
- package/build/treb-embed/src/selection-state.js +22 -0
- package/build/treb-embed/src/selection-state.js.map +1 -0
- package/build/treb-embed/src/spinner.d.ts +8 -0
- package/build/treb-embed/src/spinner.js +40 -0
- package/build/treb-embed/src/spinner.js.map +1 -0
- package/build/treb-embed/src/toolbar-message.d.ts +72 -0
- package/build/treb-embed/src/toolbar-message.js +22 -0
- package/build/treb-embed/src/toolbar-message.js.map +1 -0
- package/build/treb-embed/src/types.d.ts +185 -0
- package/build/treb-embed/src/types.js +45 -0
- package/build/treb-embed/src/types.js.map +1 -0
- package/build/treb-embed/tsconfig.tsbuildinfo +1 -0
- package/build/treb-export/src/address-type.d.ts +34 -0
- package/build/treb-export/src/address-type.js +53 -0
- package/build/treb-export/src/address-type.js.map +1 -0
- package/build/treb-export/src/base-template.d.ts +1 -0
- package/build/treb-export/src/base-template.js +22 -0
- package/build/treb-export/src/base-template.js.map +1 -0
- package/build/treb-export/src/column-width.d.ts +2 -0
- package/build/treb-export/src/column-width.js +80 -0
- package/build/treb-export/src/column-width.js.map +1 -0
- package/build/treb-export/src/drawing/bubble-chart-template.d.ts +514 -0
- package/build/treb-export/src/drawing/bubble-chart-template.js +544 -0
- package/build/treb-export/src/drawing/bubble-chart-template.js.map +1 -0
- package/build/treb-export/src/drawing/chart-template-components2.d.ts +365 -0
- package/build/treb-export/src/drawing/chart-template-components2.js +386 -0
- package/build/treb-export/src/drawing/chart-template-components2.js.map +1 -0
- package/build/treb-export/src/drawing/chart.d.ts +26 -0
- package/build/treb-export/src/drawing/chart.js +247 -0
- package/build/treb-export/src/drawing/chart.js.map +1 -0
- package/build/treb-export/src/drawing/column-chart-template2.d.ts +490 -0
- package/build/treb-export/src/drawing/column-chart-template2.js +518 -0
- package/build/treb-export/src/drawing/column-chart-template2.js.map +1 -0
- package/build/treb-export/src/drawing/donut-chart-template2.d.ts +272 -0
- package/build/treb-export/src/drawing/donut-chart-template2.js +293 -0
- package/build/treb-export/src/drawing/donut-chart-template2.js.map +1 -0
- package/build/treb-export/src/drawing/drawing.d.ts +49 -0
- package/build/treb-export/src/drawing/drawing.js +193 -0
- package/build/treb-export/src/drawing/drawing.js.map +1 -0
- package/build/treb-export/src/drawing/embedded-image.d.ts +12 -0
- package/build/treb-export/src/drawing/embedded-image.js +54 -0
- package/build/treb-export/src/drawing/embedded-image.js.map +1 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.d.ts +520 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.js +551 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.js.map +1 -0
- package/build/treb-export/src/export.d.ts +72 -0
- package/build/treb-export/src/export.js +2039 -0
- package/build/treb-export/src/export.js.map +1 -0
- package/build/treb-export/src/import-export-messages.d.ts +31 -0
- package/build/treb-export/src/import-export-messages.js +22 -0
- package/build/treb-export/src/import-export-messages.js.map +1 -0
- package/build/treb-export/src/import.d.ts +33 -0
- package/build/treb-export/src/import.js +1258 -0
- package/build/treb-export/src/import.js.map +1 -0
- package/build/treb-export/src/index.worker.d.ts +1 -0
- package/build/treb-export/src/index.worker.js +93 -0
- package/build/treb-export/src/index.worker.js.map +1 -0
- package/build/treb-export/src/metadata.d.ts +51 -0
- package/build/treb-export/src/metadata.js +153 -0
- package/build/treb-export/src/metadata.js.map +1 -0
- package/build/treb-export/src/ooxml.d.ts +7 -0
- package/build/treb-export/src/ooxml.js +41 -0
- package/build/treb-export/src/ooxml.js.map +1 -0
- package/build/treb-export/src/relationship.d.ts +8 -0
- package/build/treb-export/src/relationship.js +27 -0
- package/build/treb-export/src/relationship.js.map +1 -0
- package/build/treb-export/src/shared-strings.d.ts +11 -0
- package/build/treb-export/src/shared-strings.js +105 -0
- package/build/treb-export/src/shared-strings.js.map +1 -0
- package/build/treb-export/src/template-2.d.ts +1 -0
- package/build/treb-export/src/template-2.js +22 -0
- package/build/treb-export/src/template-2.js.map +1 -0
- package/build/treb-export/src/unescape_xml.d.ts +1 -0
- package/build/treb-export/src/unescape_xml.js +61 -0
- package/build/treb-export/src/unescape_xml.js.map +1 -0
- package/build/treb-export/src/workbook-sheet.d.ts +75 -0
- package/build/treb-export/src/workbook-sheet.js +128 -0
- package/build/treb-export/src/workbook-sheet.js.map +1 -0
- package/build/treb-export/src/workbook-style.d.ts +110 -0
- package/build/treb-export/src/workbook-style.js +1134 -0
- package/build/treb-export/src/workbook-style.js.map +1 -0
- package/build/treb-export/src/workbook-theme.d.ts +13 -0
- package/build/treb-export/src/workbook-theme.js +85 -0
- package/build/treb-export/src/workbook-theme.js.map +1 -0
- package/build/treb-export/src/workbook.d.ts +123 -0
- package/build/treb-export/src/workbook.js +644 -0
- package/build/treb-export/src/workbook.js.map +1 -0
- package/build/treb-export/src/xml-test.d.ts +9 -0
- package/build/treb-export/src/xml-test.js +52 -0
- package/build/treb-export/src/xml-test.js.map +1 -0
- package/build/treb-export/src/xml-utils.d.ts +76 -0
- package/build/treb-export/src/xml-utils.js +223 -0
- package/build/treb-export/src/xml-utils.js.map +1 -0
- package/build/treb-export/src/zip-wrapper.d.ts +22 -0
- package/build/treb-export/src/zip-wrapper.js +93 -0
- package/build/treb-export/src/zip-wrapper.js.map +1 -0
- package/build/treb-format/src/format.d.ts +130 -0
- package/build/treb-format/src/format.js +805 -0
- package/build/treb-format/src/format.js.map +1 -0
- package/build/treb-format/src/format_cache.d.ts +55 -0
- package/build/treb-format/src/format_cache.js +166 -0
- package/build/treb-format/src/format_cache.js.map +1 -0
- package/build/treb-format/src/format_parser.d.ts +70 -0
- package/build/treb-format/src/format_parser.js +618 -0
- package/build/treb-format/src/format_parser.js.map +1 -0
- package/build/treb-format/src/index.d.ts +4 -0
- package/build/treb-format/src/index.js +25 -0
- package/build/treb-format/src/index.js.map +1 -0
- package/build/treb-format/src/number_format_section.d.ts +58 -0
- package/build/treb-format/src/number_format_section.js +78 -0
- package/build/treb-format/src/number_format_section.js.map +1 -0
- package/build/treb-format/src/value_parser.d.ts +48 -0
- package/build/treb-format/src/value_parser.js +244 -0
- package/build/treb-format/src/value_parser.js.map +1 -0
- package/build/treb-grid/src/editors/autocomplete.d.ts +39 -0
- package/build/treb-grid/src/editors/autocomplete.js +316 -0
- package/build/treb-grid/src/editors/autocomplete.js.map +1 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.d.ts +74 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.js +212 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.js.map +1 -0
- package/build/treb-grid/src/editors/editor.d.ts +214 -0
- package/build/treb-grid/src/editors/editor.js +879 -0
- package/build/treb-grid/src/editors/editor.js.map +1 -0
- package/build/treb-grid/src/editors/external_editor.d.ts +11 -0
- package/build/treb-grid/src/editors/external_editor.js +118 -0
- package/build/treb-grid/src/editors/external_editor.js.map +1 -0
- package/build/treb-grid/src/editors/formula_bar.d.ts +85 -0
- package/build/treb-grid/src/editors/formula_bar.js +444 -0
- package/build/treb-grid/src/editors/formula_bar.js.map +1 -0
- package/build/treb-grid/src/editors/overlay_editor.d.ts +85 -0
- package/build/treb-grid/src/editors/overlay_editor.js +353 -0
- package/build/treb-grid/src/editors/overlay_editor.js.map +1 -0
- package/build/treb-grid/src/index.d.ts +12 -0
- package/build/treb-grid/src/index.js +28 -0
- package/build/treb-grid/src/index.js.map +1 -0
- package/build/treb-grid/src/layout/base_layout.d.ts +346 -0
- package/build/treb-grid/src/layout/base_layout.js +2050 -0
- package/build/treb-grid/src/layout/base_layout.js.map +1 -0
- package/build/treb-grid/src/layout/grid_layout.d.ts +19 -0
- package/build/treb-grid/src/layout/grid_layout.js +235 -0
- package/build/treb-grid/src/layout/grid_layout.js.map +1 -0
- package/build/treb-grid/src/layout/mock-layout.d.ts +10 -0
- package/build/treb-grid/src/layout/mock-layout.js +37 -0
- package/build/treb-grid/src/layout/mock-layout.js.map +1 -0
- package/build/treb-grid/src/render/selection-renderer.d.ts +97 -0
- package/build/treb-grid/src/render/selection-renderer.js +315 -0
- package/build/treb-grid/src/render/selection-renderer.js.map +1 -0
- package/build/treb-grid/src/render/svg_header_overlay.d.ts +20 -0
- package/build/treb-grid/src/render/svg_header_overlay.js +76 -0
- package/build/treb-grid/src/render/svg_header_overlay.js.map +1 -0
- package/build/treb-grid/src/render/svg_selection_block.d.ts +27 -0
- package/build/treb-grid/src/render/svg_selection_block.js +106 -0
- package/build/treb-grid/src/render/svg_selection_block.js.map +1 -0
- package/build/treb-grid/src/render/tile_renderer.d.ts +121 -0
- package/build/treb-grid/src/render/tile_renderer.js +1609 -0
- package/build/treb-grid/src/render/tile_renderer.js.map +1 -0
- package/build/treb-grid/src/types/border_constants.d.ts +9 -0
- package/build/treb-grid/src/types/border_constants.js +34 -0
- package/build/treb-grid/src/types/border_constants.js.map +1 -0
- package/build/treb-grid/src/types/clipboard_data.d.ts +11 -0
- package/build/treb-grid/src/types/clipboard_data.js +22 -0
- package/build/treb-grid/src/types/clipboard_data.js.map +1 -0
- package/build/treb-grid/src/types/clipboard_data2.d.ts +46 -0
- package/build/treb-grid/src/types/clipboard_data2.js +22 -0
- package/build/treb-grid/src/types/clipboard_data2.js.map +1 -0
- package/build/treb-grid/src/types/drag_mask.d.ts +10 -0
- package/build/treb-grid/src/types/drag_mask.js +78 -0
- package/build/treb-grid/src/types/drag_mask.js.map +1 -0
- package/build/treb-grid/src/types/external_editor_config.d.ts +33 -0
- package/build/treb-grid/src/types/external_editor_config.js +22 -0
- package/build/treb-grid/src/types/external_editor_config.js.map +1 -0
- package/build/treb-grid/src/types/grid.d.ts +806 -0
- package/build/treb-grid/src/types/grid.js +6410 -0
- package/build/treb-grid/src/types/grid.js.map +1 -0
- package/build/treb-grid/src/types/grid_base.d.ts +442 -0
- package/build/treb-grid/src/types/grid_base.js +3523 -0
- package/build/treb-grid/src/types/grid_base.js.map +1 -0
- package/build/treb-grid/src/types/grid_command.d.ts +408 -0
- package/build/treb-grid/src/types/grid_command.js +75 -0
- package/build/treb-grid/src/types/grid_command.js.map +1 -0
- package/build/treb-grid/src/types/grid_events.d.ts +93 -0
- package/build/treb-grid/src/types/grid_events.js +36 -0
- package/build/treb-grid/src/types/grid_events.js.map +1 -0
- package/build/treb-grid/src/types/grid_options.d.ts +50 -0
- package/build/treb-grid/src/types/grid_options.js +34 -0
- package/build/treb-grid/src/types/grid_options.js.map +1 -0
- package/build/treb-grid/src/types/scale-control.d.ts +21 -0
- package/build/treb-grid/src/types/scale-control.js +148 -0
- package/build/treb-grid/src/types/scale-control.js.map +1 -0
- package/build/treb-grid/src/types/set_range_options.d.ts +24 -0
- package/build/treb-grid/src/types/set_range_options.js +22 -0
- package/build/treb-grid/src/types/set_range_options.js.map +1 -0
- package/build/treb-grid/src/types/tab_bar.d.ts +84 -0
- package/build/treb-grid/src/types/tab_bar.js +426 -0
- package/build/treb-grid/src/types/tab_bar.js.map +1 -0
- package/build/treb-grid/src/types/tile.d.ts +29 -0
- package/build/treb-grid/src/types/tile.js +22 -0
- package/build/treb-grid/src/types/tile.js.map +1 -0
- package/build/treb-grid/src/types/update_flags.d.ts +48 -0
- package/build/treb-grid/src/types/update_flags.js +22 -0
- package/build/treb-grid/src/types/update_flags.js.map +1 -0
- package/build/treb-grid/src/util/fontmetrics.d.ts +21 -0
- package/build/treb-grid/src/util/fontmetrics.js +82 -0
- package/build/treb-grid/src/util/fontmetrics.js.map +1 -0
- package/build/treb-grid/src/util/ua.d.ts +33 -0
- package/build/treb-grid/src/util/ua.js +86 -0
- package/build/treb-grid/src/util/ua.js.map +1 -0
- package/build/treb-parser/src/csv-parser.d.ts +13 -0
- package/build/treb-parser/src/csv-parser.js +107 -0
- package/build/treb-parser/src/csv-parser.js.map +1 -0
- package/build/treb-parser/src/index.d.ts +4 -0
- package/build/treb-parser/src/index.js +25 -0
- package/build/treb-parser/src/index.js.map +1 -0
- package/build/treb-parser/src/md-parser.d.ts +97 -0
- package/build/treb-parser/src/md-parser.js +403 -0
- package/build/treb-parser/src/md-parser.js.map +1 -0
- package/build/treb-parser/src/parser-types.d.ts +345 -0
- package/build/treb-parser/src/parser-types.js +53 -0
- package/build/treb-parser/src/parser-types.js.map +1 -0
- package/build/treb-parser/src/parser.d.ts +422 -0
- package/build/treb-parser/src/parser.js +2418 -0
- package/build/treb-parser/src/parser.js.map +1 -0
- package/build/treb-utils/src/event_source.d.ts +34 -0
- package/build/treb-utils/src/event_source.js +110 -0
- package/build/treb-utils/src/event_source.js.map +1 -0
- package/build/treb-utils/src/ievent_source.d.ts +9 -0
- package/build/treb-utils/src/ievent_source.js +22 -0
- package/build/treb-utils/src/ievent_source.js.map +1 -0
- package/build/treb-utils/src/index.d.ts +6 -0
- package/build/treb-utils/src/index.js +30 -0
- package/build/treb-utils/src/index.js.map +1 -0
- package/build/treb-utils/src/measurement.d.ts +42 -0
- package/build/treb-utils/src/measurement.js +145 -0
- package/build/treb-utils/src/measurement.js.map +1 -0
- package/build/treb-utils/src/scale.d.ts +16 -0
- package/build/treb-utils/src/scale.js +106 -0
- package/build/treb-utils/src/scale.js.map +1 -0
- package/build/treb-utils/src/serialize_html.d.ts +5 -0
- package/build/treb-utils/src/serialize_html.js +128 -0
- package/build/treb-utils/src/serialize_html.js.map +1 -0
- package/build/treb-utils/src/validate_uri.d.ts +20 -0
- package/build/treb-utils/src/validate_uri.js +55 -0
- package/build/treb-utils/src/validate_uri.js.map +1 -0
- package/dist/{chunk-XD5PEZBZ.mjs → chunk-A2NJA5VB.mjs} +1 -1
- package/dist/treb-export-worker.mjs +2 -2
- package/dist/treb-spreadsheet.mjs +4 -4
- package/dist/treb.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gamma.js","sourceRoot":"","sources":["../../../../treb-calculator/src/functions/gamma.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,EAAE;AACF,wDAAwD;AACxD,uDAAuD;AACvD,4CAA4C;AAC5C,EAAE;AAEF,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,OAAO,GAAG,MAAM,CAAC;AACvB,MAAM,SAAS,GAAG,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE;IAE5C,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IAChB,IAAI,CAAC,GAAG,CAAC,GAAG,GA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EAAE,CAAC,CAAC,CAAC;QAClC,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YAAC,OAAO,KAAK,CAAC;QAAC,CAAC;QACvC,OAAO,CAAC,GAAG,MAAM,CAAC;IACpB,CAAC;SACI,CAAC;QACJ,OAAO,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
import { ValueType } from 'treb-base-types';
|
|
22
|
+
const MatchType = (type, ref) => {
|
|
23
|
+
return {
|
|
24
|
+
type: ValueType.boolean,
|
|
25
|
+
value: typeof ref.value?.value === type,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const match_arguments = [{
|
|
29
|
+
name: 'Reference',
|
|
30
|
+
metadata: true,
|
|
31
|
+
unroll: true,
|
|
32
|
+
}];
|
|
33
|
+
export const InformationFunctionLibrary = {
|
|
34
|
+
IsBlank: {
|
|
35
|
+
description: 'Returns true if the reference is blank',
|
|
36
|
+
arguments: match_arguments,
|
|
37
|
+
fn: MatchType.bind(0, 'undefined'),
|
|
38
|
+
},
|
|
39
|
+
IsNumber: {
|
|
40
|
+
description: 'Returns true if the reference is a number',
|
|
41
|
+
arguments: match_arguments,
|
|
42
|
+
fn: MatchType.bind(0, 'number'),
|
|
43
|
+
},
|
|
44
|
+
IsLogical: {
|
|
45
|
+
description: 'Returns true if the reference is a logical TRUE or FALSE',
|
|
46
|
+
arguments: match_arguments,
|
|
47
|
+
fn: MatchType.bind(0, 'boolean'),
|
|
48
|
+
},
|
|
49
|
+
IsText: {
|
|
50
|
+
description: 'Returns true if the reference is text',
|
|
51
|
+
arguments: match_arguments,
|
|
52
|
+
fn: MatchType.bind(0, 'string'),
|
|
53
|
+
},
|
|
54
|
+
/* needs more data
|
|
55
|
+
ISFORMULA: {
|
|
56
|
+
description: 'Returns true if the reference is a formula',
|
|
57
|
+
arguments: [{
|
|
58
|
+
name: 'Reference',
|
|
59
|
+
metadata: true,
|
|
60
|
+
}],
|
|
61
|
+
fn: (ref: UnionValue): UnionValue => {
|
|
62
|
+
console.info("RR", ref);
|
|
63
|
+
return {
|
|
64
|
+
type: ValueType.boolean,
|
|
65
|
+
value: ref?.value && typeof ref.value.value === 'string' && ref.value.value[0] === '=',
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
*/
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=information-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"information-functions.js","sourceRoot":"","sources":["../../../../treb-calculator/src/functions/information-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,GAAe,EAAc,EAAE;IAC9D,OAAO;QACL,IAAI,EAAE,SAAS,CAAC,OAAO;QACvB,KAAK,EAAE,OAAQ,GAAG,CAAC,KAA2B,EAAE,KAAK,KAAK,IAAI;KAC/D,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC;QACvB,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAgB;IAErD,OAAO,EAAE;QACP,WAAW,EAAE,wCAAwC;QACrD,SAAS,EAAE,eAAe;QAC1B,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC;KACnC;IAED,QAAQ,EAAE;QACR,WAAW,EAAE,2CAA2C;QACxD,SAAS,EAAE,eAAe;QAC1B,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC;KAChC;IAED,SAAS,EAAE;QACT,WAAW,EAAE,0DAA0D;QACvE,SAAS,EAAE,eAAe;QAC1B,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC;KACjC;IAED,MAAM,EAAE;QACN,WAAW,EAAE,uCAAuC;QACpD,SAAS,EAAE,eAAe;QAC1B,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC;KAChC;IAED;;;;;;;;;;;;;;;MAeE;CAEH,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
import { ValueType } from 'treb-base-types';
|
|
22
|
+
export const LambdaFunctionLibrary = {
|
|
23
|
+
Lambda: {
|
|
24
|
+
// FIXME: we could use the create_binding_context callback
|
|
25
|
+
// here to validate the original parameters, might be useful
|
|
26
|
+
description: 'Creates a function',
|
|
27
|
+
arguments: [
|
|
28
|
+
{ name: 'Argument', repeat: true, boxed: true, passthrough: true },
|
|
29
|
+
{ name: 'Function', boxed: true, passthrough: true },
|
|
30
|
+
],
|
|
31
|
+
// pass through render/click functions
|
|
32
|
+
pass_through_ui: 'indirect',
|
|
33
|
+
fn: (...args) => {
|
|
34
|
+
return {
|
|
35
|
+
type: ValueType.function,
|
|
36
|
+
// FIXME: lock down this type
|
|
37
|
+
value: {
|
|
38
|
+
// we should probably clone these
|
|
39
|
+
bindings: args.slice(0, args.length - 1),
|
|
40
|
+
func: args[args.length - 1],
|
|
41
|
+
alt: 'LAMBDA', // metadata
|
|
42
|
+
type: 'function', // metadata
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
Let: {
|
|
48
|
+
// this function has weird semantics we don't normally see --
|
|
49
|
+
// the first two arguments repeat, and the last one is constant.
|
|
50
|
+
// our tooltips aren't prepared for this.
|
|
51
|
+
// also it creates temporary names, we'll need to create some sort
|
|
52
|
+
// of temporary binding context. complicated!
|
|
53
|
+
description: 'Binds values to names for a calculation',
|
|
54
|
+
arguments: [
|
|
55
|
+
{ name: 'Name', repeat: true },
|
|
56
|
+
{ name: 'Value', repeat: true },
|
|
57
|
+
{ name: 'Calculation', boxed: true },
|
|
58
|
+
],
|
|
59
|
+
create_binding_context: ({ args, descriptors }) => {
|
|
60
|
+
if (args.length % 2 !== 1) {
|
|
61
|
+
return undefined; // error
|
|
62
|
+
}
|
|
63
|
+
const context = {};
|
|
64
|
+
for (let i = 0; i < args.length - 1; i += 2) {
|
|
65
|
+
const name = args[i];
|
|
66
|
+
const value = args[i + 1];
|
|
67
|
+
if (name.type === 'identifier') {
|
|
68
|
+
context[name.name] = value;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return undefined; // error
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
context,
|
|
76
|
+
args: args.slice(-1),
|
|
77
|
+
argument_descriptors: descriptors.slice(-1),
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
fn: (arg) => {
|
|
81
|
+
return arg ? arg : { type: ValueType.undefined };
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=lambda-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambda-functions.js","sourceRoot":"","sources":["../../../../treb-calculator/src/functions/lambda-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAC,MAAM,qBAAqB,GAAgB;IAEhD,MAAM,EAAE;QAEN,0DAA0D;QAC1D,4DAA4D;QAE5D,WAAW,EAAE,oBAAoB;QACjC,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE;YAClE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE;SACrD;QAED,sCAAsC;QACtC,eAAe,EAAE,UAAU;QAE3B,EAAE,EAAE,CAAC,GAAG,IAAsB,EAAE,EAAE;YAChC,OAAO;gBACL,IAAI,EAAE,SAAS,CAAC,Q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AG,KAAK,CAAC;gBAC7B,CAAC;qBACI,CAAC;oBACJ,OAAO,SAAS,CAAC,CAAC,QAAQ;gBAC5B,CAAC;YAEH,CAAC;YAED,OAAO;gBACL,OAAO;gBACP,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACpB,oBAAoB,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAC5C,CAAA;QACH,CAAC;QAED,EAAE,EAAE,CAAC,GAAgB,EAAE,EAAE;YACvB,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC;QACnD,CAAC;KAEF;CAEF,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
import { ValueType, ComplexOrReal } from 'treb-base-types';
|
|
22
|
+
import { ValueError } from '../function-error';
|
|
23
|
+
import * as ComplexMath from '../complex-math';
|
|
24
|
+
/**
|
|
25
|
+
* given a range of data, ensure it's an array, check dimensions, and
|
|
26
|
+
* convert all real entries to complex (if possible).
|
|
27
|
+
*/
|
|
28
|
+
const ComplexMatrix = (input) => {
|
|
29
|
+
let a = [];
|
|
30
|
+
// ensure array
|
|
31
|
+
// hmmm... this is confusing. what is this doing? is this for scalars?
|
|
32
|
+
// if that were the case shouldn't it wrap up the outer value, and not
|
|
33
|
+
// the value property? ...
|
|
34
|
+
if (input.type === ValueType.array) {
|
|
35
|
+
a = input.value;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
// a = [[input.value]];
|
|
39
|
+
a = [[input]];
|
|
40
|
+
}
|
|
41
|
+
// if (!Array.isArray(a)) { a = [[a]]; }
|
|
42
|
+
const m = a.length;
|
|
43
|
+
const n = m ? a[0].length : 0;
|
|
44
|
+
const array = [];
|
|
45
|
+
// 0-length
|
|
46
|
+
if (!m || !n) {
|
|
47
|
+
return { m, n, array };
|
|
48
|
+
}
|
|
49
|
+
for (let i = 0; i < m; i++) {
|
|
50
|
+
const row = [];
|
|
51
|
+
for (let j = 0; j < n; j++) {
|
|
52
|
+
const ref = a[i][j];
|
|
53
|
+
if (ref.type === ValueType.complex) {
|
|
54
|
+
row.push({ ...ref.value });
|
|
55
|
+
}
|
|
56
|
+
else if (ref.type === ValueType.number) {
|
|
57
|
+
row.push({ real: ref.value, imaginary: 0 });
|
|
58
|
+
}
|
|
59
|
+
else if (ref.type === ValueType.undefined || ref.value === '') {
|
|
60
|
+
row.push({ real: 0, imaginary: 0 });
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
return { m, n, error: true, array: [] };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
array.push(row);
|
|
67
|
+
}
|
|
68
|
+
return { m, n, array };
|
|
69
|
+
};
|
|
70
|
+
export const MatrixFunctionLibrary = {
|
|
71
|
+
MDeterm: {
|
|
72
|
+
description: 'Returns the determinant of a matrix',
|
|
73
|
+
arguments: [
|
|
74
|
+
{ name: 'matrix', boxed: true },
|
|
75
|
+
],
|
|
76
|
+
fn: (a) => {
|
|
77
|
+
const matrix = ComplexMatrix(a);
|
|
78
|
+
if (!matrix.array || !matrix.m || !matrix.n || matrix.m !== matrix.n || matrix.error) {
|
|
79
|
+
return ValueError();
|
|
80
|
+
}
|
|
81
|
+
const result = ComplexMath.ComplexDeterminant(matrix);
|
|
82
|
+
if (!result) {
|
|
83
|
+
return ValueError();
|
|
84
|
+
}
|
|
85
|
+
return ComplexOrReal(result);
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
MInverse: {
|
|
89
|
+
description: 'Returns the inverse matrix',
|
|
90
|
+
arguments: [
|
|
91
|
+
{ name: 'matrix', boxed: true },
|
|
92
|
+
],
|
|
93
|
+
fn: (a) => {
|
|
94
|
+
const matrix = ComplexMatrix(a);
|
|
95
|
+
if (!matrix.array || !matrix.m || !matrix.n || matrix.m !== matrix.n || matrix.error) {
|
|
96
|
+
return ValueError();
|
|
97
|
+
}
|
|
98
|
+
// check singular
|
|
99
|
+
const det = ComplexMath.ComplexDeterminant(matrix);
|
|
100
|
+
if (det && (det.real === 0 && det?.imaginary === 0)) {
|
|
101
|
+
return ValueError();
|
|
102
|
+
}
|
|
103
|
+
const inverse = ComplexMath.MatrixInverse(matrix);
|
|
104
|
+
if (!inverse) {
|
|
105
|
+
return ValueError();
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
type: ValueType.array,
|
|
109
|
+
value: inverse.map(row => row.map(value => ComplexOrReal(value))),
|
|
110
|
+
};
|
|
111
|
+
// return inverse.map(row => row.map(value => ComplexOrReal(value)));
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
MMult: {
|
|
115
|
+
description: 'Returns the dot product A ⋅ B',
|
|
116
|
+
arguments: [
|
|
117
|
+
{ name: 'A', boxed: true },
|
|
118
|
+
{ name: 'B', boxed: true },
|
|
119
|
+
],
|
|
120
|
+
fn: (a, b) => {
|
|
121
|
+
const A = ComplexMatrix(a);
|
|
122
|
+
const B = ComplexMatrix(b);
|
|
123
|
+
// check data
|
|
124
|
+
if (!A.array || A.error || !B.array || B.error) {
|
|
125
|
+
return ValueError();
|
|
126
|
+
}
|
|
127
|
+
// check sizes
|
|
128
|
+
if (A.m !== B.n) {
|
|
129
|
+
return ValueError();
|
|
130
|
+
}
|
|
131
|
+
// NOTE the swap here. the input arrays are column-major,
|
|
132
|
+
// so we either need to transpose three times, or we can
|
|
133
|
+
// swap.
|
|
134
|
+
const product = ComplexMath.ComplexProduct(B, A);
|
|
135
|
+
// convert to reals where possible
|
|
136
|
+
return {
|
|
137
|
+
type: ValueType.array,
|
|
138
|
+
value: product.map(row => row.map(value => ComplexOrReal(value))),
|
|
139
|
+
};
|
|
140
|
+
// return product.map(row => row.map(value => ComplexOrReal(value)));
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=matrix-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix-functions.js","sourceRoot":"","sources":["../../../../treb-calculator/src/functions/matrix-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,WAAW,MAAM,iBAAiB,CAAC;AAI/C;;;GAGG;AACH,MAAM,aAAa,GAAG,CAAC,KAAiB,EAAqB,EAAE;IAE7D,IAAI,CAAC,GAAmB,EAAE,CAAC;IAE3B,eAAe;IAEf,sEAAsE;IACtE,uEAAuE;IACvE,0BAA0B;IAE1B,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK,EAAE,CAAC;QACnC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;IAClB,CAAC;SACI,CAAC;QAEJ,uBAAuB;QACvB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAEhB,CAAC;IAED,wCAAw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,CAAC,KAAK,EAAE,CAAC;gBAC/C,OAAO,UAAU,EAAE,CAAC;YACtB,CAAC;YAED,cAAc;YACd,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChB,OAAO,UAAU,EAAE,CAAC;YACtB,CAAC;YAED,yDAAyD;YACzD,wDAAwD;YACxD,QAAQ;YAER,MAAM,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAEjD,kCAAkC;YAElC,OAAO;gBACL,IAAI,EAAE,SAAS,CAAC,KAAK;gBACrB,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;aAClE,CAAC;YAEF,qEAAqE;QAEvE,CAAC;KACF;CAIF,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
/** imprecise but reasonably fast normsinv function */
|
|
22
|
+
export const InverseNormal = (q) => {
|
|
23
|
+
if (q === 0.50) {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
const p = (q < 1.0 && q > 0.5) ? (1 - q) : q;
|
|
27
|
+
const t = Math.sqrt(Math.log(1.0 / Math.pow(p, 2.0)));
|
|
28
|
+
const x = t - (2.515517 + 0.802853 * t + 0.010328 * Math.pow(t, 2.0)) /
|
|
29
|
+
(1.0 + 1.432788 * t + 0.189269 * Math.pow(t, 2.0) + 0.001308 * Math.pow(t, 3.0));
|
|
30
|
+
return (q > 0.5 ? x : -x);
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=normal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normal.js","sourceRoot":"","sources":["../../../../treb-calculator/src/functions/normal.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sDAAsD;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAS,EAAU,EAAE;IAEjD,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACf,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,GAAG,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACnE,CAAC,GAAG,GAAG,QAAQ,GAAG,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnF,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5B,CAAC,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
import { ValueType } from 'treb-base-types';
|
|
22
|
+
import { ArgumentError } from '../function-error';
|
|
23
|
+
export const RegexFunctionLibrary = {
|
|
24
|
+
RegexExtract: {
|
|
25
|
+
description: 'Extract text using a regular expression',
|
|
26
|
+
arguments: [
|
|
27
|
+
{
|
|
28
|
+
name: 'text',
|
|
29
|
+
unroll: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'pattern',
|
|
33
|
+
unroll: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'return mode',
|
|
37
|
+
unroll: true,
|
|
38
|
+
default: 0,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'case insensitive',
|
|
42
|
+
unroll: true,
|
|
43
|
+
default: false,
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
fn: (source_text, pattern = '', return_mode = 0, icase = false) => {
|
|
47
|
+
const args = [];
|
|
48
|
+
if (icase) {
|
|
49
|
+
args.push('i');
|
|
50
|
+
}
|
|
51
|
+
if (return_mode === 1) {
|
|
52
|
+
args.push('g');
|
|
53
|
+
}
|
|
54
|
+
const text = String(source_text ?? '');
|
|
55
|
+
let rex;
|
|
56
|
+
try {
|
|
57
|
+
rex = new RegExp(pattern, args.length ? args.join('') : undefined);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return ArgumentError();
|
|
61
|
+
}
|
|
62
|
+
switch (return_mode) {
|
|
63
|
+
case 0:
|
|
64
|
+
{
|
|
65
|
+
const result = text.match(rex);
|
|
66
|
+
return {
|
|
67
|
+
type: ValueType.string,
|
|
68
|
+
value: (result === null) ? '' : result[0] ?? '',
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
case 1:
|
|
72
|
+
{
|
|
73
|
+
const result = Array.from(text.matchAll(rex));
|
|
74
|
+
console.info({ result });
|
|
75
|
+
return {
|
|
76
|
+
type: ValueType.array,
|
|
77
|
+
value: [result.map(entry => ({
|
|
78
|
+
type: ValueType.string,
|
|
79
|
+
value: entry[0] || '',
|
|
80
|
+
}))],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
case 2:
|
|
84
|
+
{
|
|
85
|
+
const result = text.match(rex);
|
|
86
|
+
if (result === null) {
|
|
87
|
+
return {
|
|
88
|
+
type: ValueType.string,
|
|
89
|
+
value: '',
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const arr = Array.from(result).slice(1);
|
|
93
|
+
return {
|
|
94
|
+
type: ValueType.array,
|
|
95
|
+
value: [
|
|
96
|
+
arr.map(value => ({
|
|
97
|
+
type: ValueType.string,
|
|
98
|
+
value,
|
|
99
|
+
}))
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
default:
|
|
104
|
+
return ArgumentError();
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
RegexReplace: {
|
|
109
|
+
arguments: [
|
|
110
|
+
{
|
|
111
|
+
name: 'text',
|
|
112
|
+
unroll: true,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'pattern',
|
|
116
|
+
unroll: true,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'replacement',
|
|
120
|
+
unroll: true,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'occurrence',
|
|
124
|
+
unroll: true,
|
|
125
|
+
default: 0,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'case insensitive',
|
|
129
|
+
unroll: true,
|
|
130
|
+
default: false,
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
description: 'Replace text in a string using a regex',
|
|
134
|
+
fn: (text, pattern, replacement, occurrence = 0, icase = false) => {
|
|
135
|
+
const args = ['g'];
|
|
136
|
+
if (icase) {
|
|
137
|
+
args.push('i');
|
|
138
|
+
}
|
|
139
|
+
const rex = new RegExp(pattern, args.length ? args.join('') : undefined);
|
|
140
|
+
if (occurrence === 0) {
|
|
141
|
+
return {
|
|
142
|
+
type: ValueType.string,
|
|
143
|
+
value: text.replaceAll(rex, replacement), // huh?
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (occurrence < 0) {
|
|
147
|
+
const count = Array.from(text.matchAll(rex)).length;
|
|
148
|
+
occurrence += (count + 1);
|
|
149
|
+
}
|
|
150
|
+
const value = text.replace(rex, (match) => {
|
|
151
|
+
if (--occurrence === 0) {
|
|
152
|
+
return replacement;
|
|
153
|
+
}
|
|
154
|
+
return match;
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
type: ValueType.string,
|
|
158
|
+
value,
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
RegexTest: {
|
|
163
|
+
arguments: [
|
|
164
|
+
{
|
|
165
|
+
name: 'text',
|
|
166
|
+
unroll: true,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'pattern',
|
|
170
|
+
unroll: true,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: 'case insensitive',
|
|
174
|
+
unroll: true,
|
|
175
|
+
default: false,
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
description: 'Match text against a regular expression',
|
|
179
|
+
fn: (text, pattern, icase = false) => {
|
|
180
|
+
const rex = new RegExp(pattern, icase ? 'i' : undefined);
|
|
181
|
+
return {
|
|
182
|
+
type: ValueType.boolean,
|
|
183
|
+
value: rex.test(text),
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
//# sourceMappingURL=regex-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex-functions.js","sourceRoot":"","sources":["../../../../treb-calculator/src/functions/regex-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAE/C,YAAY,EAAE;QACZ,WAAW,EAAE,yCAAyC;QACtD,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,IAAI;aACb;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,IAAI;aACb;YACD;gBACE,IAAI,EAAE,aAAa;gBACnB,MAAM,EAAE,IAAI;gBACZ,OAAO,EAAE,CAAC;aAEX;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,MAAM,EAAE,IAAI;gBACZ,OAAO,EAAE,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EAAE;QACT,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,IAAI;aACb;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,IAAI;aACb;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,MAAM,EAAE,IAAI;gBACZ,OAAO,EAAE,KAAK;aAEf;SACF;QACD,WAAW,EAAE,yCAAyC;QACtD,EAAE,EAAE,CAAC,IAAY,EAAE,OAAe,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE;YACnD,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACzD,OAAO;gBACL,IAAI,EAAE,SAAS,CAAC,OAAO;gBACvB,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;aACtB,CAAC;QACJ,CAAC;KACF;CAEF,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* moved from sparkline module -- not sure why this needed a separate
|
|
3
|
+
* module. although on reflection it might be better placed in the charts
|
|
4
|
+
* module? (...)
|
|
5
|
+
*
|
|
6
|
+
* perhaps not because we use that module elsewhere and this one is only
|
|
7
|
+
* ever used in spreadsheets.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
import { type Cell, type CellStyle } from 'treb-base-types';
|
|
11
|
+
export interface SparklineRenderOptions {
|
|
12
|
+
context: CanvasRenderingContext2D;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
cell: Cell;
|
|
16
|
+
}
|
|
17
|
+
export declare class Sparkline {
|
|
18
|
+
static readonly default_color = "#888";
|
|
19
|
+
/**
|
|
20
|
+
* three possible cases:
|
|
21
|
+
*
|
|
22
|
+
* (1) array of numbers, possibly including missing values
|
|
23
|
+
* (2) typed array
|
|
24
|
+
* (3) nested array, so we need to recurse and concatenate
|
|
25
|
+
*
|
|
26
|
+
* there's actually one more case, where data comes in from serialized
|
|
27
|
+
* representation (loading file); in that case it's an object with numeric
|
|
28
|
+
* indexes (sadly)
|
|
29
|
+
*/
|
|
30
|
+
protected static UnpackValues(underlying: unknown): number[];
|
|
31
|
+
protected static SparklineCommon(cell: Cell, style: CellStyle): {
|
|
32
|
+
values: Array<number | undefined>;
|
|
33
|
+
colors: string[];
|
|
34
|
+
};
|
|
35
|
+
static RenderLine(width: number, height: number, context: CanvasRenderingContext2D, cell: Cell, style: CellStyle): void;
|
|
36
|
+
static RenderColumn(width: number, height: number, context: CanvasRenderingContext2D, cell: Cell, style: CellStyle): void;
|
|
37
|
+
}
|