ducjs 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.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/flatbuffers/duc/alternate-units.d.ts +21 -0
- package/dist/flatbuffers/duc/alternate-units.js +66 -0
- package/dist/flatbuffers/duc/angular-unit-system.d.ts +17 -0
- package/dist/flatbuffers/duc/angular-unit-system.js +50 -0
- package/dist/flatbuffers/duc/angular-units-format.d.ts +7 -0
- package/dist/flatbuffers/duc/angular-units-format.js +10 -0
- package/dist/flatbuffers/duc/axis.d.ts +5 -0
- package/dist/flatbuffers/duc/axis.js +8 -0
- package/dist/flatbuffers/duc/bezier-mirroring.d.ts +5 -0
- package/dist/flatbuffers/duc/bezier-mirroring.js +8 -0
- package/dist/flatbuffers/duc/blending.d.ts +9 -0
- package/dist/flatbuffers/duc/blending.js +12 -0
- package/dist/flatbuffers/duc/block-attachment.d.ts +4 -0
- package/dist/flatbuffers/duc/block-attachment.js +7 -0
- package/dist/flatbuffers/duc/boolean-operation.d.ts +6 -0
- package/dist/flatbuffers/duc/boolean-operation.js +9 -0
- package/dist/flatbuffers/duc/bound-element.d.ts +17 -0
- package/dist/flatbuffers/duc/bound-element.js +48 -0
- package/dist/flatbuffers/duc/checkpoint.d.ts +22 -0
- package/dist/flatbuffers/duc/checkpoint.js +75 -0
- package/dist/flatbuffers/duc/column-layout.d.ts +22 -0
- package/dist/flatbuffers/duc/column-layout.js +72 -0
- package/dist/flatbuffers/duc/column-type.d.ts +5 -0
- package/dist/flatbuffers/duc/column-type.js +8 -0
- package/dist/flatbuffers/duc/custom-hatch-pattern.d.ts +23 -0
- package/dist/flatbuffers/duc/custom-hatch-pattern.js +71 -0
- package/dist/flatbuffers/duc/datum-bracket-style.d.ts +5 -0
- package/dist/flatbuffers/duc/datum-bracket-style.js +8 -0
- package/dist/flatbuffers/duc/datum-reference.d.ts +17 -0
- package/dist/flatbuffers/duc/datum-reference.js +49 -0
- package/dist/flatbuffers/duc/datum-target-type.d.ts +6 -0
- package/dist/flatbuffers/duc/datum-target-type.js +9 -0
- package/dist/flatbuffers/duc/decimal-separator.d.ts +4 -0
- package/dist/flatbuffers/duc/decimal-separator.js +7 -0
- package/dist/flatbuffers/duc/delta.d.ts +20 -0
- package/dist/flatbuffers/duc/delta.js +64 -0
- package/dist/flatbuffers/duc/dictionary-entry.d.ts +17 -0
- package/dist/flatbuffers/duc/dictionary-entry.js +49 -0
- package/dist/flatbuffers/duc/dimension-baseline-data.d.ts +14 -0
- package/dist/flatbuffers/duc/dimension-baseline-data.js +40 -0
- package/dist/flatbuffers/duc/dimension-bindings.d.ts +17 -0
- package/dist/flatbuffers/duc/dimension-bindings.js +50 -0
- package/dist/flatbuffers/duc/dimension-continue-data.d.ts +14 -0
- package/dist/flatbuffers/duc/dimension-continue-data.js +40 -0
- package/dist/flatbuffers/duc/dimension-definition-points.d.ts +21 -0
- package/dist/flatbuffers/duc/dimension-definition-points.js +64 -0
- package/dist/flatbuffers/duc/dimension-ext-line-style.d.ts +18 -0
- package/dist/flatbuffers/duc/dimension-ext-line-style.js +57 -0
- package/dist/flatbuffers/duc/dimension-fit-rule.d.ts +6 -0
- package/dist/flatbuffers/duc/dimension-fit-rule.js +9 -0
- package/dist/flatbuffers/duc/dimension-fit-style.d.ts +19 -0
- package/dist/flatbuffers/duc/dimension-fit-style.js +58 -0
- package/dist/flatbuffers/duc/dimension-line-style.d.ts +16 -0
- package/dist/flatbuffers/duc/dimension-line-style.js +49 -0
- package/dist/flatbuffers/duc/dimension-symbol-style.d.ts +22 -0
- package/dist/flatbuffers/duc/dimension-symbol-style.js +72 -0
- package/dist/flatbuffers/duc/dimension-text-placement.d.ts +5 -0
- package/dist/flatbuffers/duc/dimension-text-placement.js +8 -0
- package/dist/flatbuffers/duc/dimension-tolerance-style.d.ts +24 -0
- package/dist/flatbuffers/duc/dimension-tolerance-style.js +71 -0
- package/dist/flatbuffers/duc/dimension-type.d.ts +15 -0
- package/dist/flatbuffers/duc/dimension-type.js +18 -0
- package/dist/flatbuffers/duc/dimension-units-format.d.ts +7 -0
- package/dist/flatbuffers/duc/dimension-units-format.js +10 -0
- package/dist/flatbuffers/duc/dimension-validation-rules.d.ts +25 -0
- package/dist/flatbuffers/duc/dimension-validation-rules.js +74 -0
- package/dist/flatbuffers/duc/duc-arrow-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-arrow-element.js +49 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition.js +64 -0
- package/dist/flatbuffers/duc/duc-block-duplication-array.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-block-duplication-array.js +64 -0
- package/dist/flatbuffers/duc/duc-block-instance-element.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-block-instance-element.js +94 -0
- package/dist/flatbuffers/duc/duc-block.d.ts +34 -0
- package/dist/flatbuffers/duc/duc-block.js +111 -0
- package/dist/flatbuffers/duc/duc-common-style.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-common-style.js +44 -0
- package/dist/flatbuffers/duc/duc-dimension-element.d.ts +45 -0
- package/dist/flatbuffers/duc/duc-dimension-element.js +120 -0
- package/dist/flatbuffers/duc/duc-dimension-style.d.ts +28 -0
- package/dist/flatbuffers/duc/duc-dimension-style.js +76 -0
- package/dist/flatbuffers/duc/duc-doc-element.d.ts +33 -0
- package/dist/flatbuffers/duc/duc-doc-element.js +95 -0
- package/dist/flatbuffers/duc/duc-doc-style.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-doc-style.js +52 -0
- package/dist/flatbuffers/duc/duc-element-base.d.ts +88 -0
- package/dist/flatbuffers/duc/duc-element-base.js +269 -0
- package/dist/flatbuffers/duc/duc-element-styles-base.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-element-styles-base.js +103 -0
- package/dist/flatbuffers/duc/duc-ellipse-element.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-ellipse-element.js +73 -0
- package/dist/flatbuffers/duc/duc-embeddable-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-embeddable-element.js +41 -0
- package/dist/flatbuffers/duc/duc-external-file-data.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-external-file-data.js +92 -0
- package/dist/flatbuffers/duc/duc-external-file-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-external-file-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-element.d.ts +31 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-element.js +89 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-style.d.ts +25 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-style.js +68 -0
- package/dist/flatbuffers/duc/duc-frame-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-frame-element.js +41 -0
- package/dist/flatbuffers/duc/duc-free-draw-element.d.ts +52 -0
- package/dist/flatbuffers/duc/duc-free-draw-element.js +154 -0
- package/dist/flatbuffers/duc/duc-free-draw-ends.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-free-draw-ends.js +56 -0
- package/dist/flatbuffers/duc/duc-global-state.d.ts +37 -0
- package/dist/flatbuffers/duc/duc-global-state.js +121 -0
- package/dist/flatbuffers/duc/duc-group.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-group.js +44 -0
- package/dist/flatbuffers/duc/duc-hatch-style.d.ts +28 -0
- package/dist/flatbuffers/duc/duc-hatch-style.js +79 -0
- package/dist/flatbuffers/duc/duc-head.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-head.js +57 -0
- package/dist/flatbuffers/duc/duc-image-element.d.ts +35 -0
- package/dist/flatbuffers/duc/duc-image-element.js +91 -0
- package/dist/flatbuffers/duc/duc-image-filter.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-image-filter.js +48 -0
- package/dist/flatbuffers/duc/duc-layer-overrides.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-layer-overrides.js +44 -0
- package/dist/flatbuffers/duc/duc-layer.d.ts +21 -0
- package/dist/flatbuffers/duc/duc-layer.js +59 -0
- package/dist/flatbuffers/duc/duc-leader-element.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-leader-element.js +60 -0
- package/dist/flatbuffers/duc/duc-leader-style.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-leader-style.js +87 -0
- package/dist/flatbuffers/duc/duc-line-reference.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-line-reference.js +43 -0
- package/dist/flatbuffers/duc/duc-line.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-line.js +43 -0
- package/dist/flatbuffers/duc/duc-linear-element-base.d.ts +38 -0
- package/dist/flatbuffers/duc/duc-linear-element-base.js +124 -0
- package/dist/flatbuffers/duc/duc-linear-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-linear-element.js +49 -0
- package/dist/flatbuffers/duc/duc-local-state.d.ts +68 -0
- package/dist/flatbuffers/duc/duc-local-state.js +206 -0
- package/dist/flatbuffers/duc/duc-mermaid-element.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-mermaid-element.js +65 -0
- package/dist/flatbuffers/duc/duc-parametric-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-parametric-element.js +44 -0
- package/dist/flatbuffers/duc/duc-path.d.ts +26 -0
- package/dist/flatbuffers/duc/duc-path.js +69 -0
- package/dist/flatbuffers/duc/duc-pdf-element.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-pdf-element.js +49 -0
- package/dist/flatbuffers/duc/duc-plot-element.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-plot-element.js +52 -0
- package/dist/flatbuffers/duc/duc-plot-style.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-plot-style.js +41 -0
- package/dist/flatbuffers/duc/duc-point-binding.d.ts +26 -0
- package/dist/flatbuffers/duc/duc-point-binding.js +73 -0
- package/dist/flatbuffers/duc/duc-point.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-point.js +57 -0
- package/dist/flatbuffers/duc/duc-polygon-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-polygon-element.js +49 -0
- package/dist/flatbuffers/duc/duc-rectangle-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-rectangle-element.js +41 -0
- package/dist/flatbuffers/duc/duc-region.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-region.js +51 -0
- package/dist/flatbuffers/duc/duc-stack-base.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-stack-base.js +78 -0
- package/dist/flatbuffers/duc/duc-stack-element-base.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-stack-element-base.js +65 -0
- package/dist/flatbuffers/duc/duc-stack-like-styles.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-stack-like-styles.js +48 -0
- package/dist/flatbuffers/duc/duc-table-auto-size.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-table-auto-size.js +48 -0
- package/dist/flatbuffers/duc/duc-table-cell-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-cell-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-cell-span.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-table-cell-span.js +48 -0
- package/dist/flatbuffers/duc/duc-table-cell-style.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-table-cell-style.js +59 -0
- package/dist/flatbuffers/duc/duc-table-cell.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-table-cell.js +72 -0
- package/dist/flatbuffers/duc/duc-table-column-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-column-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-column.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-table-column.js +51 -0
- package/dist/flatbuffers/duc/duc-table-element.d.ts +51 -0
- package/dist/flatbuffers/duc/duc-table-element.js +167 -0
- package/dist/flatbuffers/duc/duc-table-row-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-row-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-row.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-table-row.js +51 -0
- package/dist/flatbuffers/duc/duc-table-style.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-table-style.js +65 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-dictionary-source.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-dictionary-source.js +40 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-element-source.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-element-source.js +49 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-part.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-part.js +58 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source-data.d.ts +9 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source-data.js +26 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source.js +58 -0
- package/dist/flatbuffers/duc/duc-text-element.d.ts +33 -0
- package/dist/flatbuffers/duc/duc-text-element.js +94 -0
- package/dist/flatbuffers/duc/duc-text-style.d.ts +44 -0
- package/dist/flatbuffers/duc/duc-text-style.js +128 -0
- package/dist/flatbuffers/duc/duc-ucs.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-ucs.js +49 -0
- package/dist/flatbuffers/duc/duc-view.d.ts +24 -0
- package/dist/flatbuffers/duc/duc-view.js +71 -0
- package/dist/flatbuffers/duc/duc-viewport-element.d.ts +36 -0
- package/dist/flatbuffers/duc/duc-viewport-element.js +102 -0
- package/dist/flatbuffers/duc/duc-viewport-style.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-viewport-style.js +49 -0
- package/dist/flatbuffers/duc/duc-xray-element.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-xray-element.js +66 -0
- package/dist/flatbuffers/duc/duc-xray-style.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-xray-style.js +49 -0
- package/dist/flatbuffers/duc/dynamic-snap-settings.d.ts +17 -0
- package/dist/flatbuffers/duc/dynamic-snap-settings.js +56 -0
- package/dist/flatbuffers/duc/element-background.d.ts +14 -0
- package/dist/flatbuffers/duc/element-background.js +41 -0
- package/dist/flatbuffers/duc/element-content-base.d.ts +29 -0
- package/dist/flatbuffers/duc/element-content-base.js +80 -0
- package/dist/flatbuffers/duc/element-content-preference.d.ts +8 -0
- package/dist/flatbuffers/duc/element-content-preference.js +11 -0
- package/dist/flatbuffers/duc/element-stroke.d.ts +24 -0
- package/dist/flatbuffers/duc/element-stroke.js +66 -0
- package/dist/flatbuffers/duc/element-wrapper.d.ts +16 -0
- package/dist/flatbuffers/duc/element-wrapper.js +49 -0
- package/dist/flatbuffers/duc/element.d.ts +49 -0
- package/dist/flatbuffers/duc/element.js +106 -0
- package/dist/flatbuffers/duc/exported-data-state.d.ts +87 -0
- package/dist/flatbuffers/duc/exported-data-state.js +290 -0
- package/dist/flatbuffers/duc/fcfbetween-modifier.d.ts +17 -0
- package/dist/flatbuffers/duc/fcfbetween-modifier.js +48 -0
- package/dist/flatbuffers/duc/fcfdatum-definition.d.ts +16 -0
- package/dist/flatbuffers/duc/fcfdatum-definition.js +43 -0
- package/dist/flatbuffers/duc/fcfdatum-style.d.ts +14 -0
- package/dist/flatbuffers/duc/fcfdatum-style.js +41 -0
- package/dist/flatbuffers/duc/fcfframe-modifiers.d.ts +22 -0
- package/dist/flatbuffers/duc/fcfframe-modifiers.js +65 -0
- package/dist/flatbuffers/duc/fcflayout-style.d.ts +17 -0
- package/dist/flatbuffers/duc/fcflayout-style.js +56 -0
- package/dist/flatbuffers/duc/fcfprojected-zone-modifier.d.ts +13 -0
- package/dist/flatbuffers/duc/fcfprojected-zone-modifier.js +40 -0
- package/dist/flatbuffers/duc/fcfsegment-row.d.ts +17 -0
- package/dist/flatbuffers/duc/fcfsegment-row.js +55 -0
- package/dist/flatbuffers/duc/fcfsymbol-style.d.ts +13 -0
- package/dist/flatbuffers/duc/fcfsymbol-style.js +40 -0
- package/dist/flatbuffers/duc/feature-control-frame-segment.d.ts +22 -0
- package/dist/flatbuffers/duc/feature-control-frame-segment.js +65 -0
- package/dist/flatbuffers/duc/feature-modifier.d.ts +18 -0
- package/dist/flatbuffers/duc/feature-modifier.js +21 -0
- package/dist/flatbuffers/duc/gdt-symbol.d.ts +22 -0
- package/dist/flatbuffers/duc/gdt-symbol.js +25 -0
- package/dist/flatbuffers/duc/geometric-point.d.ts +10 -0
- package/dist/flatbuffers/duc/geometric-point.js +27 -0
- package/dist/flatbuffers/duc/grid-display-type.d.ts +6 -0
- package/dist/flatbuffers/duc/grid-display-type.js +9 -0
- package/dist/flatbuffers/duc/grid-settings.d.ts +54 -0
- package/dist/flatbuffers/duc/grid-settings.js +165 -0
- package/dist/flatbuffers/duc/grid-style.d.ts +26 -0
- package/dist/flatbuffers/duc/grid-style.js +74 -0
- package/dist/flatbuffers/duc/grid-type.d.ts +7 -0
- package/dist/flatbuffers/duc/grid-type.js +10 -0
- package/dist/flatbuffers/duc/handle-type.d.ts +4 -0
- package/dist/flatbuffers/duc/handle-type.js +7 -0
- package/dist/flatbuffers/duc/hatch-pattern-line.d.ts +35 -0
- package/dist/flatbuffers/duc/hatch-pattern-line.js +93 -0
- package/dist/flatbuffers/duc/hatch-style.d.ts +5 -0
- package/dist/flatbuffers/duc/hatch-style.js +8 -0
- package/dist/flatbuffers/duc/identified-common-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-common-style.js +44 -0
- package/dist/flatbuffers/duc/identified-dimension-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-dimension-style.js +44 -0
- package/dist/flatbuffers/duc/identified-doc-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-doc-style.js +44 -0
- package/dist/flatbuffers/duc/identified-fcfstyle.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-fcfstyle.js +44 -0
- package/dist/flatbuffers/duc/identified-grid-settings.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-grid-settings.js +44 -0
- package/dist/flatbuffers/duc/identified-hatch-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-hatch-style.js +44 -0
- package/dist/flatbuffers/duc/identified-leader-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-leader-style.js +44 -0
- package/dist/flatbuffers/duc/identified-snap-settings.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-snap-settings.js +44 -0
- package/dist/flatbuffers/duc/identified-stack-like-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-stack-like-style.js +44 -0
- package/dist/flatbuffers/duc/identified-table-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-table-style.js +44 -0
- package/dist/flatbuffers/duc/identified-text-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-text-style.js +44 -0
- package/dist/flatbuffers/duc/identified-ucs.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-ucs.js +44 -0
- package/dist/flatbuffers/duc/identified-view.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-view.js +44 -0
- package/dist/flatbuffers/duc/identified-viewport-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-viewport-style.js +44 -0
- package/dist/flatbuffers/duc/identified-xray-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-xray-style.js +44 -0
- package/dist/flatbuffers/duc/identifier.d.ts +20 -0
- package/dist/flatbuffers/duc/identifier.js +57 -0
- package/dist/flatbuffers/duc/image-crop.d.ts +23 -0
- package/dist/flatbuffers/duc/image-crop.js +80 -0
- package/dist/flatbuffers/duc/image-status.d.ts +5 -0
- package/dist/flatbuffers/duc/image-status.js +8 -0
- package/dist/flatbuffers/duc/isometric-grid-settings.d.ts +15 -0
- package/dist/flatbuffers/duc/isometric-grid-settings.js +48 -0
- package/dist/flatbuffers/duc/jsonpatch-operation.d.ts +23 -0
- package/dist/flatbuffers/duc/jsonpatch-operation.js +64 -0
- package/dist/flatbuffers/duc/layer-snap-filters.d.ts +23 -0
- package/dist/flatbuffers/duc/layer-snap-filters.js +76 -0
- package/dist/flatbuffers/duc/layer-validation-rules.d.ts +17 -0
- package/dist/flatbuffers/duc/layer-validation-rules.js +54 -0
- package/dist/flatbuffers/duc/leader-block-content.d.ts +25 -0
- package/dist/flatbuffers/duc/leader-block-content.js +85 -0
- package/dist/flatbuffers/duc/leader-content-data.d.ts +9 -0
- package/dist/flatbuffers/duc/leader-content-data.js +26 -0
- package/dist/flatbuffers/duc/leader-content-type.d.ts +4 -0
- package/dist/flatbuffers/duc/leader-content-type.js +7 -0
- package/dist/flatbuffers/duc/leader-content.d.ts +19 -0
- package/dist/flatbuffers/duc/leader-content.js +58 -0
- package/dist/flatbuffers/duc/leader-text-block-content.d.ts +14 -0
- package/dist/flatbuffers/duc/leader-text-block-content.js +40 -0
- package/dist/flatbuffers/duc/line-head.d.ts +17 -0
- package/dist/flatbuffers/duc/line-head.js +20 -0
- package/dist/flatbuffers/duc/line-spacing-type.d.ts +5 -0
- package/dist/flatbuffers/duc/line-spacing-type.js +8 -0
- package/dist/flatbuffers/duc/line-spacing.d.ts +16 -0
- package/dist/flatbuffers/duc/line-spacing.js +49 -0
- package/dist/flatbuffers/duc/linear-unit-system.d.ts +24 -0
- package/dist/flatbuffers/duc/linear-unit-system.js +75 -0
- package/dist/flatbuffers/duc/margins.d.ts +19 -0
- package/dist/flatbuffers/duc/margins.js +64 -0
- package/dist/flatbuffers/duc/mark-ellipse-center.d.ts +4 -0
- package/dist/flatbuffers/duc/mark-ellipse-center.js +7 -0
- package/dist/flatbuffers/duc/material-condition.d.ts +5 -0
- package/dist/flatbuffers/duc/material-condition.js +8 -0
- package/dist/flatbuffers/duc/object-snap-mode.d.ts +22 -0
- package/dist/flatbuffers/duc/object-snap-mode.js +25 -0
- package/dist/flatbuffers/duc/paragraph-formatting.d.ts +33 -0
- package/dist/flatbuffers/duc/paragraph-formatting.js +106 -0
- package/dist/flatbuffers/duc/parametric-source-type.d.ts +4 -0
- package/dist/flatbuffers/duc/parametric-source-type.js +7 -0
- package/dist/flatbuffers/duc/parametric-source.d.ts +20 -0
- package/dist/flatbuffers/duc/parametric-source.js +57 -0
- package/dist/flatbuffers/duc/plot-layout.d.ts +14 -0
- package/dist/flatbuffers/duc/plot-layout.js +41 -0
- package/dist/flatbuffers/duc/point-binding-point.d.ts +15 -0
- package/dist/flatbuffers/duc/point-binding-point.js +48 -0
- package/dist/flatbuffers/duc/polar-grid-settings.d.ts +17 -0
- package/dist/flatbuffers/duc/polar-grid-settings.js +56 -0
- package/dist/flatbuffers/duc/polar-tracking-settings.d.ts +29 -0
- package/dist/flatbuffers/duc/polar-tracking-settings.js +90 -0
- package/dist/flatbuffers/duc/primary-units.d.ts +16 -0
- package/dist/flatbuffers/duc/primary-units.js +44 -0
- package/dist/flatbuffers/duc/pruning-level.d.ts +5 -0
- package/dist/flatbuffers/duc/pruning-level.js +8 -0
- package/dist/flatbuffers/duc/snap-marker-settings.d.ts +23 -0
- package/dist/flatbuffers/duc/snap-marker-settings.js +79 -0
- package/dist/flatbuffers/duc/snap-marker-shape.d.ts +6 -0
- package/dist/flatbuffers/duc/snap-marker-shape.js +9 -0
- package/dist/flatbuffers/duc/snap-marker-style-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/snap-marker-style-entry.js +43 -0
- package/dist/flatbuffers/duc/snap-marker-style.d.ts +17 -0
- package/dist/flatbuffers/duc/snap-marker-style.js +49 -0
- package/dist/flatbuffers/duc/snap-mode.d.ts +4 -0
- package/dist/flatbuffers/duc/snap-mode.js +7 -0
- package/dist/flatbuffers/duc/snap-override-behavior.d.ts +5 -0
- package/dist/flatbuffers/duc/snap-override-behavior.js +8 -0
- package/dist/flatbuffers/duc/snap-override.d.ts +17 -0
- package/dist/flatbuffers/duc/snap-override.js +49 -0
- package/dist/flatbuffers/duc/snap-settings.d.ts +75 -0
- package/dist/flatbuffers/duc/snap-settings.js +245 -0
- package/dist/flatbuffers/duc/stack-format-properties.d.ts +18 -0
- package/dist/flatbuffers/duc/stack-format-properties.js +57 -0
- package/dist/flatbuffers/duc/stack-format.d.ts +21 -0
- package/dist/flatbuffers/duc/stack-format.js +64 -0
- package/dist/flatbuffers/duc/stacked-text-align.d.ts +5 -0
- package/dist/flatbuffers/duc/stacked-text-align.js +8 -0
- package/dist/flatbuffers/duc/standard-overrides.d.ts +63 -0
- package/dist/flatbuffers/duc/standard-overrides.js +162 -0
- package/dist/flatbuffers/duc/standard-styles.d.ts +77 -0
- package/dist/flatbuffers/duc/standard-styles.js +285 -0
- package/dist/flatbuffers/duc/standard-units.d.ts +16 -0
- package/dist/flatbuffers/duc/standard-units.js +44 -0
- package/dist/flatbuffers/duc/standard-validation.d.ts +16 -0
- package/dist/flatbuffers/duc/standard-validation.js +44 -0
- package/dist/flatbuffers/duc/standard-view-settings.d.ts +35 -0
- package/dist/flatbuffers/duc/standard-view-settings.js +124 -0
- package/dist/flatbuffers/duc/standard.d.ts +33 -0
- package/dist/flatbuffers/duc/standard.js +90 -0
- package/dist/flatbuffers/duc/string-value-entry.d.ts +17 -0
- package/dist/flatbuffers/duc/string-value-entry.js +49 -0
- package/dist/flatbuffers/duc/stroke-cap.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-cap.js +8 -0
- package/dist/flatbuffers/duc/stroke-join.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-join.js +8 -0
- package/dist/flatbuffers/duc/stroke-placement.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-placement.js +8 -0
- package/dist/flatbuffers/duc/stroke-preference.d.ts +6 -0
- package/dist/flatbuffers/duc/stroke-preference.js +9 -0
- package/dist/flatbuffers/duc/stroke-side-preference.d.ts +8 -0
- package/dist/flatbuffers/duc/stroke-side-preference.js +11 -0
- package/dist/flatbuffers/duc/stroke-sides.d.ts +24 -0
- package/dist/flatbuffers/duc/stroke-sides.js +67 -0
- package/dist/flatbuffers/duc/stroke-style.d.ts +37 -0
- package/dist/flatbuffers/duc/stroke-style.js +111 -0
- package/dist/flatbuffers/duc/stroke-width.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-width.js +8 -0
- package/dist/flatbuffers/duc/table-cell-alignment.d.ts +11 -0
- package/dist/flatbuffers/duc/table-cell-alignment.js +14 -0
- package/dist/flatbuffers/duc/table-flow-direction.d.ts +4 -0
- package/dist/flatbuffers/duc/table-flow-direction.js +7 -0
- package/dist/flatbuffers/duc/text-align.d.ts +5 -0
- package/dist/flatbuffers/duc/text-align.js +8 -0
- package/dist/flatbuffers/duc/text-column.d.ts +15 -0
- package/dist/flatbuffers/duc/text-column.js +48 -0
- package/dist/flatbuffers/duc/text-field-source-property.d.ts +13 -0
- package/dist/flatbuffers/duc/text-field-source-property.js +16 -0
- package/dist/flatbuffers/duc/text-field-source-type.d.ts +4 -0
- package/dist/flatbuffers/duc/text-field-source-type.js +7 -0
- package/dist/flatbuffers/duc/text-flow-direction.d.ts +6 -0
- package/dist/flatbuffers/duc/text-flow-direction.js +9 -0
- package/dist/flatbuffers/duc/tiling-properties.d.ts +21 -0
- package/dist/flatbuffers/duc/tiling-properties.js +75 -0
- package/dist/flatbuffers/duc/tolerance-clause.d.ts +27 -0
- package/dist/flatbuffers/duc/tolerance-clause.js +84 -0
- package/dist/flatbuffers/duc/tolerance-display.d.ts +7 -0
- package/dist/flatbuffers/duc/tolerance-display.js +10 -0
- package/dist/flatbuffers/duc/tolerance-type.d.ts +5 -0
- package/dist/flatbuffers/duc/tolerance-type.js +8 -0
- package/dist/flatbuffers/duc/tolerance-zone-type.d.ts +7 -0
- package/dist/flatbuffers/duc/tolerance-zone-type.js +10 -0
- package/dist/flatbuffers/duc/tracking-line-style.d.ts +26 -0
- package/dist/flatbuffers/duc/tracking-line-style.js +74 -0
- package/dist/flatbuffers/duc/unit-precision.d.ts +19 -0
- package/dist/flatbuffers/duc/unit-precision.js +64 -0
- package/dist/flatbuffers/duc/unit-system-base.d.ts +20 -0
- package/dist/flatbuffers/duc/unit-system-base.js +65 -0
- package/dist/flatbuffers/duc/unit-system.d.ts +4 -0
- package/dist/flatbuffers/duc/unit-system.js +7 -0
- package/dist/flatbuffers/duc/version-base.d.ts +27 -0
- package/dist/flatbuffers/duc/version-base.js +80 -0
- package/dist/flatbuffers/duc/version-graph-metadata.d.ts +15 -0
- package/dist/flatbuffers/duc/version-graph-metadata.js +48 -0
- package/dist/flatbuffers/duc/version-graph.d.ts +31 -0
- package/dist/flatbuffers/duc/version-graph.js +94 -0
- package/dist/flatbuffers/duc/vertical-align.d.ts +5 -0
- package/dist/flatbuffers/duc/vertical-align.js +8 -0
- package/dist/flatbuffers/duc/viewport-shade-plot.d.ts +6 -0
- package/dist/flatbuffers/duc/viewport-shade-plot.js +9 -0
- package/dist/flatbuffers/duc/youtube-states.d.ts +8 -0
- package/dist/flatbuffers/duc/youtube-states.js +11 -0
- package/dist/flatbuffers/duc.d.ts +227 -0
- package/dist/flatbuffers/duc.js +229 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/legacy/index.d.ts +1 -0
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/v1/duc/app-state.d.ts +124 -0
- package/dist/legacy/v1/duc/app-state.js +388 -0
- package/dist/legacy/v1/duc/binary-file-data.d.ts +27 -0
- package/dist/legacy/v1/duc/binary-file-data.js +90 -0
- package/dist/legacy/v1/duc/binary-files-entry.d.ts +16 -0
- package/dist/legacy/v1/duc/binary-files-entry.js +43 -0
- package/dist/legacy/v1/duc/binary-files.d.ts +17 -0
- package/dist/legacy/v1/duc/binary-files.js +55 -0
- package/dist/legacy/v1/duc/binding-point.d.ts +15 -0
- package/dist/legacy/v1/duc/binding-point.js +48 -0
- package/dist/legacy/v1/duc/bound-element.d.ts +17 -0
- package/dist/legacy/v1/duc/bound-element.js +48 -0
- package/dist/legacy/v1/duc/duc-block-attribute-details.d.ts +22 -0
- package/dist/legacy/v1/duc/duc-block-attribute-details.js +57 -0
- package/dist/legacy/v1/duc/duc-block-attribute.d.ts +16 -0
- package/dist/legacy/v1/duc/duc-block-attribute.js +43 -0
- package/dist/legacy/v1/duc/duc-block-instance-element-override.d.ts +17 -0
- package/dist/legacy/v1/duc/duc-block-instance-element-override.js +48 -0
- package/dist/legacy/v1/duc/duc-block.d.ts +34 -0
- package/dist/legacy/v1/duc/duc-block.js +110 -0
- package/dist/legacy/v1/duc/duc-element.d.ts +273 -0
- package/dist/legacy/v1/duc/duc-element.js +865 -0
- package/dist/legacy/v1/duc/duc-group.d.ts +40 -0
- package/dist/legacy/v1/duc/duc-group.js +114 -0
- package/dist/legacy/v1/duc/duc-line-reference.d.ts +15 -0
- package/dist/legacy/v1/duc/duc-line-reference.js +43 -0
- package/dist/legacy/v1/duc/duc-line.d.ts +15 -0
- package/dist/legacy/v1/duc/duc-line.js +43 -0
- package/dist/legacy/v1/duc/duc-path.d.ts +26 -0
- package/dist/legacy/v1/duc/duc-path.js +69 -0
- package/dist/legacy/v1/duc/duc-table-cell.d.ts +22 -0
- package/dist/legacy/v1/duc/duc-table-cell.js +57 -0
- package/dist/legacy/v1/duc/duc-table-column.d.ts +18 -0
- package/dist/legacy/v1/duc/duc-table-column.js +50 -0
- package/dist/legacy/v1/duc/duc-table-row.d.ts +18 -0
- package/dist/legacy/v1/duc/duc-table-row.js +50 -0
- package/dist/legacy/v1/duc/duc-table-style-props.d.ts +39 -0
- package/dist/legacy/v1/duc/duc-table-style-props.js +114 -0
- package/dist/legacy/v1/duc/duc-table-style.d.ts +14 -0
- package/dist/legacy/v1/duc/duc-table-style.js +41 -0
- package/dist/legacy/v1/duc/element-background.d.ts +14 -0
- package/dist/legacy/v1/duc/element-background.js +41 -0
- package/dist/legacy/v1/duc/element-content-base.d.ts +22 -0
- package/dist/legacy/v1/duc/element-content-base.js +64 -0
- package/dist/legacy/v1/duc/element-stroke.d.ts +23 -0
- package/dist/legacy/v1/duc/element-stroke.js +66 -0
- package/dist/legacy/v1/duc/exported-data-state.d.ts +51 -0
- package/dist/legacy/v1/duc/exported-data-state.js +155 -0
- package/dist/legacy/v1/duc/image-crop.d.ts +23 -0
- package/dist/legacy/v1/duc/image-crop.js +80 -0
- package/dist/legacy/v1/duc/linear-element-editor.d.ts +44 -0
- package/dist/legacy/v1/duc/linear-element-editor.js +119 -0
- package/dist/legacy/v1/duc/point-binding.d.ts +25 -0
- package/dist/legacy/v1/duc/point-binding.js +72 -0
- package/dist/legacy/v1/duc/point.d.ts +20 -0
- package/dist/legacy/v1/duc/point.js +63 -0
- package/dist/legacy/v1/duc/pointer-down-state.d.ts +32 -0
- package/dist/legacy/v1/duc/pointer-down-state.js +90 -0
- package/dist/legacy/v1/duc/renderer-state.d.ts +17 -0
- package/dist/legacy/v1/duc/renderer-state.js +54 -0
- package/dist/legacy/v1/duc/segment-midpoint-state.d.ts +18 -0
- package/dist/legacy/v1/duc/segment-midpoint-state.js +57 -0
- package/dist/legacy/v1/duc/simple-point.d.ts +15 -0
- package/dist/legacy/v1/duc/simple-point.js +48 -0
- package/dist/legacy/v1/duc/stroke-sides.d.ts +23 -0
- package/dist/legacy/v1/duc/stroke-sides.js +66 -0
- package/dist/legacy/v1/duc/stroke-style.d.ts +31 -0
- package/dist/legacy/v1/duc/stroke-style.js +102 -0
- package/dist/legacy/v1/duc/tiling-properties.d.ts +21 -0
- package/dist/legacy/v1/duc/tiling-properties.js +75 -0
- package/dist/legacy/v1/duc.d.ts +35 -0
- package/dist/legacy/v1/duc.js +37 -0
- package/dist/legacy/v1/index.d.ts +1 -0
- package/dist/legacy/v1/index.js +1 -0
- package/dist/legacy/v1/parse/index.d.ts +67 -0
- package/dist/legacy/v1/parse/index.js +101 -0
- package/dist/legacy/v1/parse/parseAppStateFromBinary.d.ts +3 -0
- package/dist/legacy/v1/parse/parseAppStateFromBinary.js +139 -0
- package/dist/legacy/v1/parse/parseBinaryFilesFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseBinaryFilesFromBinary.js +32 -0
- package/dist/legacy/v1/parse/parseBlockFromBinary.d.ts +3 -0
- package/dist/legacy/v1/parse/parseBlockFromBinary.js +70 -0
- package/dist/legacy/v1/parse/parseElementFromBinary.d.ts +8 -0
- package/dist/legacy/v1/parse/parseElementFromBinary.js +387 -0
- package/dist/legacy/v1/parse/parseGroupFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseGroupFromBinary.js +36 -0
- package/dist/legacy/v1/parse/parseRendererStateFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseRendererStateFromBinary.js +15 -0
- package/dist/legacy/v1/serialize/index.d.ts +5 -0
- package/dist/legacy/v1/serialize/index.js +81 -0
- package/dist/legacy/v1/serialize/serializationUtils.d.ts +17 -0
- package/dist/legacy/v1/serialize/serializationUtils.js +27 -0
- package/dist/legacy/v1/serialize/serializeAppStateFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeAppStateFromDuc.js +145 -0
- package/dist/legacy/v1/serialize/serializeBinaryFilesFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeBinaryFilesFromDuc.js +46 -0
- package/dist/legacy/v1/serialize/serializeBlockFromDuc.d.ts +3 -0
- package/dist/legacy/v1/serialize/serializeBlockFromDuc.js +60 -0
- package/dist/legacy/v1/serialize/serializeElementFromDuc.d.ts +8 -0
- package/dist/legacy/v1/serialize/serializeElementFromDuc.js +435 -0
- package/dist/legacy/v1/serialize/serializeGroupFromDuc.d.ts +3 -0
- package/dist/legacy/v1/serialize/serializeGroupFromDuc.js +37 -0
- package/dist/legacy/v1/serialize/serializeRendererStateFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeRendererStateFromDuc.js +7 -0
- package/dist/legacy/v1/types/elements/index.d.ts +480 -0
- package/dist/legacy/v1/types/elements/index.js +1 -0
- package/dist/legacy/v1/types/elements/typeChecks.d.ts +40 -0
- package/dist/legacy/v1/types/elements/typeChecks.js +179 -0
- package/dist/legacy/v1/types/geometryTypes.d.ts +78 -0
- package/dist/legacy/v1/types/geometryTypes.js +1 -0
- package/dist/legacy/v1/types/index.d.ts +496 -0
- package/dist/legacy/v1/types/index.js +1 -0
- package/dist/legacy/v1/types/utility-types.d.ts +31 -0
- package/dist/legacy/v1/types/utility-types.js +1 -0
- package/dist/legacy/v1/utils/bounds.d.ts +76 -0
- package/dist/legacy/v1/utils/bounds.js +415 -0
- package/dist/legacy/v1/utils/constants.d.ts +370 -0
- package/dist/legacy/v1/utils/constants.js +571 -0
- package/dist/legacy/v1/utils/elements/index.d.ts +26 -0
- package/dist/legacy/v1/utils/elements/index.js +108 -0
- package/dist/legacy/v1/utils/elements/linearElement.d.ts +133 -0
- package/dist/legacy/v1/utils/elements/linearElement.js +544 -0
- package/dist/legacy/v1/utils/elements/textElement.d.ts +89 -0
- package/dist/legacy/v1/utils/elements/textElement.js +563 -0
- package/dist/legacy/v1/utils/index.d.ts +26 -0
- package/dist/legacy/v1/utils/index.js +40 -0
- package/dist/legacy/v1/utils/math/algebra/ga.d.ts +63 -0
- package/dist/legacy/v1/utils/math/algebra/ga.js +268 -0
- package/dist/legacy/v1/utils/math/algebra/gadirections.d.ts +9 -0
- package/dist/legacy/v1/utils/math/algebra/gadirections.js +18 -0
- package/dist/legacy/v1/utils/math/algebra/galines.d.ts +23 -0
- package/dist/legacy/v1/utils/math/algebra/galines.js +32 -0
- package/dist/legacy/v1/utils/math/algebra/gapoints.d.ts +8 -0
- package/dist/legacy/v1/utils/math/algebra/gapoints.js +30 -0
- package/dist/legacy/v1/utils/math/algebra/gatransforms.d.ts +10 -0
- package/dist/legacy/v1/utils/math/algebra/gatransforms.js +23 -0
- package/dist/legacy/v1/utils/math/bbox.d.ts +10 -0
- package/dist/legacy/v1/utils/math/bbox.js +42 -0
- package/dist/legacy/v1/utils/math/geometry.d.ts +102 -0
- package/dist/legacy/v1/utils/math/geometry.js +790 -0
- package/dist/legacy/v1/utils/math/index.d.ts +309 -0
- package/dist/legacy/v1/utils/math/index.js +1140 -0
- package/dist/legacy/v1/utils/math/random.d.ts +4 -0
- package/dist/legacy/v1/utils/math/random.js +25 -0
- package/dist/legacy/v1/utils/measurements.d.ts +33 -0
- package/dist/legacy/v1/utils/measurements.js +65 -0
- package/dist/legacy/v1/utils/normalize.d.ts +14 -0
- package/dist/legacy/v1/utils/normalize.js +49 -0
- package/dist/legacy/v1/utils/restore.d.ts +197 -0
- package/dist/legacy/v1/utils/restore.js +1255 -0
- package/dist/legacy/v1/utils/scopes.d.ts +260 -0
- package/dist/legacy/v1/utils/scopes.js +661 -0
- package/dist/legacy/v1/utils/standards.d.ts +12 -0
- package/dist/legacy/v1/utils/standards.js +10 -0
- package/dist/legacy/v1/utils/state/index.d.ts +2 -0
- package/dist/legacy/v1/utils/state/index.js +68 -0
- package/dist/legacy/v1/utils/url.d.ts +8 -0
- package/dist/legacy/v1/utils/url.js +33 -0
- package/dist/parse.d.ts +54 -0
- package/dist/parse.js +1318 -0
- package/dist/restore/index.d.ts +3 -0
- package/dist/restore/index.js +3 -0
- package/dist/restore/restoreDataState.d.ts +191 -0
- package/dist/restore/restoreDataState.js +716 -0
- package/dist/restore/restoreElements.d.ts +34 -0
- package/dist/restore/restoreElements.js +1281 -0
- package/dist/restore/restoreStandards.d.ts +8 -0
- package/dist/restore/restoreStandards.js +224 -0
- package/dist/serialize.d.ts +3 -0
- package/dist/serialize.js +2465 -0
- package/dist/technical/index.d.ts +3 -0
- package/dist/technical/index.js +3 -0
- package/dist/technical/measurements.d.ts +31 -0
- package/dist/technical/measurements.js +64 -0
- package/dist/technical/scopes.d.ts +261 -0
- package/dist/technical/scopes.js +661 -0
- package/dist/technical/standards.d.ts +124 -0
- package/dist/technical/standards.js +10 -0
- package/dist/types/elements/index.d.ts +1356 -0
- package/dist/types/elements/index.js +1 -0
- package/dist/types/elements/typeChecks.d.ts +40 -0
- package/dist/types/elements/typeChecks.js +188 -0
- package/dist/types/geometryTypes.d.ts +90 -0
- package/dist/types/geometryTypes.js +1 -0
- package/dist/types/index.d.ts +591 -0
- package/dist/types/index.js +3 -0
- package/dist/types/utility-types.d.ts +31 -0
- package/dist/types/utility-types.js +1 -0
- package/dist/utils/bounds.d.ts +75 -0
- package/dist/utils/bounds.js +414 -0
- package/dist/utils/constants.d.ts +288 -0
- package/dist/utils/constants.js +529 -0
- package/dist/utils/elements/frameElement.d.ts +4 -0
- package/dist/utils/elements/frameElement.js +16 -0
- package/dist/utils/elements/freedrawElement.d.ts +2 -0
- package/dist/utils/elements/freedrawElement.js +46 -0
- package/dist/utils/elements/index.d.ts +51 -0
- package/dist/utils/elements/index.js +215 -0
- package/dist/utils/elements/linearElement.d.ts +53 -0
- package/dist/utils/elements/linearElement.js +539 -0
- package/dist/utils/elements/newElement.d.ts +72 -0
- package/dist/utils/elements/newElement.js +268 -0
- package/dist/utils/elements/textElement.d.ts +89 -0
- package/dist/utils/elements/textElement.js +565 -0
- package/dist/utils/elements/viewportElement.d.ts +6 -0
- package/dist/utils/elements/viewportElement.js +9 -0
- package/dist/utils/filebyte.d.ts +39 -0
- package/dist/utils/filebyte.js +117 -0
- package/dist/utils/functionCodec.d.ts +5 -0
- package/dist/utils/functionCodec.js +86 -0
- package/dist/utils/index.d.ts +32 -0
- package/dist/utils/index.js +53 -0
- package/dist/utils/math/algebra/ga.d.ts +63 -0
- package/dist/utils/math/algebra/ga.js +268 -0
- package/dist/utils/math/algebra/gadirections.d.ts +9 -0
- package/dist/utils/math/algebra/gadirections.js +18 -0
- package/dist/utils/math/algebra/galines.d.ts +23 -0
- package/dist/utils/math/algebra/galines.js +32 -0
- package/dist/utils/math/algebra/gapoints.d.ts +8 -0
- package/dist/utils/math/algebra/gapoints.js +30 -0
- package/dist/utils/math/algebra/gatransforms.d.ts +10 -0
- package/dist/utils/math/algebra/gatransforms.js +23 -0
- package/dist/utils/math/algebra/index.d.ts +5 -0
- package/dist/utils/math/algebra/index.js +5 -0
- package/dist/utils/math/bbox.d.ts +10 -0
- package/dist/utils/math/bbox.js +42 -0
- package/dist/utils/math/geometry.d.ts +102 -0
- package/dist/utils/math/geometry.js +790 -0
- package/dist/utils/math/index.d.ts +323 -0
- package/dist/utils/math/index.js +1188 -0
- package/dist/utils/math/random.d.ts +4 -0
- package/dist/utils/math/random.js +25 -0
- package/dist/utils/normalize.d.ts +14 -0
- package/dist/utils/normalize.js +49 -0
- package/dist/utils/shape.d.ts +15 -0
- package/dist/utils/shape.js +254 -0
- package/dist/utils/state/grid.d.ts +7 -0
- package/dist/utils/state/grid.js +25 -0
- package/dist/utils/state/index.d.ts +9 -0
- package/dist/utils/state/index.js +131 -0
- package/dist/utils/url.d.ts +8 -0
- package/dist/utils/url.js +33 -0
- package/dist/utils/version.d.ts +1 -0
- package/dist/utils/version.js +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
// Constants
|
|
2
|
+
export const MIN_ZOOM = 1e-32;
|
|
3
|
+
export const MAX_ZOOM = 1e32;
|
|
4
|
+
export const NEUTRAL_SCOPE = "m";
|
|
5
|
+
// Define string-based measurement units
|
|
6
|
+
export const metricMeasures = [
|
|
7
|
+
'qm', // Quectometer
|
|
8
|
+
'rm', // Rontometer
|
|
9
|
+
'ym', // Yoctometer
|
|
10
|
+
'zm', // Zeptometer
|
|
11
|
+
'am', // Attometer
|
|
12
|
+
'fm', // Femtometer
|
|
13
|
+
'pm', // Picometer
|
|
14
|
+
'Å', // Angstrom
|
|
15
|
+
'nm', // Nanometer
|
|
16
|
+
'µm', // Micrometer
|
|
17
|
+
'mm', // Millimeter
|
|
18
|
+
'cm', // Centimeter
|
|
19
|
+
'dm', // Decimeter
|
|
20
|
+
'm', // Meter
|
|
21
|
+
'dam', // Decameter
|
|
22
|
+
'hm', // Hectometer
|
|
23
|
+
'km', // Kilometer
|
|
24
|
+
'Mm', // Megameter
|
|
25
|
+
'Gm', // Gigameter
|
|
26
|
+
'Tm', // Terameter
|
|
27
|
+
'Pm', // Petameter
|
|
28
|
+
'Em', // Exameter
|
|
29
|
+
'Zm', // Zettameter
|
|
30
|
+
'Ym', // Yottameter
|
|
31
|
+
'Rm', // Ronnameter
|
|
32
|
+
'Qm', // Quettameter
|
|
33
|
+
];
|
|
34
|
+
export const imperialMeasures = [
|
|
35
|
+
'th', // Thou/mil
|
|
36
|
+
'ln', // Line
|
|
37
|
+
'in', // Inches
|
|
38
|
+
'h', // Hand
|
|
39
|
+
'ft', // Feet
|
|
40
|
+
'yd', // Yards
|
|
41
|
+
'rd', // Rods
|
|
42
|
+
'ch', // Chains
|
|
43
|
+
'fur', // Furlongs
|
|
44
|
+
'mi', // Miles
|
|
45
|
+
'lea', // Leagues
|
|
46
|
+
];
|
|
47
|
+
// Define metric units - exponents represent powers of 10
|
|
48
|
+
export const metricUnits = [
|
|
49
|
+
{ prefix: 'qm', unit: 'quecto', full: 'quectometer', exponent: -30 },
|
|
50
|
+
{ prefix: 'rm', unit: 'ronto', full: 'rontometer', exponent: -27 },
|
|
51
|
+
{ prefix: 'ym', unit: 'yocto', full: 'yoctometer', exponent: -24 },
|
|
52
|
+
{ prefix: 'zm', unit: 'zepto', full: 'zeptometer', exponent: -21 },
|
|
53
|
+
{ prefix: 'am', unit: 'atto', full: 'attometer', exponent: -18 },
|
|
54
|
+
{ prefix: 'fm', unit: 'femto', full: 'femtometer', exponent: -15 },
|
|
55
|
+
{ prefix: 'pm', unit: 'pico', full: 'picometer', exponent: -12 },
|
|
56
|
+
{ prefix: 'Å', unit: 'angstrom', full: 'angstrom', exponent: -10 },
|
|
57
|
+
{ prefix: 'nm', unit: 'nano', full: 'nanometer', exponent: -9 },
|
|
58
|
+
{ prefix: 'µm', unit: 'micro', full: 'micrometer', exponent: -6 },
|
|
59
|
+
{ prefix: 'mm', unit: 'milli', full: 'millimeter', exponent: -3 },
|
|
60
|
+
{ prefix: 'cm', unit: 'centi', full: 'centimeter', exponent: -2 },
|
|
61
|
+
{ prefix: 'dm', unit: 'deci', full: 'decimeter', exponent: -1 },
|
|
62
|
+
{ prefix: 'm', unit: '', full: 'meter', exponent: 0 },
|
|
63
|
+
{ prefix: 'dam', unit: 'deca', full: 'decameter', exponent: 1 },
|
|
64
|
+
{ prefix: 'hm', unit: 'hecto', full: 'hectometer', exponent: 2 },
|
|
65
|
+
{ prefix: 'km', unit: 'kilo', full: 'kilometer', exponent: 3 },
|
|
66
|
+
{ prefix: 'Mm', unit: 'mega', full: 'megameter', exponent: 6 },
|
|
67
|
+
{ prefix: 'Gm', unit: 'giga', full: 'gigameter', exponent: 9 },
|
|
68
|
+
{ prefix: 'Tm', unit: 'tera', full: 'terameter', exponent: 12 },
|
|
69
|
+
{ prefix: 'Pm', unit: 'peta', full: 'petameter', exponent: 15 },
|
|
70
|
+
{ prefix: 'Em', unit: 'exa', full: 'exameter', exponent: 18 },
|
|
71
|
+
{ prefix: 'Zm', unit: 'zetta', full: 'zettameter', exponent: 21 },
|
|
72
|
+
{ prefix: 'Ym', unit: 'yotta', full: 'yottameter', exponent: 24 },
|
|
73
|
+
{ prefix: 'Rm', unit: 'ronna', full: 'ronnameter', exponent: 27 },
|
|
74
|
+
{ prefix: 'Qm', unit: 'quetta', full: 'quettameter', exponent: 30 }
|
|
75
|
+
];
|
|
76
|
+
// Define imperial units - exponents are now relative to meter as the base unit
|
|
77
|
+
// These values are log10 of their meter equivalents
|
|
78
|
+
export const imperialUnits = [
|
|
79
|
+
{ prefix: 'th', unit: 'thou', full: 'thou', exponent: -4.595 }, // log10(0.0000254) ≈ -4.595
|
|
80
|
+
{ prefix: 'ln', unit: 'line', full: 'line', exponent: -2.674 }, // log10(0.00211667) ≈ -2.674
|
|
81
|
+
{ prefix: 'in', unit: 'inch', full: 'inch', exponent: -1.595 }, // log10(0.0254) ≈ -1.595
|
|
82
|
+
{ prefix: 'h', unit: 'hand', full: 'hand', exponent: -0.993 }, // log10(0.1016) ≈ -0.993
|
|
83
|
+
{ prefix: 'ft', unit: 'foot', full: 'foot', exponent: -0.516 }, // log10(0.3048) ≈ -0.516
|
|
84
|
+
{ prefix: 'yd', unit: 'yard', full: 'yard', exponent: -0.039 }, // log10(0.9144) ≈ -0.039
|
|
85
|
+
{ prefix: 'rd', unit: 'rod', full: 'rod', exponent: 0.701 }, // log10(5.0292) ≈ 0.701
|
|
86
|
+
{ prefix: 'ch', unit: 'chain', full: 'chain', exponent: 1.304 }, // log10(20.1168) ≈ 1.304
|
|
87
|
+
{ prefix: 'fur', unit: 'furlong', full: 'furlong', exponent: 2.304 }, // log10(201.168) ≈ 2.304
|
|
88
|
+
{ prefix: 'mi', unit: 'mile', full: 'mile', exponent: 3.207 }, // log10(1609.344) ≈ 3.207
|
|
89
|
+
{ prefix: 'lea', unit: 'league', full: 'league', exponent: 3.684 } // log10(4828.032) ≈ 3.684
|
|
90
|
+
];
|
|
91
|
+
// Scale factors for unit conversions - using meter as the base unit
|
|
92
|
+
export const ScaleFactors = {
|
|
93
|
+
// Metric scales
|
|
94
|
+
qm: 1e-30,
|
|
95
|
+
rm: 1e-27,
|
|
96
|
+
ym: 1e-24,
|
|
97
|
+
zm: 1e-21,
|
|
98
|
+
am: 1e-18,
|
|
99
|
+
fm: 1e-15,
|
|
100
|
+
pm: 1e-12,
|
|
101
|
+
Å: 1e-10,
|
|
102
|
+
nm: 1e-9,
|
|
103
|
+
µm: 1e-6,
|
|
104
|
+
mm: 1e-3,
|
|
105
|
+
cm: 1e-2,
|
|
106
|
+
dm: 1e-1,
|
|
107
|
+
m: 1,
|
|
108
|
+
dam: 1e1,
|
|
109
|
+
hm: 1e2,
|
|
110
|
+
km: 1e3,
|
|
111
|
+
Mm: 1e6,
|
|
112
|
+
Gm: 1e9,
|
|
113
|
+
Tm: 1e12,
|
|
114
|
+
Pm: 1e15,
|
|
115
|
+
Em: 1e18,
|
|
116
|
+
Zm: 1e21,
|
|
117
|
+
Ym: 1e24,
|
|
118
|
+
Rm: 1e27,
|
|
119
|
+
Qm: 1e30,
|
|
120
|
+
// Imperial scales
|
|
121
|
+
th: 0.0000254, // 0.001 inch
|
|
122
|
+
ln: 0.00211667, // 1/12 inch
|
|
123
|
+
in: 0.0254,
|
|
124
|
+
h: 0.1016, // 4 inches
|
|
125
|
+
ft: 0.3048,
|
|
126
|
+
yd: 0.9144,
|
|
127
|
+
rd: 5.0292,
|
|
128
|
+
ch: 20.1168,
|
|
129
|
+
fur: 201.168,
|
|
130
|
+
mi: 1609.344,
|
|
131
|
+
lea: 4828.032, // 3 miles
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Determines if a measure belongs to the metric system.
|
|
135
|
+
* @param measure The measure to check.
|
|
136
|
+
* @returns `true` if the measure is metric, `false` otherwise.
|
|
137
|
+
*/
|
|
138
|
+
export function isMetricMeasure(measure) {
|
|
139
|
+
return metricMeasures.includes(measure);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Gets the unit system ('metric' or 'imperial') for a given measure.
|
|
143
|
+
* @param measure The measure to determine the system for.
|
|
144
|
+
* @returns The unit system the measure belongs to.
|
|
145
|
+
*/
|
|
146
|
+
export function getUnitSystemForMeasure(measure) {
|
|
147
|
+
return isMetricMeasure(measure) ? 'metric' : 'imperial';
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Clamps a zoom value between minimum and maximum allowed values
|
|
151
|
+
*/
|
|
152
|
+
export function clampZoom(zoom) {
|
|
153
|
+
return Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, zoom));
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Determines the zoom direction based on previous and current zoom values
|
|
157
|
+
*/
|
|
158
|
+
export function getZoomDirectionChange(prevZoom, currentZoom) {
|
|
159
|
+
if (currentZoom > prevZoom) {
|
|
160
|
+
return 'up';
|
|
161
|
+
}
|
|
162
|
+
else if (currentZoom < prevZoom) {
|
|
163
|
+
return 'down';
|
|
164
|
+
}
|
|
165
|
+
return 'neutral';
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Gets the unit definitions (prefix, name, exponent) for the specified unit system.
|
|
169
|
+
* @param unitSystem The unit system ('metric' or 'imperial') to get definitions for.
|
|
170
|
+
* @returns An array of unit definitions.
|
|
171
|
+
*/
|
|
172
|
+
export function getUnitDefinitions(unitSystem) {
|
|
173
|
+
return unitSystem === 'metric' ? metricUnits : imperialUnits;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Gets the standard exponents associated with the units in a specified system.
|
|
177
|
+
* These exponents represent the power of 10 (for metric) or log10 equivalent (for imperial) relative to the base unit (meter).
|
|
178
|
+
* @param unitSystem The unit system ('metric' or 'imperial').
|
|
179
|
+
* @returns An array of standard exponent numbers.
|
|
180
|
+
*/
|
|
181
|
+
export function getStandardExponents(unitSystem) {
|
|
182
|
+
const definitions = getUnitDefinitions(unitSystem);
|
|
183
|
+
return definitions.map(unit => unit.exponent);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Gets the exponent value for a given measure.
|
|
187
|
+
* @param measure The measure (e.g., 'mm', 'ft') to get the exponent for.
|
|
188
|
+
* @returns The exponent value, defaulting to 0 (base unit) if not found.
|
|
189
|
+
*/
|
|
190
|
+
export function getExponentForMeasure(measure) {
|
|
191
|
+
const unitSystem = getUnitSystemForMeasure(measure);
|
|
192
|
+
const definitions = getUnitDefinitions(unitSystem);
|
|
193
|
+
const unitDef = definitions.find(def => def.prefix === measure);
|
|
194
|
+
return unitDef ? unitDef.exponent : 0; // Default to base unit (m or in) if not found
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Gets the measure (unit prefix) that is closest to a given exponent value within a unit system.
|
|
198
|
+
* @param exponent The exponent value to find the closest measure for.
|
|
199
|
+
* @param unitSystem The unit system ('metric' or 'imperial') to search within.
|
|
200
|
+
* @returns The prefix of the closest measure.
|
|
201
|
+
*/
|
|
202
|
+
export function getMeasureForExponent(exponent, unitSystem) {
|
|
203
|
+
const definitions = getUnitDefinitions(unitSystem);
|
|
204
|
+
let closestDef = definitions[0];
|
|
205
|
+
let minDiff = Math.abs(definitions[0].exponent - exponent);
|
|
206
|
+
for (const def of definitions) {
|
|
207
|
+
const diff = Math.abs(def.exponent - exponent);
|
|
208
|
+
if (diff < minDiff) {
|
|
209
|
+
minDiff = diff;
|
|
210
|
+
closestDef = def;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return closestDef.prefix;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Calculates how much influence the main scope should have based on zoom level.
|
|
217
|
+
* This function now provides a simple normalized distance metric for UI animations.
|
|
218
|
+
*
|
|
219
|
+
* Returns a value from 0 to 1 where:
|
|
220
|
+
* - 1 means we're exactly at the main scope's exponent
|
|
221
|
+
* - 0 means we're at or beyond the threshold from the main scope's exponent
|
|
222
|
+
*/
|
|
223
|
+
export function getMainScopeInfluence(zoomExponent, mainScopeExponent, scopeExpThreshold) {
|
|
224
|
+
// The relationship between zoom exponent and unit exponent is inverse
|
|
225
|
+
const invertedZoomExponent = -zoomExponent;
|
|
226
|
+
const absDiff = Math.abs(invertedZoomExponent - mainScopeExponent);
|
|
227
|
+
// If we're outside the threshold, there's no influence
|
|
228
|
+
if (absDiff >= scopeExpThreshold) {
|
|
229
|
+
return 0;
|
|
230
|
+
}
|
|
231
|
+
// Within the threshold, calculate a linear falloff from 1 (at exact match) to 0 (at threshold)
|
|
232
|
+
return 1 - (absDiff / scopeExpThreshold);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Calculates the appropriate scope index based on zoom level with an improved gravity well effect
|
|
236
|
+
*/
|
|
237
|
+
export function calculateScopeIndex(zoom, unitSystem, scopeExpThreshold, mainScopeExponent) {
|
|
238
|
+
const zoomClamped = clampZoom(zoom);
|
|
239
|
+
// Handle edge case where zoom is non-positive before taking log
|
|
240
|
+
if (zoomClamped <= 0) {
|
|
241
|
+
// Return index for the largest unit (smallest zoom)
|
|
242
|
+
return getStandardExponents(unitSystem).length - 1;
|
|
243
|
+
}
|
|
244
|
+
// Calculate zoom exponent for the scope progression
|
|
245
|
+
const zoomExponent = Math.log10(zoomClamped);
|
|
246
|
+
// Calculate the inverted exponent (this determines the natural scope)
|
|
247
|
+
const invertedZoomExponent = -zoomExponent;
|
|
248
|
+
const standardExponents = getStandardExponents(unitSystem);
|
|
249
|
+
// Find main scope index
|
|
250
|
+
const mainScopeIndex = standardExponents.findIndex(exp => exp === mainScopeExponent);
|
|
251
|
+
// If main scope index not found, fall back to natural scope selection
|
|
252
|
+
if (mainScopeIndex === -1) {
|
|
253
|
+
return findNaturalScopeIndex(invertedZoomExponent, standardExponents);
|
|
254
|
+
}
|
|
255
|
+
// Calculate distance from main scope in exponent space
|
|
256
|
+
const distFromMainScope = Math.abs(invertedZoomExponent - mainScopeExponent);
|
|
257
|
+
const effectiveThreshold = scopeExpThreshold - 0.95; // e.g., an input of 1 becomes an effective 0.05
|
|
258
|
+
// CORE BEHAVIOR: If we're within the effective threshold, ALWAYS use the main scope
|
|
259
|
+
// This ensures stable behavior with small threshold values
|
|
260
|
+
if (distFromMainScope < effectiveThreshold) {
|
|
261
|
+
return mainScopeIndex;
|
|
262
|
+
}
|
|
263
|
+
// Beyond the threshold, use natural scope selection
|
|
264
|
+
return findNaturalScopeIndex(invertedZoomExponent, standardExponents);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Helper function to find the natural scope index based solely on zoom exponent
|
|
268
|
+
*/
|
|
269
|
+
function findNaturalScopeIndex(invertedZoomExponent, standardExponents) {
|
|
270
|
+
// Find natural scope index
|
|
271
|
+
let baseIndex = -1;
|
|
272
|
+
for (let i = 0; i < standardExponents.length - 1; i++) {
|
|
273
|
+
if (invertedZoomExponent >= standardExponents[i] && invertedZoomExponent < standardExponents[i + 1]) {
|
|
274
|
+
baseIndex = i;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
// Handle edge cases
|
|
279
|
+
if (baseIndex === -1) {
|
|
280
|
+
if (invertedZoomExponent < standardExponents[0]) {
|
|
281
|
+
baseIndex = 0;
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
baseIndex = standardExponents.length - 1;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return baseIndex;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Calculates the appropriate scope measure (unit prefix) based on the current zoom level,
|
|
291
|
+
* considering the main scope and threshold settings.
|
|
292
|
+
* @param zoom The current raw zoom level.
|
|
293
|
+
* @param scopeExpThreshold The exponent difference threshold for main scope influence.
|
|
294
|
+
* @param mainMeasure The designated main measure acting as a gravity well.
|
|
295
|
+
* @returns The calculated scope measure (unit prefix).
|
|
296
|
+
*/
|
|
297
|
+
export function calculateScope(zoom, scopeExpThreshold, mainMeasure) {
|
|
298
|
+
const unitSystem = getUnitSystemForMeasure(mainMeasure);
|
|
299
|
+
const mainScopeExponent = getExponentForMeasure(mainMeasure);
|
|
300
|
+
const scopeIndex = calculateScopeIndex(zoom, unitSystem, scopeExpThreshold, mainScopeExponent);
|
|
301
|
+
const unitDefinitions = getUnitDefinitions(unitSystem);
|
|
302
|
+
// Ensure we don't exceed array bounds
|
|
303
|
+
const safeIndex = Math.min(Math.max(0, scopeIndex), unitDefinitions.length - 1);
|
|
304
|
+
return unitDefinitions[safeIndex].prefix;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Gets the full unit definition object for the current scope based on zoom and main scope settings.
|
|
308
|
+
* @param zoom The current raw zoom level.
|
|
309
|
+
* @param scopeExpThreshold The exponent difference threshold for main scope influence.
|
|
310
|
+
* @param mainMeasure The designated main measure.
|
|
311
|
+
* @returns The full UnitDefinition object for the current scope.
|
|
312
|
+
*/
|
|
313
|
+
export function getCurrentUnitDefinition(zoom, scopeExpThreshold, mainMeasure) {
|
|
314
|
+
const unitSystem = getUnitSystemForMeasure(mainMeasure);
|
|
315
|
+
const mainScopeExponent = getExponentForMeasure(mainMeasure);
|
|
316
|
+
const scopeIndex = calculateScopeIndex(zoom, unitSystem, scopeExpThreshold, mainScopeExponent);
|
|
317
|
+
const unitDefinitions = getUnitDefinitions(unitSystem);
|
|
318
|
+
const safeIndex = Math.min(Math.max(0, scopeIndex), unitDefinitions.length - 1);
|
|
319
|
+
return unitDefinitions[safeIndex];
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Gets the lower bound of the current scope's *exponent* range.
|
|
323
|
+
* This represents the minimum exponent value covered by the current scope.
|
|
324
|
+
* @param zoom The current raw zoom level.
|
|
325
|
+
* @param scopeExpThreshold The exponent difference threshold for main scope influence.
|
|
326
|
+
* @param mainMeasure The designated main measure.
|
|
327
|
+
* @returns The lower exponent bound of the current scope.
|
|
328
|
+
*/
|
|
329
|
+
export function getCurrentScopeExponentLowerBound(zoom, scopeExpThreshold, mainMeasure) {
|
|
330
|
+
const unitSystem = getUnitSystemForMeasure(mainMeasure);
|
|
331
|
+
const mainScopeExponent = getExponentForMeasure(mainMeasure);
|
|
332
|
+
const scopeIndex = calculateScopeIndex(zoom, unitSystem, scopeExpThreshold, mainScopeExponent);
|
|
333
|
+
const standardExponents = getStandardExponents(unitSystem);
|
|
334
|
+
// Ensure index is valid before accessing
|
|
335
|
+
const safeIndex = Math.max(0, Math.min(scopeIndex, standardExponents.length - 1));
|
|
336
|
+
return standardExponents[safeIndex];
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Gets the upper bound of the current scope's *exponent* range.
|
|
340
|
+
* This represents the maximum exponent value covered by the current scope (exclusive).
|
|
341
|
+
* @param zoom The current raw zoom level.
|
|
342
|
+
* @param scopeExpThreshold The exponent difference threshold for main scope influence.
|
|
343
|
+
* @param mainMeasure The designated main measure.
|
|
344
|
+
* @returns The upper exponent bound of the current scope.
|
|
345
|
+
*/
|
|
346
|
+
export function getCurrentScopeExponentUpperBound(zoom, scopeExpThreshold, mainMeasure) {
|
|
347
|
+
const unitSystem = getUnitSystemForMeasure(mainMeasure);
|
|
348
|
+
const mainScopeExponent = getExponentForMeasure(mainMeasure);
|
|
349
|
+
const scopeIndex = calculateScopeIndex(zoom, unitSystem, scopeExpThreshold, mainScopeExponent);
|
|
350
|
+
const standardExponents = getStandardExponents(unitSystem);
|
|
351
|
+
const safeIndex = Math.max(0, Math.min(scopeIndex, standardExponents.length - 1));
|
|
352
|
+
const nextIndex = Math.min(safeIndex + 1, standardExponents.length - 1);
|
|
353
|
+
// If already at the last index, estimate the next exponent step
|
|
354
|
+
if (nextIndex === safeIndex && standardExponents.length > 1) {
|
|
355
|
+
return standardExponents[safeIndex] + (standardExponents[1] - standardExponents[0]);
|
|
356
|
+
}
|
|
357
|
+
else if (nextIndex === safeIndex) {
|
|
358
|
+
return standardExponents[safeIndex]; // Only one exponent defined
|
|
359
|
+
}
|
|
360
|
+
return standardExponents[nextIndex];
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Gets the lower bound of the *zoom* range for the current scope.
|
|
364
|
+
* Derived from the scope's upper exponent bound.
|
|
365
|
+
* @param zoom The current raw zoom level.
|
|
366
|
+
* @param scopeExpThreshold The exponent difference threshold for main scope influence.
|
|
367
|
+
* @param mainMeasure The designated main measure.
|
|
368
|
+
* @returns The minimum raw zoom value that falls within the current scope.
|
|
369
|
+
*/
|
|
370
|
+
export function getCurrentScopeLowerZoomBound(zoom, scopeExpThreshold, mainMeasure) {
|
|
371
|
+
// Use the exponent bounds to derive zoom bounds based on the new logic
|
|
372
|
+
const upperExp = getCurrentScopeExponentUpperBound(zoom, scopeExpThreshold, mainMeasure);
|
|
373
|
+
// Scope 'i' applies when lowerExp <= -log10(zoom) < upperExp
|
|
374
|
+
// Which means -upperExp < log10(zoom) <= -lowerExp
|
|
375
|
+
// Lower zoom bound is 10^(-upperExp)
|
|
376
|
+
return Math.pow(10, -upperExp);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Gets the upper bound of the *zoom* range for the current scope.
|
|
380
|
+
* Derived from the scope's lower exponent bound.
|
|
381
|
+
* @param zoom The current raw zoom level.
|
|
382
|
+
* @param scopeExpThreshold The exponent difference threshold for main scope influence.
|
|
383
|
+
* @param mainMeasure The designated main measure.
|
|
384
|
+
* @returns The maximum raw zoom value (exclusive) that falls within the current scope.
|
|
385
|
+
*/
|
|
386
|
+
export function getCurrentScopeUpperZoomBound(zoom, scopeExpThreshold, mainMeasure) {
|
|
387
|
+
// Use the exponent bounds to derive zoom bounds based on the new logic
|
|
388
|
+
const lowerExp = getCurrentScopeExponentLowerBound(zoom, scopeExpThreshold, mainMeasure);
|
|
389
|
+
// Scope 'i' applies when lowerExp <= -log10(zoom) < upperExp
|
|
390
|
+
// Which means -upperExp < log10(zoom) <= -lowerExp
|
|
391
|
+
// Upper zoom bound is 10^(-lowerExp)
|
|
392
|
+
return Math.pow(10, -lowerExp);
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Converts a numeric value from one scope (unit) to its equivalent in another scope,
|
|
396
|
+
* preserving the actual physical magnitude.
|
|
397
|
+
* This uses the underlying scale factors relative to the base unit (meter).
|
|
398
|
+
*
|
|
399
|
+
* @param providedValue - The numeric value to convert.
|
|
400
|
+
* @param providedScope - The scope (unit) of the provided value.
|
|
401
|
+
* @param targetScope - The target scope (unit) to convert the value to.
|
|
402
|
+
* @returns The equivalent value in the target scope.
|
|
403
|
+
*/
|
|
404
|
+
export function getPrecisionValueForScope(providedValue, providedScope, targetScope) {
|
|
405
|
+
// If scopes are the same, no conversion needed
|
|
406
|
+
if (providedScope === targetScope) {
|
|
407
|
+
return providedValue;
|
|
408
|
+
}
|
|
409
|
+
// Get the translation factor between the scopes
|
|
410
|
+
const translationFactor = getTranslationFactor(providedScope, targetScope);
|
|
411
|
+
// Convert the value using the translation factor
|
|
412
|
+
// This maintains the relative scale between the scopes
|
|
413
|
+
return (providedValue * translationFactor);
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Gets the percentage through the current scope's *exponent* range (0-100%)
|
|
417
|
+
* Percentage 0% means at the boundary with the next *larger* unit scope
|
|
418
|
+
* Percentage 100% means at the boundary with the next *smaller* unit scope
|
|
419
|
+
*/
|
|
420
|
+
export function getScopeThroughPercentage(zoom, scopeExpThreshold, mainMeasure) {
|
|
421
|
+
const zoomClamped = clampZoom(zoom);
|
|
422
|
+
const lowerZoom = getCurrentScopeLowerZoomBound(zoom, scopeExpThreshold, mainMeasure);
|
|
423
|
+
const upperZoom = getCurrentScopeUpperZoomBound(zoom, scopeExpThreshold, mainMeasure);
|
|
424
|
+
if (upperZoom <= lowerZoom) {
|
|
425
|
+
return 0;
|
|
426
|
+
}
|
|
427
|
+
const fraction = (zoomClamped - lowerZoom) / (upperZoom - lowerZoom);
|
|
428
|
+
return Math.min(100, Math.max(0, fraction * 100));
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Gets proximity to scope change (0-1, where 1 means about to change)
|
|
432
|
+
* This determines animation of measurement indicators
|
|
433
|
+
*/
|
|
434
|
+
export function getProximityToScopeChange(zoom, scopeExpThreshold, mainMeasure) {
|
|
435
|
+
const zoomClamped = clampZoom(zoom);
|
|
436
|
+
const zoomExp = Math.log10(zoomClamped);
|
|
437
|
+
// Get current scope's exponent bounds
|
|
438
|
+
const lowerExp = getCurrentScopeExponentLowerBound(zoom, scopeExpThreshold, mainMeasure);
|
|
439
|
+
const upperExp = getCurrentScopeExponentUpperBound(zoom, scopeExpThreshold, mainMeasure);
|
|
440
|
+
// Calculate where we are in the current scope's range
|
|
441
|
+
const scopeRange = upperExp - lowerExp;
|
|
442
|
+
if (scopeRange <= 0)
|
|
443
|
+
return 0;
|
|
444
|
+
// Calculate position within scope (-log10(zoom) should be between lowerExp and upperExp)
|
|
445
|
+
const position = -zoomExp;
|
|
446
|
+
// Calculate relative position in the scope range (0 to 1)
|
|
447
|
+
const relativePos = (position - lowerExp) / scopeRange;
|
|
448
|
+
// We want the proximity to increase smoothly as we move away from the center of the scope
|
|
449
|
+
// Center is at 0.5, edges are at 0 and 1
|
|
450
|
+
const distanceFromCenter = Math.abs(relativePos - 0.5) * 2; // Will be 0 at center, 1 at edges
|
|
451
|
+
// Apply a smooth easing function to make the transition more gradual
|
|
452
|
+
// This creates a more continuous movement from center to edges
|
|
453
|
+
return Math.pow(distanceFromCenter, 1.5); // The power of 1.5 makes it more gradual
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Determines direction of next scope change based on position within current scope
|
|
457
|
+
* 'up' -> higher index (larger units)
|
|
458
|
+
* 'down' -> lower index (smaller units)
|
|
459
|
+
*/
|
|
460
|
+
export function getNextScopeDirection(zoom, scopeExpThreshold, mainMeasure) {
|
|
461
|
+
const zoomClamped = clampZoom(zoom);
|
|
462
|
+
const zoomExp = Math.log10(zoomClamped);
|
|
463
|
+
// Get current scope's exponent bounds
|
|
464
|
+
const lowerExp = getCurrentScopeExponentLowerBound(zoom, scopeExpThreshold, mainMeasure);
|
|
465
|
+
const upperExp = getCurrentScopeExponentUpperBound(zoom, scopeExpThreshold, mainMeasure);
|
|
466
|
+
// If we're dealing with an almost zero range, use zoom direction instead
|
|
467
|
+
const scopeRange = upperExp - lowerExp;
|
|
468
|
+
if (scopeRange < 0.001) {
|
|
469
|
+
return zoomExp < 0 ? 'down' : 'up';
|
|
470
|
+
}
|
|
471
|
+
// Calculate position within scope (-log10(zoom) should be between lowerExp and upperExp)
|
|
472
|
+
const position = -zoomExp;
|
|
473
|
+
// Calculate relative position in the scope range (0 to 1)
|
|
474
|
+
const relativePos = (position - lowerExp) / scopeRange;
|
|
475
|
+
// Now use a stable approach - if in the lower 40% of the range, direction is up,
|
|
476
|
+
// if in the upper 40%, direction is down. This prevents rapid switching.
|
|
477
|
+
if (relativePos < 0.4)
|
|
478
|
+
return 'up';
|
|
479
|
+
if (relativePos > 0.6)
|
|
480
|
+
return 'down';
|
|
481
|
+
// In the middle zone (40-60%), maintain the previous direction to avoid oscillation
|
|
482
|
+
// Use the relative position compared to exact center to decide
|
|
483
|
+
return relativePos < 0.5 ? 'up' : 'down';
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Get translation factor between two measures (unit scopes).
|
|
487
|
+
* Calculates the multiplicative factor needed to convert a value from `fromMeasure` to `toMeasure`.
|
|
488
|
+
* @param fromMeasure The source measure unit.
|
|
489
|
+
* @param toMeasure The target measure unit.
|
|
490
|
+
* @returns The translation factor.
|
|
491
|
+
*/
|
|
492
|
+
export function getTranslationFactor(fromMeasure, toMeasure) {
|
|
493
|
+
const fromFactor = ScaleFactors[fromMeasure];
|
|
494
|
+
const toFactor = ScaleFactors[toMeasure];
|
|
495
|
+
// Handle potential division by zero if a factor is missing or zero
|
|
496
|
+
if (toFactor === 0) {
|
|
497
|
+
console.error(`Attempted to divide by zero scale factor for unit: ${toMeasure}`);
|
|
498
|
+
return 1; // Or throw an error, depending on desired behavior
|
|
499
|
+
}
|
|
500
|
+
return fromFactor / toFactor;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Adjusts the raw zoom level when the main scope is changed, aiming to maintain
|
|
504
|
+
* the same visual center point or numeric value representation on screen.
|
|
505
|
+
* @param currentZoom The current raw zoom level.
|
|
506
|
+
* @param oldMainMeasure The previous main measure.
|
|
507
|
+
* @param newMainMeasure The newly selected main measure.
|
|
508
|
+
* @returns The adjusted raw zoom level.
|
|
509
|
+
*/
|
|
510
|
+
export function getAdjustedZoomForMainScopeChange(currentZoom, oldMainMeasure, newMainMeasure) {
|
|
511
|
+
// Get the translation factor between the old and new units
|
|
512
|
+
// Note the order: new to old, because zoom is inversely proportional to unit size
|
|
513
|
+
const translationFactor = getTranslationFactor(newMainMeasure, oldMainMeasure);
|
|
514
|
+
// Adjust the zoom to maintain the same numeric center value
|
|
515
|
+
// Since zoom is inversely proportional to the unit size,
|
|
516
|
+
// we multiply by the translation factor (in the inverse direction)
|
|
517
|
+
return currentZoom * translationFactor;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Converts a raw value, assumed to be in NEUTRAL_SCOPE (meters), into its equivalent in the `currentScope`.
|
|
521
|
+
* This effectively gives the value as if it were measured in `currentScope` units while maintaining its physical magnitude relative to the neutral reference.
|
|
522
|
+
*
|
|
523
|
+
* @param value - The raw numeric value, assumed to be in NEUTRAL_SCOPE (e.g., meters).
|
|
524
|
+
* @param currentScope - The target scope (unit) to express the value in.
|
|
525
|
+
* @returns The value converted to `currentScope`, branded as `ScopedValue`.
|
|
526
|
+
*/
|
|
527
|
+
export const getNeutralScopedValue = (value, currentScope) => {
|
|
528
|
+
return getPrecisionValueForScope(value, NEUTRAL_SCOPE, currentScope);
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* Constructs a `PrecisionValue` object from a value that is already scoped.
|
|
532
|
+
* A scoped value is typically expressed in `currentScope` units but is relative to `NEUTRAL_SCOPE`.
|
|
533
|
+
* This function converts this `newScopedValue` back to its original `RawValue` in its `providedScope`.
|
|
534
|
+
*
|
|
535
|
+
* @param newScopedValue - The value already expressed in `currentScope` units, relative to `NEUTRAL_SCOPE`.
|
|
536
|
+
* @param providedScope - The original scope (unit) the raw value should be in.
|
|
537
|
+
* @param currentScope - The scope (unit) in which `newScopedValue` is currently expressed.
|
|
538
|
+
* @returns A `PrecisionValue` object containing both the `scoped` (input) and calculated `value` (in `providedScope`).
|
|
539
|
+
*/
|
|
540
|
+
export const getPrecisionValueFromScoped = (newScopedValue, providedScope, currentScope) => {
|
|
541
|
+
return {
|
|
542
|
+
scoped: newScopedValue,
|
|
543
|
+
value: getPrecisionValueForScope(newScopedValue, currentScope, providedScope)
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* Constructs a `PrecisionValue` object from a `RawValue`.
|
|
548
|
+
* It calculates the `scoped` representation of the `rawValue` (which is in `providedScope`)
|
|
549
|
+
* by converting it to the `currentScope`.
|
|
550
|
+
*
|
|
551
|
+
* @param rawValue - The raw numeric value in its original `providedScope`.
|
|
552
|
+
* @param providedScope - The original scope (unit) of the `rawValue`.
|
|
553
|
+
* @param currentScope - The target scope (unit) to express the `scoped` value in.
|
|
554
|
+
* @returns A `PrecisionValue` object containing the calculated `scoped` value and the original `value` (raw).
|
|
555
|
+
*/
|
|
556
|
+
export const getPrecisionValueFromRaw = (rawValue, providedScope, currentScope) => {
|
|
557
|
+
return {
|
|
558
|
+
scoped: getPrecisionValueForScope(rawValue, providedScope, currentScope),
|
|
559
|
+
value: rawValue
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
/**
|
|
563
|
+
* Converts a raw zoom value into a `ScopedZoomValue`.
|
|
564
|
+
* Due to the inverse perception of zoom (higher raw zoom means smaller represented units),
|
|
565
|
+
* this conversion is from `currentScope` to `NEUTRAL_SCOPE`.
|
|
566
|
+
* It essentially calculates how many `NEUTRAL_SCOPE` units are equivalent to one `currentScope` unit at the given raw zoom.
|
|
567
|
+
*
|
|
568
|
+
* @param rawZoomValue - The raw, dimensionless zoom factor.
|
|
569
|
+
* @param currentScope - The current active measurement scope.
|
|
570
|
+
* @returns The zoom value scoped relative to `NEUTRAL_SCOPE`, branded as `ScopedZoomValue`.
|
|
571
|
+
*/
|
|
572
|
+
export const getScopedZoomValue = (rawZoomValue, currentScope) => {
|
|
573
|
+
return getPrecisionValueForScope(rawZoomValue, currentScope, NEUTRAL_SCOPE);
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* Calculates the real-world length a scale bar represents on the screen.
|
|
577
|
+
* `scaledZoom` is the value representing how many units of the current drawing scope one physical pixel covers.
|
|
578
|
+
* Multiplying this by the pixel width of the scale bar gives its total real-world length.
|
|
579
|
+
*
|
|
580
|
+
* @param scaleBarPxWidth - The width of the scale bar in physical pixels on the screen.
|
|
581
|
+
* @param scaledZoom - The current scaled zoom value (units of current drawing scope per physical pixel).
|
|
582
|
+
* @returns The real-world length the scale bar represents, in the units of the `currentScope` implied by `scaledZoom`.
|
|
583
|
+
*/
|
|
584
|
+
export const getScaledBarZoomValue = (scaleBarPxWidth, scaledZoom) => {
|
|
585
|
+
// scaledZoom is (units of currentScope / 1 physical pixel)
|
|
586
|
+
// scaleBarPxWidth is (physical pixels)
|
|
587
|
+
// result is (units of currentScope)
|
|
588
|
+
return scaleBarPxWidth * scaledZoom;
|
|
589
|
+
};
|
|
590
|
+
/**
|
|
591
|
+
* Calculates the `ScaledZoom` value for a given `scopedZoom` in a `currentScope`.
|
|
592
|
+
* `scopedZoom` is the Z-axis zoom value in `currentScope` units, already relative to `NEUTRAL_SCOPE` (higher means more zoomed in).
|
|
593
|
+
* `ScaledZoom` (the return value) represents the distance in `currentScope` units
|
|
594
|
+
* that a single logical screen pixel covers on the X/Y drawing plane.
|
|
595
|
+
* This value is determined by the `scopedZoom` (which reflects the Z-axis viewing
|
|
596
|
+
* depth relative to `NEUTRAL_SCOPE`) and the `currentScope`.
|
|
597
|
+
*
|
|
598
|
+
* @param scopedZoom - The Z-axis zoom value, effectively `rawZoom` expressed in `NEUTRAL_SCOPE` units relative to `currentScope`.
|
|
599
|
+
* @param currentScope - The current active measurement scope.
|
|
600
|
+
* @returns The calculated `ScaledZoom` (units of `currentScope` per logical screen pixel).
|
|
601
|
+
*/
|
|
602
|
+
export const getScaledZoomValueForScope = (scopedZoom, currentScope) => {
|
|
603
|
+
// Step 1: Convert scopedZoom back to the equivalent rawZoom.
|
|
604
|
+
// scopedZoom = rawZoom * SF[currentScope] / SF[NEUTRAL_SCOPE]
|
|
605
|
+
// actualRawZoom = scopedZoom * SF[NEUTRAL_SCOPE] / SF[currentScope]
|
|
606
|
+
const actualRawZoom = getPrecisionValueForScope(scopedZoom, NEUTRAL_SCOPE, currentScope);
|
|
607
|
+
// Handle edge case: If actualRawZoom is 0 (or non-finite), it implies maximum zoom-out.
|
|
608
|
+
// In this scenario, 1 pixel covers a very large distance. We represent this large
|
|
609
|
+
// distance in NEUTRAL_SCOPE using MAX_ZOOM (since 1/MIN_ZOOM_raw = MAX_ZOOM_distance).
|
|
610
|
+
if (actualRawZoom === 0 || !isFinite(actualRawZoom)) {
|
|
611
|
+
return getPrecisionValueForScope(MAX_ZOOM, NEUTRAL_SCOPE, currentScope);
|
|
612
|
+
}
|
|
613
|
+
// Step 2: Calculate distance 1 logical pixel covers in NEUTRAL_SCOPE units.
|
|
614
|
+
// This is 1 / actualRawZoom.
|
|
615
|
+
const distanceInNeutralScope = 1 / actualRawZoom;
|
|
616
|
+
// Step 3: Convert this distance to currentScope units.
|
|
617
|
+
// Clamp the distanceInNeutralScope to ensure it's within valid MIN/MAX zoom bounds
|
|
618
|
+
// before converting, to prevent extreme values if actualRawZoom was very small/large.
|
|
619
|
+
return getPrecisionValueForScope(clampZoom(distanceInNeutralScope), NEUTRAL_SCOPE, currentScope);
|
|
620
|
+
};
|
|
621
|
+
/**
|
|
622
|
+
* Calculates the raw, dimensionless zoom factor from a `ScaledZoom` value.
|
|
623
|
+
* `ScaledZoom` represents the distance in `currentScope` units that a single
|
|
624
|
+
* logical screen pixel covers on the drawing plane.
|
|
625
|
+
* This function is the inverse of `getScaledZoomValueForScope`.
|
|
626
|
+
*
|
|
627
|
+
* @param scaledZoom - The scaled zoom value (units of `currentScope` per logical screen pixel on the drawing).
|
|
628
|
+
* @param currentScope - The scope (unit) in which `scaledZoom` is expressed.
|
|
629
|
+
* @returns The raw, dimensionless zoom factor, clamped within MIN_ZOOM and MAX_ZOOM.
|
|
630
|
+
*/
|
|
631
|
+
export const getRawZoomFromScaledZoom = (scaledZoom, currentScope) => {
|
|
632
|
+
// Handle edge case: If scaledZoom is 0, it means 1 pixel covers 0 distance.
|
|
633
|
+
// This implies infinite zoom-in.
|
|
634
|
+
if (scaledZoom === 0 || !isFinite(scaledZoom)) {
|
|
635
|
+
return MAX_ZOOM;
|
|
636
|
+
}
|
|
637
|
+
// Step 1: Convert scaledZoom (distance in currentScope) to its equivalent distance in NEUTRAL_SCOPE.
|
|
638
|
+
// distanceInNeutralScope = scaledZoom * SF[currentScope] / SF[NEUTRAL_SCOPE]
|
|
639
|
+
const distanceInNeutralScope = getPrecisionValueForScope(scaledZoom, currentScope, NEUTRAL_SCOPE);
|
|
640
|
+
// Handle edge case: If the converted distance in neutral scope is 0.
|
|
641
|
+
// This could happen if scaledZoom was extremely small and precision was lost,
|
|
642
|
+
// or if currentScope is vastly different from NEUTRAL_SCOPE.
|
|
643
|
+
// If 1 pixel covers 0 neutral distance, it implies infinite zoom-in.
|
|
644
|
+
if (distanceInNeutralScope === 0 || !isFinite(distanceInNeutralScope)) {
|
|
645
|
+
return MAX_ZOOM;
|
|
646
|
+
}
|
|
647
|
+
// Step 2: Calculate rawZoom.
|
|
648
|
+
// Since distanceInNeutralScope = 1 / rawZoom, then rawZoom = 1 / distanceInNeutralScope.
|
|
649
|
+
const rawZoom = 1 / distanceInNeutralScope;
|
|
650
|
+
// Step 3: Clamp the result to ensure it's a valid zoom value.
|
|
651
|
+
return clampZoom(rawZoom);
|
|
652
|
+
};
|
|
653
|
+
export const getScopedBezierPointFromDucPoint = (point) => {
|
|
654
|
+
return Object.assign(Object.assign({}, point), { x: point.x.scoped, y: point.y.scoped });
|
|
655
|
+
};
|
|
656
|
+
export const getPrecisionPointsFromScoped = (points, targetScope, currentScope) => {
|
|
657
|
+
return points.map(point => ({
|
|
658
|
+
x: getPrecisionValueFromScoped(point.x, targetScope, currentScope),
|
|
659
|
+
y: getPrecisionValueFromScoped(point.y, targetScope, currentScope),
|
|
660
|
+
}));
|
|
661
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ValueOf } from "ducjs/legacy/v1/types/utility-types";
|
|
2
|
+
export declare const DESIGN_STANDARD: {
|
|
3
|
+
readonly DUC: 10;
|
|
4
|
+
readonly ABNT: 11;
|
|
5
|
+
readonly ANSI: 12;
|
|
6
|
+
readonly ISO: 13;
|
|
7
|
+
readonly DIN: 14;
|
|
8
|
+
readonly JIS: 15;
|
|
9
|
+
readonly GB: 16;
|
|
10
|
+
readonly BSI: 17;
|
|
11
|
+
};
|
|
12
|
+
export type DesignStandard = ValueOf<typeof DESIGN_STANDARD>;
|