@devexperts/dxcharts-lite 1.0.1
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 +151 -0
- package/README.md +184 -0
- package/dist/chart/animation/canvas-animation.d.ts +96 -0
- package/dist/chart/animation/canvas-animation.js +6 -0
- package/dist/chart/animation/types/animation.d.ts +35 -0
- package/dist/chart/animation/types/animation.js +6 -0
- package/dist/chart/animation/types/color-alpha-animation.d.ts +43 -0
- package/dist/chart/animation/types/color-alpha-animation.js +6 -0
- package/dist/chart/animation/types/color-transition-animation.d.ts +59 -0
- package/dist/chart/animation/types/color-transition-animation.js +6 -0
- package/dist/chart/animation/types/viewport-movement-animation.d.ts +44 -0
- package/dist/chart/animation/types/viewport-movement-animation.js +6 -0
- package/dist/chart/animation/viewport-model-animation.d.ts +15 -0
- package/dist/chart/animation/viewport-model-animation.js +6 -0
- package/dist/chart/bootstrap.d.ts +266 -0
- package/dist/chart/bootstrap.js +6 -0
- package/dist/chart/canvas/canvas-bounds-container.d.ts +347 -0
- package/dist/chart/canvas/canvas-bounds-container.js +6 -0
- package/dist/chart/canvas/canvas-chart-html.d.ts +7 -0
- package/dist/chart/canvas/canvas-chart-html.js +23 -0
- package/dist/chart/canvas/chart-elements.d.ts +22 -0
- package/dist/chart/canvas/chart-elements.js +6 -0
- package/dist/chart/canvas/cursor.handler.d.ts +71 -0
- package/dist/chart/canvas/cursor.handler.js +6 -0
- package/dist/chart/canvas/layout-creator.d.ts +20 -0
- package/dist/chart/canvas/layout-creator.js +6 -0
- package/dist/chart/canvas/y-axis-bounds.container.d.ts +54 -0
- package/dist/chart/canvas/y-axis-bounds.container.js +6 -0
- package/dist/chart/chart-container.d.ts +18 -0
- package/dist/chart/chart-container.js +6 -0
- package/dist/chart/chart.config.d.ts +774 -0
- package/dist/chart/chart.config.js +6 -0
- package/dist/chart/components/chart/basic-scale.d.ts +22 -0
- package/dist/chart/components/chart/basic-scale.js +6 -0
- package/dist/chart/components/chart/candle-transformer.functions.d.ts +11 -0
- package/dist/chart/components/chart/candle-transformer.functions.js +6 -0
- package/dist/chart/components/chart/candle-width-calculator.functions.d.ts +7 -0
- package/dist/chart/components/chart/candle-width-calculator.functions.js +6 -0
- package/dist/chart/components/chart/candle.functions.d.ts +19 -0
- package/dist/chart/components/chart/candle.functions.js +6 -0
- package/dist/chart/components/chart/chart-area-pan.handler.d.ts +88 -0
- package/dist/chart/components/chart/chart-area-pan.handler.js +6 -0
- package/dist/chart/components/chart/chart-base.model.d.ts +55 -0
- package/dist/chart/components/chart/chart-base.model.js +6 -0
- package/dist/chart/components/chart/chart.component.d.ts +251 -0
- package/dist/chart/components/chart/chart.component.js +6 -0
- package/dist/chart/components/chart/chart.model.d.ts +448 -0
- package/dist/chart/components/chart/chart.model.js +6 -0
- package/dist/chart/components/chart/data-series.high-low-provider.d.ts +25 -0
- package/dist/chart/components/chart/data-series.high-low-provider.js +6 -0
- package/dist/chart/components/chart/fake-candles.d.ts +18 -0
- package/dist/chart/components/chart/fake-candles.js +6 -0
- package/dist/chart/components/chart/price.formatter.d.ts +12 -0
- package/dist/chart/components/chart/price.formatter.js +6 -0
- package/dist/chart/components/chart/secondary-chart-colors-pool.d.ts +43 -0
- package/dist/chart/components/chart/secondary-chart-colors-pool.js +6 -0
- package/dist/chart/components/cross_tool/cross-tool.component.d.ts +69 -0
- package/dist/chart/components/cross_tool/cross-tool.component.js +6 -0
- package/dist/chart/components/cross_tool/cross-tool.drawer.d.ts +32 -0
- package/dist/chart/components/cross_tool/cross-tool.drawer.js +6 -0
- package/dist/chart/components/cross_tool/cross-tool.model.d.ts +63 -0
- package/dist/chart/components/cross_tool/cross-tool.model.js +6 -0
- package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.d.ts +44 -0
- package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.js +6 -0
- package/dist/chart/components/cross_tool/types/none.drawer.d.ts +9 -0
- package/dist/chart/components/cross_tool/types/none.drawer.js +6 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.d.ts +27 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.js +6 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.d.ts +23 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.js +6 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.d.ts +46 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.js +6 -0
- package/dist/chart/components/events/events-hit-test.drawer.d.ts +34 -0
- package/dist/chart/components/events/events-hit-test.drawer.js +6 -0
- package/dist/chart/components/events/events.component.d.ts +45 -0
- package/dist/chart/components/events/events.component.js +6 -0
- package/dist/chart/components/events/events.drawer.d.ts +87 -0
- package/dist/chart/components/events/events.drawer.js +6 -0
- package/dist/chart/components/events/events.model.d.ts +64 -0
- package/dist/chart/components/events/events.model.js +6 -0
- package/dist/chart/components/grid/grid.component.d.ts +34 -0
- package/dist/chart/components/grid/grid.component.js +6 -0
- package/dist/chart/components/grid/grid.drawer.d.ts +55 -0
- package/dist/chart/components/grid/grid.drawer.js +6 -0
- package/dist/chart/components/high_low/high-low.component.d.ts +17 -0
- package/dist/chart/components/high_low/high-low.component.js +6 -0
- package/dist/chart/components/high_low/high-low.drawer.d.ts +69 -0
- package/dist/chart/components/high_low/high-low.drawer.js +6 -0
- package/dist/chart/components/highlights/highlights.component.d.ts +42 -0
- package/dist/chart/components/highlights/highlights.component.js +6 -0
- package/dist/chart/components/highlights/highlights.drawer.d.ts +56 -0
- package/dist/chart/components/highlights/highlights.drawer.js +6 -0
- package/dist/chart/components/highlights/highlights.model.d.ts +66 -0
- package/dist/chart/components/highlights/highlights.model.js +6 -0
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.d.ts +63 -0
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.js +6 -0
- package/dist/chart/components/navigation_map/navigation-map-move.handler.d.ts +36 -0
- package/dist/chart/components/navigation_map/navigation-map-move.handler.js +6 -0
- package/dist/chart/components/navigation_map/navigation-map.component.d.ts +52 -0
- package/dist/chart/components/navigation_map/navigation-map.component.js +6 -0
- package/dist/chart/components/navigation_map/navigation-map.drawer.d.ts +96 -0
- package/dist/chart/components/navigation_map/navigation-map.drawer.js +6 -0
- package/dist/chart/components/navigation_map/navigation-map.model.d.ts +25 -0
- package/dist/chart/components/navigation_map/navigation-map.model.js +7 -0
- package/dist/chart/components/pan/chart-pan.component.d.ts +52 -0
- package/dist/chart/components/pan/chart-pan.component.js +6 -0
- package/dist/chart/components/pane/extent/y-extent-component.d.ts +91 -0
- package/dist/chart/components/pane/extent/y-extent-component.js +6 -0
- package/dist/chart/components/pane/pane-hit-test.controller.d.ts +39 -0
- package/dist/chart/components/pane/pane-hit-test.controller.js +6 -0
- package/dist/chart/components/pane/pane-manager.component.d.ts +87 -0
- package/dist/chart/components/pane/pane-manager.component.js +6 -0
- package/dist/chart/components/pane/pane.component.d.ts +193 -0
- package/dist/chart/components/pane/pane.component.js +6 -0
- package/dist/chart/components/resizer/bar-resizer.component.d.ts +72 -0
- package/dist/chart/components/resizer/bar-resizer.component.js +6 -0
- package/dist/chart/components/resizer/bar-resizer.drawer.d.ts +34 -0
- package/dist/chart/components/resizer/bar-resizer.drawer.js +6 -0
- package/dist/chart/components/snapshot/snapshot.component.d.ts +31 -0
- package/dist/chart/components/snapshot/snapshot.component.js +6 -0
- package/dist/chart/components/volumes/separate-volumes.component.d.ts +45 -0
- package/dist/chart/components/volumes/separate-volumes.component.js +6 -0
- package/dist/chart/components/volumes/volume-color-resolvers.functions.d.ts +11 -0
- package/dist/chart/components/volumes/volume-color-resolvers.functions.js +6 -0
- package/dist/chart/components/volumes/volumes.component.d.ts +59 -0
- package/dist/chart/components/volumes/volumes.component.js +6 -0
- package/dist/chart/components/volumes/volumes.drawer.d.ts +71 -0
- package/dist/chart/components/volumes/volumes.drawer.js +6 -0
- package/dist/chart/components/volumes/volumes.formatter.d.ts +6 -0
- package/dist/chart/components/volumes/volumes.formatter.js +6 -0
- package/dist/chart/components/volumes/volumes.model.d.ts +32 -0
- package/dist/chart/components/volumes/volumes.model.js +6 -0
- package/dist/chart/components/watermark/water-mark.component.d.ts +75 -0
- package/dist/chart/components/watermark/water-mark.component.js +6 -0
- package/dist/chart/components/watermark/water-mark.drawer.d.ts +68 -0
- package/dist/chart/components/watermark/water-mark.drawer.js +6 -0
- package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.d.ts +25 -0
- package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.js +6 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.d.ts +55 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.js +6 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.d.ts +23 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.js +6 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.d.ts +28 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.js +6 -0
- package/dist/chart/components/x_axis/time/parser/time-formats.model.d.ts +33 -0
- package/dist/chart/components/x_axis/time/parser/time-formats.model.js +6 -0
- package/dist/chart/components/x_axis/time/x-axis-weights.functions.d.ts +62 -0
- package/dist/chart/components/x_axis/time/x-axis-weights.functions.js +6 -0
- package/dist/chart/components/x_axis/time/x-axis-weights.generator.d.ts +33 -0
- package/dist/chart/components/x_axis/time/x-axis-weights.generator.js +6 -0
- package/dist/chart/components/x_axis/x-axis-draw.functions.d.ts +17 -0
- package/dist/chart/components/x_axis/x-axis-draw.functions.js +6 -0
- package/dist/chart/components/x_axis/x-axis-labels.drawer.d.ts +42 -0
- package/dist/chart/components/x_axis/x-axis-labels.drawer.js +6 -0
- package/dist/chart/components/x_axis/x-axis-labels.generator.d.ts +141 -0
- package/dist/chart/components/x_axis/x-axis-labels.generator.js +6 -0
- package/dist/chart/components/x_axis/x-axis-labels.model.d.ts +39 -0
- package/dist/chart/components/x_axis/x-axis-labels.model.js +6 -0
- package/dist/chart/components/x_axis/x-axis-scale.handler.d.ts +38 -0
- package/dist/chart/components/x_axis/x-axis-scale.handler.js +6 -0
- package/dist/chart/components/x_axis/x-axis-time-labels.drawer.d.ts +54 -0
- package/dist/chart/components/x_axis/x-axis-time-labels.drawer.js +6 -0
- package/dist/chart/components/x_axis/x-axis.component.d.ts +73 -0
- package/dist/chart/components/x_axis/x-axis.component.js +6 -0
- package/dist/chart/components/y_axis/label-color.functions.d.ts +18 -0
- package/dist/chart/components/y_axis/label-color.functions.js +6 -0
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.d.ts +22 -0
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.js +6 -0
- package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.d.ts +33 -0
- package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.js +6 -0
- package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.d.ts +27 -0
- package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.js +6 -0
- package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.d.ts +35 -0
- package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.js +6 -0
- package/dist/chart/components/y_axis/price_labels/price-label.drawer.d.ts +23 -0
- package/dist/chart/components/y_axis/price_labels/price-label.drawer.js +6 -0
- package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.d.ts +159 -0
- package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.js +6 -0
- package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.d.ts +23 -0
- package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.js +6 -0
- package/dist/chart/components/y_axis/y-axis-base-labels.model.d.ts +31 -0
- package/dist/chart/components/y_axis/y-axis-base-labels.model.js +6 -0
- package/dist/chart/components/y_axis/y-axis-labels.drawer.d.ts +70 -0
- package/dist/chart/components/y_axis/y-axis-labels.drawer.js +6 -0
- package/dist/chart/components/y_axis/y-axis-scale.handler.d.ts +32 -0
- package/dist/chart/components/y_axis/y-axis-scale.handler.js +6 -0
- package/dist/chart/components/y_axis/y-axis.component.d.ts +158 -0
- package/dist/chart/components/y_axis/y-axis.component.js +6 -0
- package/dist/chart/components/y_axis/y-axis.drawer.d.ts +72 -0
- package/dist/chart/components/y_axis/y-axis.drawer.js +6 -0
- package/dist/chart/components/y_axis/y-axis.model.d.ts +33 -0
- package/dist/chart/components/y_axis/y-axis.model.js +6 -0
- package/dist/chart/drawers/chart-background.drawer.d.ts +19 -0
- package/dist/chart/drawers/chart-background.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/area.drawer.d.ts +13 -0
- package/dist/chart/drawers/chart-type-drawers/area.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/bar.drawer.d.ts +14 -0
- package/dist/chart/drawers/chart-type-drawers/bar.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/baseline.drawer.d.ts +15 -0
- package/dist/chart/drawers/chart-type-drawers/baseline.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/candle.drawer.d.ts +25 -0
- package/dist/chart/drawers/chart-type-drawers/candle.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/histogram.drawer.d.ts +13 -0
- package/dist/chart/drawers/chart-type-drawers/histogram.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/line.drawer.d.ts +13 -0
- package/dist/chart/drawers/chart-type-drawers/line.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.d.ts +13 -0
- package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.js +6 -0
- package/dist/chart/drawers/clear-canvas.drawer.d.ts +16 -0
- package/dist/chart/drawers/clear-canvas.drawer.js +6 -0
- package/dist/chart/drawers/composite.drawer.d.ts +25 -0
- package/dist/chart/drawers/composite.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.d.ts +23 -0
- package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.js +6 -0
- package/dist/chart/drawers/data-series-drawers/color-candle.drawer.d.ts +17 -0
- package/dist/chart/drawers/data-series-drawers/color-candle.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.d.ts +8 -0
- package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.js +6 -0
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.d.ts +21 -0
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/histogram.drawer.d.ts +11 -0
- package/dist/chart/drawers/data-series-drawers/histogram.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/linear.drawer.d.ts +12 -0
- package/dist/chart/drawers/data-series-drawers/linear.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/points.drawer.d.ts +11 -0
- package/dist/chart/drawers/data-series-drawers/points.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.d.ts +9 -0
- package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/text.drawer.d.ts +13 -0
- package/dist/chart/drawers/data-series-drawers/text.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.d.ts +12 -0
- package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/triangle.drawer.d.ts +12 -0
- package/dist/chart/drawers/data-series-drawers/triangle.drawer.js +6 -0
- package/dist/chart/drawers/data-series.drawer.d.ts +39 -0
- package/dist/chart/drawers/data-series.drawer.js +6 -0
- package/dist/chart/drawers/drawing-manager.d.ts +61 -0
- package/dist/chart/drawers/drawing-manager.js +6 -0
- package/dist/chart/drawers/ht-data-series.drawer.d.ts +22 -0
- package/dist/chart/drawers/ht-data-series.drawer.js +6 -0
- package/dist/chart/events/event-bus.d.ts +48 -0
- package/dist/chart/events/event-bus.js +6 -0
- package/dist/chart/events/events.d.ts +8 -0
- package/dist/chart/events/events.js +6 -0
- package/dist/chart/inputhandlers/candle-tap.handler.d.ts +27 -0
- package/dist/chart/inputhandlers/candle-tap.handler.js +6 -0
- package/dist/chart/inputhandlers/chart-resize.handler.d.ts +67 -0
- package/dist/chart/inputhandlers/chart-resize.handler.js +6 -0
- package/dist/chart/inputhandlers/cross-event-producer.component.d.ts +44 -0
- package/dist/chart/inputhandlers/cross-event-producer.component.js +6 -0
- package/dist/chart/inputhandlers/hover-producer.component.d.ts +140 -0
- package/dist/chart/inputhandlers/hover-producer.component.js +6 -0
- package/dist/chart/inputhandlers/main-canvas-touch.handler.d.ts +54 -0
- package/dist/chart/inputhandlers/main-canvas-touch.handler.js +6 -0
- package/dist/chart/inputlisteners/canvas-input-listener.component.d.ts +311 -0
- package/dist/chart/inputlisteners/canvas-input-listener.component.js +6 -0
- package/dist/chart/model/baseline.model.d.ts +54 -0
- package/dist/chart/model/baseline.model.js +6 -0
- package/dist/chart/model/bounds.model.d.ts +16 -0
- package/dist/chart/model/bounds.model.js +6 -0
- package/dist/chart/model/candle-hover.d.ts +35 -0
- package/dist/chart/model/candle-hover.js +6 -0
- package/dist/chart/model/candle-series-high-low.provider.d.ts +20 -0
- package/dist/chart/model/candle-series-high-low.provider.js +6 -0
- package/dist/chart/model/candle-series.model.d.ts +150 -0
- package/dist/chart/model/candle-series.model.js +6 -0
- package/dist/chart/model/candle.model.d.ts +46 -0
- package/dist/chart/model/candle.model.js +6 -0
- package/dist/chart/model/canvas.model.d.ts +131 -0
- package/dist/chart/model/canvas.model.js +6 -0
- package/dist/chart/model/chart-base-element.d.ts +103 -0
- package/dist/chart/model/chart-base-element.js +6 -0
- package/dist/chart/model/compare-series-hover.d.ts +22 -0
- package/dist/chart/model/compare-series-hover.js +6 -0
- package/dist/chart/model/data-series-view.d.ts +58 -0
- package/dist/chart/model/data-series-view.js +6 -0
- package/dist/chart/model/data-series.config.d.ts +31 -0
- package/dist/chart/model/data-series.config.js +6 -0
- package/dist/chart/model/data-series.model.d.ts +172 -0
- package/dist/chart/model/data-series.model.js +6 -0
- package/dist/chart/model/date-time.formatter.d.ts +23 -0
- package/dist/chart/model/date-time.formatter.js +6 -0
- package/dist/chart/model/hit-test-canvas.model.d.ts +128 -0
- package/dist/chart/model/hit-test-canvas.model.js +6 -0
- package/dist/chart/model/main-candle-series.model.d.ts +27 -0
- package/dist/chart/model/main-candle-series.model.js +6 -0
- package/dist/chart/model/scale.model.d.ts +180 -0
- package/dist/chart/model/scale.model.js +6 -0
- package/dist/chart/model/scaling/auto-scale.model.d.ts +79 -0
- package/dist/chart/model/scaling/auto-scale.model.js +6 -0
- package/dist/chart/model/scaling/constrait.functions.d.ts +43 -0
- package/dist/chart/model/scaling/constrait.functions.js +6 -0
- package/dist/chart/model/scaling/lock-ratio.model.d.ts +16 -0
- package/dist/chart/model/scaling/lock-ratio.model.js +6 -0
- package/dist/chart/model/scaling/move-chart.functions.d.ts +20 -0
- package/dist/chart/model/scaling/move-chart.functions.js +6 -0
- package/dist/chart/model/scaling/viewport.model.d.ts +223 -0
- package/dist/chart/model/scaling/viewport.model.js +6 -0
- package/dist/chart/model/scaling/x-zooming.functions.d.ts +26 -0
- package/dist/chart/model/scaling/x-zooming.functions.js +6 -0
- package/dist/chart/model/time-zone.model.d.ts +65 -0
- package/dist/chart/model/time-zone.model.js +6 -0
- package/dist/chart/model/visual-candle.d.ts +106 -0
- package/dist/chart/model/visual-candle.js +6 -0
- package/dist/chart/utils/__tests__/array.utils.test.d.ts +6 -0
- package/dist/chart/utils/__tests__/array.utils.test.js +6 -0
- package/dist/chart/utils/__tests__/object.utils.test.d.ts +6 -0
- package/dist/chart/utils/__tests__/object.utils.test.js +6 -0
- package/dist/chart/utils/__tests__/priceIncrementsUtils.test.d.ts +6 -0
- package/dist/chart/utils/__tests__/priceIncrementsUtils.test.js +6 -0
- package/dist/chart/utils/array.utils.d.ts +101 -0
- package/dist/chart/utils/array.utils.js +6 -0
- package/dist/chart/utils/auto-period-detector.utils.d.ts +16 -0
- package/dist/chart/utils/auto-period-detector.utils.js +6 -0
- package/dist/chart/utils/candles-generator-ts.utils.d.ts +41 -0
- package/dist/chart/utils/candles-generator-ts.utils.js +6 -0
- package/dist/chart/utils/candles-generator.utils.d.ts +13 -0
- package/dist/chart/utils/candles-generator.utils.js +6 -0
- package/dist/chart/utils/candles.utils.d.ts +8 -0
- package/dist/chart/utils/candles.utils.js +6 -0
- package/dist/chart/utils/canvas/canvas-drawing-functions.utils.d.ts +68 -0
- package/dist/chart/utils/canvas/canvas-drawing-functions.utils.js +6 -0
- package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.d.ts +20 -0
- package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.js +6 -0
- package/dist/chart/utils/canvas/canvas-text-functions.utils.d.ts +76 -0
- package/dist/chart/utils/canvas/canvas-text-functions.utils.js +6 -0
- package/dist/chart/utils/color.utils.d.ts +6 -0
- package/dist/chart/utils/color.utils.js +6 -0
- package/dist/chart/utils/device/browser.utils.d.ts +9 -0
- package/dist/chart/utils/device/browser.utils.js +6 -0
- package/dist/chart/utils/device/device-detector.utils.d.ts +12 -0
- package/dist/chart/utils/device/device-detector.utils.js +6 -0
- package/dist/chart/utils/device/device-pixel-ratio.utils.d.ts +16 -0
- package/dist/chart/utils/device/device-pixel-ratio.utils.js +6 -0
- package/dist/chart/utils/device/touchpad.utils.d.ts +30 -0
- package/dist/chart/utils/device/touchpad.utils.js +6 -0
- package/dist/chart/utils/dom.utils.d.ts +13 -0
- package/dist/chart/utils/dom.utils.js +6 -0
- package/dist/chart/utils/function.utils.d.ts +13 -0
- package/dist/chart/utils/function.utils.js +6 -0
- package/dist/chart/utils/math.utils.d.ts +40 -0
- package/dist/chart/utils/math.utils.js +6 -0
- package/dist/chart/utils/merge.utils.d.ts +27 -0
- package/dist/chart/utils/merge.utils.js +6 -0
- package/dist/chart/utils/object.utils.d.ts +46 -0
- package/dist/chart/utils/object.utils.js +6 -0
- package/dist/chart/utils/perfomance/animation-frame-cache.utils.d.ts +53 -0
- package/dist/chart/utils/perfomance/animation-frame-cache.utils.js +6 -0
- package/dist/chart/utils/perfomance/debounce.utils.d.ts +6 -0
- package/dist/chart/utils/perfomance/debounce.utils.js +6 -0
- package/dist/chart/utils/perfomance/memoize.utils.d.ts +21 -0
- package/dist/chart/utils/perfomance/memoize.utils.js +6 -0
- package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.d.ts +15 -0
- package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.js +6 -0
- package/dist/chart/utils/perfomance/throttle.utils.d.ts +15 -0
- package/dist/chart/utils/perfomance/throttle.utils.js +6 -0
- package/dist/chart/utils/price-increments.utils.d.ts +44 -0
- package/dist/chart/utils/price-increments.utils.js +6 -0
- package/dist/chart/utils/uuid.utils.d.ts +6 -0
- package/dist/chart/utils/uuid.utils.js +6 -0
- package/dist/dxchart.min.js +26 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +6 -0
- package/package.json +103 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export function subscribeListener(n,r,i,t){return n.addEventListener(i,r,t),function(){n.removeEventListener(i,r,t)}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export interface Unsubscriber {
|
|
7
|
+
(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function clearerSafe(arr: Array<Unsubscriber>): Unsubscriber;
|
|
10
|
+
export declare function identity<T>(x: T): T;
|
|
11
|
+
export declare function notEmpty<T>(value: T | null | undefined): value is T;
|
|
12
|
+
export declare const constVoid: () => undefined;
|
|
13
|
+
export declare function nonNullableTypeGuard<T>(x: T | undefined | null): x is T;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export function clearerSafe(n){return function(){n.forEach(t=>typeof t=="function"&&t()),n.length=0}}export function identity(n){return n}export function notEmpty(n){return n!=null}export const constVoid=()=>{};export function nonNullableTypeGuard(n){return n!=null}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MAX_DECIMAL_DIGITS = 14;
|
|
7
|
+
export type NumberFormatLabels = 'K' | 'M' | 'B';
|
|
8
|
+
export declare class MathUtils {
|
|
9
|
+
static roundToNearest(value: number, precision: number): number;
|
|
10
|
+
static roundUpToNearest(value: number, precision: number): number;
|
|
11
|
+
static roundDecimal(x: number): number;
|
|
12
|
+
static makeDecimal(value: number, precision: number, decimal?: string): string;
|
|
13
|
+
static compare(a: number, b: number, eps: number): number;
|
|
14
|
+
static isZero(a: number): boolean;
|
|
15
|
+
static cutNumber(value: number, amountToCut: NumberFormatLabels, zeros?: number): string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Checks if first and second number are differs by specified times
|
|
19
|
+
* @param first {number}
|
|
20
|
+
* @param second {number}
|
|
21
|
+
* @param times {number}
|
|
22
|
+
* @doc-tags utility,math
|
|
23
|
+
*/
|
|
24
|
+
export declare function isDiffersBy(first: number, second: number, times: number): boolean;
|
|
25
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
26
|
+
export declare function easeExpOut(value: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the first finite number in a list of numbers. If no finite number is found,
|
|
29
|
+
* returns NaN.
|
|
30
|
+
* @param {...number} args - A list of numbers to search for a finite value.
|
|
31
|
+
* @returns {number} The first finite number in the list, or NaN if no finite number is found.
|
|
32
|
+
*/
|
|
33
|
+
export declare function finite(...args: (number | undefined)[]): number;
|
|
34
|
+
/**
|
|
35
|
+
* These functions can be used only for chart coordinates because they all are working in positive coordinates!!!
|
|
36
|
+
*/
|
|
37
|
+
export declare const floor: (value: number) => number;
|
|
38
|
+
export declare const ceil: (value: number) => number;
|
|
39
|
+
export declare const round: (value: number) => number;
|
|
40
|
+
export declare const shiftRight: (value: number, shift: number) => number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export const MAX_DECIMAL_DIGITS=14;const s=[];for(let n=0;n<14+1;n++)s.push(Math.pow(10,n));const c=5e-13;export class MathUtils{static roundToNearest(t,r){return isFinite(t)?MathUtils.isZero(t)?0:(t>0?t+=c:t<0&&(t-=c),MathUtils.roundDecimal(Math.round(MathUtils.roundDecimal(t/r))*r)):t}static roundUpToNearest(t,r){return MathUtils.roundDecimal(Math.ceil(t/r))*r}static roundDecimal(t){if(isNaN(t)||t===Math.floor(t))return t;const r=Math.sign(t),e=Math.abs(t),i=Math.min(14,14-1-Math.floor(Math.log10(e)));for(let o=i;o>=0;o--){const a=Math.floor(s[o]*e+.5);if(a<s[14])return r*a/s[o]}return Math.round(t)}static makeDecimal(t,r,e){if(isFinite(t)){const i=t.toFixed(r);return e?i.replace(".",e):i}else return""}static compare(t,r,e){return t>r+e?1:t<r-e?-1:(isNaN(t)?1:0)-(isNaN(r)?1:0)}static isZero(t){return MathUtils.compare(t,0,c)===0}static cutNumber(t,r,e=0){return{K:o=>o/1e3,M:o=>o/1e6}[r](t).toFixed(e)+r}}export function isDiffersBy(n,t,r){const e=n/t;return e>=r||e<=1/r}export function clamp(n,t,r){return Math.max(t,Math.min(n,r))}export function easeExpOut(n){return 1-(Math.pow(2,-10*n)-.0009765625)*1.0009775171065494}export function finite(...n){for(const t of n)if(t!==void 0&&isFinite(t))return t;return NaN}export const floor=n=>~~n,ceil=n=>~~(n+1),round=n=>~~(n+.5),shiftRight=(n,t)=>n>>t;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Merges 2 js objects recursively with all properties.
|
|
8
|
+
* - does not modify base object
|
|
9
|
+
* - can override or only add missing ones
|
|
10
|
+
*
|
|
11
|
+
* @param base - base object to merge data into
|
|
12
|
+
* @param override - object with new data which should be merged
|
|
13
|
+
* @param options - merge options
|
|
14
|
+
* @doc-tags tricky,utility
|
|
15
|
+
*/
|
|
16
|
+
export declare function merge(base: Record<string, any>, override: Record<string, any>, options?: MergeOptions): any;
|
|
17
|
+
export declare function mergeArray<A extends Record<string, any>>(base: Array<A>, override: Array<A>, hashFn: (a: A) => string, mergeObjects?: boolean): void;
|
|
18
|
+
export declare const DEFAULT_MERGE_OPTIONS: {
|
|
19
|
+
overrideExisting: boolean;
|
|
20
|
+
addIfMissing: boolean;
|
|
21
|
+
};
|
|
22
|
+
export interface MergeOptions {
|
|
23
|
+
/** whether we need to override value if it's already presented in config. Note for arrays: if this flag is true, arrays replaced entirely */
|
|
24
|
+
overrideExisting: boolean;
|
|
25
|
+
/** whether we need to add a property to config, if this property was absent */
|
|
26
|
+
addIfMissing: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export function merge(r,e,f=DEFAULT_MERGE_OPTIONS){function l(n,t){for(const i in t)i in n?typeof n[i]=="object"&&n[i]!==null&&!Array.isArray(n[i])?l(n[i],t[i]):f!=null&&f.overrideExisting&&(n[i]=t[i]):f!=null&&f.addIfMissing&&(n[i]=t[i]);return n}return l(r,e)}export function mergeArray(r,e,f,l=!1){!r||!e||e.length===0||e.forEach(n=>{const t=f(n),i=r.findIndex(u=>f(u)===t);i===-1?r.push(n):l?merge(r[i],n,{overrideExisting:!0,addIfMissing:!0}):r.splice(i,1,n)})}export const DEFAULT_MERGE_OPTIONS={overrideExisting:!1,addIfMissing:!0};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @description
|
|
8
|
+
* Helps with the partial objects functions arguments, but errors the empty object case, which is allowed by simple Partial<T>
|
|
9
|
+
* @example
|
|
10
|
+
* function badUpdateSomeEntity(updates: Partial<Entity>): Entity
|
|
11
|
+
* badUpdateSomeEntity({ property: 123 }) // ok
|
|
12
|
+
* badUpdateSomeEntity() // error - expected
|
|
13
|
+
* badUpdateSomeEntity({}) // ok - not expected, should not be allowed to do such operation
|
|
14
|
+
*
|
|
15
|
+
* function goodUpdateSomeEntity(object: AtLeastOne<Entity>): Entity
|
|
16
|
+
* goodUpdateSomeEntity({ property: 123 }) // ok
|
|
17
|
+
* goodUpdateSomeEntity() // error - expected
|
|
18
|
+
* goodUpdateSomeEntity({}) // error - nice!
|
|
19
|
+
*/
|
|
20
|
+
export type AtLeastOne<T, Keys extends keyof T = keyof T> = Partial<T> & {
|
|
21
|
+
[K in Keys]: Required<Pick<T, K>>;
|
|
22
|
+
}[Keys];
|
|
23
|
+
export interface StringTMap<T> {
|
|
24
|
+
[key: string]: T;
|
|
25
|
+
}
|
|
26
|
+
export type DeepPartial<T> = T extends (...args: unknown[]) => unknown ? T : T extends Record<string, any> ? T extends unknown[] ? DeepPartial<T[number]>[] : {
|
|
27
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
28
|
+
} : T;
|
|
29
|
+
export type DeepRequired<T> = T extends (...args: unknown[]) => unknown ? T : T extends Record<string, any> ? T extends unknown[] ? DeepRequired<T[number]>[] : {
|
|
30
|
+
[P in keyof T]-?: DeepRequired<T[P]>;
|
|
31
|
+
} : T;
|
|
32
|
+
export declare const cloneUnsafe: <T>(value: T) => T;
|
|
33
|
+
type Entries<T extends object> = {
|
|
34
|
+
[K in keyof T]: [K, T[K]];
|
|
35
|
+
}[keyof T][];
|
|
36
|
+
export declare function typedEntries_UNSAFE<T extends object>(obj: T): Entries<T>;
|
|
37
|
+
export declare const findKeyFromValue: <K, V>(map: Map<K, V>, mapValue: V) => K | undefined;
|
|
38
|
+
export declare function keys<K extends string>(r: Partial<Record<K, unknown>>): Array<K>;
|
|
39
|
+
/**
|
|
40
|
+
* Deeply compares two objects
|
|
41
|
+
* @param {*} objA
|
|
42
|
+
* @param {*} objB
|
|
43
|
+
* @returns {Boolean}
|
|
44
|
+
*/
|
|
45
|
+
export declare function deepEqual(objA: object, objB: object): boolean;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export const cloneUnsafe=e=>JSON.parse(JSON.stringify(e));export function typedEntries_UNSAFE(e){return Object.entries(e)}export const findKeyFromValue=(e,t)=>{for(const[r,s]of Array.from(e.entries()))if(s===t)return r};export function keys(e){return Object.keys(e)}export function deepEqual(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(let n=0,f=r.length;n<f;n++)if(!hasOwnProperty.call(t,r[n])||!deepEqual(e[r[n]],t[r[n]]))return!1;return!0}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Use this as a wrapper to cache calculation results during single animation frame cycle.
|
|
8
|
+
* It is useful if
|
|
9
|
+
* - you have multiple invocations of same code in same animation frame
|
|
10
|
+
* - you're sure that result will always be the same
|
|
11
|
+
*/
|
|
12
|
+
export declare class AnimationFrameCache<T> {
|
|
13
|
+
private dataProvider;
|
|
14
|
+
private dataUpdatedPredicate;
|
|
15
|
+
calculatedInThisFrame: boolean;
|
|
16
|
+
cache?: T;
|
|
17
|
+
private animFrameId;
|
|
18
|
+
constructor(dataProvider: () => T, dataUpdatedPredicate?: () => boolean);
|
|
19
|
+
/**
|
|
20
|
+
* Calculates or retrieves a cached value.
|
|
21
|
+
* If the value has not been calculated in the current frame, it calculates it by calling the dataProvider function.
|
|
22
|
+
* If the data has been updated, it sets the calculatedInThisFrame flag to true.
|
|
23
|
+
* It also sets a throttled animation frame to reset the calculatedInThisFrame flag to false.
|
|
24
|
+
* If the cache is not null, it returns the cached value, otherwise it calls the dataProvider function and returns its result.
|
|
25
|
+
* @returns {T} The cached or calculated value.
|
|
26
|
+
*/
|
|
27
|
+
calculateOrGet(): T;
|
|
28
|
+
/**
|
|
29
|
+
* Invalidates the current state and returns the result of the calculateOrGet() method.
|
|
30
|
+
* @returns {T} The result of the calculateOrGet() method.
|
|
31
|
+
*/
|
|
32
|
+
forceCalculateOrGet(): T;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the last cached value or undefined if there is no cached value.
|
|
35
|
+
* @returns {T | undefined} The last cached value or undefined.
|
|
36
|
+
*/
|
|
37
|
+
getLastCachedValue(): T | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Updates the cache value with the provided value.
|
|
40
|
+
* @param {T} value - The new value to be set in the cache.
|
|
41
|
+
* @returns {void}
|
|
42
|
+
*/
|
|
43
|
+
updateCacheValue(value: T): void;
|
|
44
|
+
/**
|
|
45
|
+
* Invalidates the cache and sets the calculatedInThisFrame flag to false.
|
|
46
|
+
* @function
|
|
47
|
+
* @name invalidate
|
|
48
|
+
* @memberof ClassName
|
|
49
|
+
* @instance
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
invalidate(): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{animationFrameThrottled as e}from"./request-animation-frame-throttle.utils";import{uuid as i}from"../uuid.utils";export class AnimationFrameCache{constructor(a,t=()=>!0){this.dataProvider=a,this.dataUpdatedPredicate=t,this.calculatedInThisFrame=!1,this.animFrameId=`anim_cache_${i()}`}calculateOrGet(){var a;return this.calculatedInThisFrame||(this.cache=this.dataProvider(),this.dataUpdatedPredicate()&&(this.calculatedInThisFrame=!0),e(this.animFrameId,()=>{this.calculatedInThisFrame=!1})),(a=this.cache)!==null&&a!==void 0?a:this.dataProvider()}forceCalculateOrGet(){return this.invalidate(),this.calculateOrGet()}getLastCachedValue(){return this.cache}updateCacheValue(a){this.cache=a}invalidate(){this.cache=void 0,this.calculatedInThisFrame=!1}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export declare const debounce: <T extends (...args: any[]) => any>(callback: T, waitFor: number) => (...args: Parameters<T>) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export const debounce=(t,o)=>{let e=0;return(...u)=>{clearTimeout(e),e=+setTimeout(()=>t(...u),o)}};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
interface Eq<A> {
|
|
7
|
+
readonly equals: (x: A, y: A) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const MEMOIZE_CLEAR_FUNCTION: symbol;
|
|
10
|
+
/**
|
|
11
|
+
* Memoizes function for passed arguments
|
|
12
|
+
* @doc-tags utility
|
|
13
|
+
*/
|
|
14
|
+
export declare function memoize<F extends Function>(this: any, fn: F): F;
|
|
15
|
+
export declare const memoOnce: <A>(E: Eq<A>) => <Args extends A[], R>(f: (...args: Args) => R) => (...args: Args) => R;
|
|
16
|
+
/**
|
|
17
|
+
* @param {Array.<*>} args
|
|
18
|
+
* @returns {String}
|
|
19
|
+
*/
|
|
20
|
+
export declare function serialize(args: any[]): string;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export const MEMOIZE_CLEAR_FUNCTION=Symbol("MEMOIZE_CLEAR_FUNCTION");export function memoize(s){const r={},e=function(){const t=Array.prototype.slice.call(arguments),n=serialize(t);return typeof r[n]=="undefined"&&(r[n]=s.apply(this,t)),r[n]}.bind(this);return e[MEMOIZE_CLEAR_FUNCTION]=function(){const t=Array.prototype.slice.call(arguments),n=serialize(t);delete r[n]},e}export const memoOnce=s=>r=>{let e=!1,t,n=[];const l=o=>{t=r(...o),e=!0,n=o};return(...o)=>{const c=o.length;if(e&&c===0)return t;if(!e||n.length!==c)return l(o),t;for(let i=0;i<c;i++)if(!s.equals(n[i],o[i]))return l(o),t;return t}};export function serialize(s){if(!s.every(e=>typeof e=="number"||typeof e=="string"||typeof e=="boolean"))throw Error("Arguments to memoized function can only be strings or numbers");return JSON.stringify(s)}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export declare let animationFrameId: number;
|
|
7
|
+
export declare const animationFrameThrottled: (name: string, action: () => void) => void;
|
|
8
|
+
export declare const cancelThrottledAnimationFrame: (name: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Prior actions will be called before regular actions
|
|
11
|
+
* An example of regular action - draw event
|
|
12
|
+
* @param name
|
|
13
|
+
* @param action
|
|
14
|
+
*/
|
|
15
|
+
export declare const animationFrameThrottledPrior: (name: string, action: () => void) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
let a=!1;export let animationFrameId=0;const o=new Map,n=new Map,r=()=>{a||(a=!0,animationFrameId=requestAnimationFrame(()=>{n.forEach((e,t)=>{e(),n.delete(t)}),o.forEach((e,t)=>{e(),o.delete(t)}),a=!1}))};export const animationFrameThrottled=(e,t)=>{o.set(e,t),r()},cancelThrottledAnimationFrame=e=>{o.delete(e)},animationFrameThrottledPrior=(e,t)=>{n.set(e,t),r()};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
@param shouldPreventDefault
|
|
8
|
+
@param {Function} listener
|
|
9
|
+
wraps the listener, that it would be fired not as frequent as event itself, but not more than every 30 ms
|
|
10
|
+
@param {Function} [isSuppressed] optional callback to check if the event is suppressed for some reason before adding
|
|
11
|
+
the handler in requestAnimationFrame, which would execute it asynchronously
|
|
12
|
+
@returns {Function}
|
|
13
|
+
*/
|
|
14
|
+
export declare function throttle<L extends EventListener>(shouldPreventDefault: boolean, listener: L, isSuppressed?: () => boolean): L;
|
|
15
|
+
export declare function throttle(shouldPreventDefault: boolean, listener: EventListener, isSuppressed?: () => boolean): () => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{uuid as m}from"../uuid.utils";import{animationFrameThrottled as c}from"./request-animation-frame-throttle.utils";export function throttle(i,e,o){let n;const r=m();function f(){const t=n;n=void 0,t&&e(t)}return function(t){const a=n;n=t,i&&t.preventDefault(),!a&&!(typeof o=="function"&&o())&&c(r,f)}}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PriceIncrementsUtils {
|
|
7
|
+
static DEFAULT_INCREMENT: number;
|
|
8
|
+
static DEFAULT_PRECISION: number;
|
|
9
|
+
static RELATIVE_EPS: number;
|
|
10
|
+
static MAXIMUM_PRECISION: number;
|
|
11
|
+
/**
|
|
12
|
+
* Automatically detects increment of provided value range.
|
|
13
|
+
* Naive algorithm takes 1st mantissa number's :
|
|
14
|
+
* range=124.14 => increment=1
|
|
15
|
+
* range=6300.02931 => increment=10
|
|
16
|
+
* range=0.0018 => increment=0.00001
|
|
17
|
+
*
|
|
18
|
+
* @param valueRange
|
|
19
|
+
* @doc-tags tricky,y-axis
|
|
20
|
+
*/
|
|
21
|
+
static autoDetectIncrementOfValueRange(valueRange: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Gets number of digits in number.
|
|
24
|
+
* 20 => 2
|
|
25
|
+
* 100 => 3
|
|
26
|
+
* 7 => 1
|
|
27
|
+
* 1.123 => 1
|
|
28
|
+
* -200 => 3
|
|
29
|
+
* -1234567.00031 => 7
|
|
30
|
+
* 0.0001 = > -4
|
|
31
|
+
* @param x - any number
|
|
32
|
+
*/
|
|
33
|
+
private static getDigitsInNumber;
|
|
34
|
+
static getPriceIncrement(price: number, increments?: number[]): number;
|
|
35
|
+
static getPricePrecision(price: number, precisions: number[]): number;
|
|
36
|
+
static roundPriceToIncrement(price: number, increments: number[], incrementReferencePrice: number): number;
|
|
37
|
+
static computePrecisions(increments: number[]): number[];
|
|
38
|
+
static calculatePrecision(value: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* checks if the received from feed increments/precisions data is valid to display
|
|
41
|
+
* examples of wrong data: [], [0], not an array
|
|
42
|
+
*/
|
|
43
|
+
static validatePriceIncrementsOrPrecisions(data: number[]): boolean;
|
|
44
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{floor as i,MathUtils as u}from"./math.utils";class o{static autoDetectIncrementOfValueRange(r){const a=this.getDigitsInNumber(r);return r===0?.01:Math.pow(10,a-3)}static getDigitsInNumber(r){const a=h=>i(Math.log10((h^h>>31)-(h>>31)))+1;let t=a(r);return t===1&&r<1&&(t=a(r*1e9)-9),t}static getPriceIncrement(r,a=[]){if(!this.validatePriceIncrementsOrPrecisions(a))return this.DEFAULT_INCREMENT;if(isNaN(r))return Math.round(a[0]);r=Math.abs(r);let t=1;const h=1e-6;for(;t<a.length&&r>a[t]+Math.min(a[t-1],a[t+1])*h;)t+=2;return t>=a.length||r<a[t]-Math.min(a[t-1],a[t+1])*h?a[t-1]:Math.min(a[t-1],a[t+1])}static getPricePrecision(r,a){if(!this.validatePriceIncrementsOrPrecisions(a))return 0;if(isNaN(r))return Math.round(a[0]);r=Math.abs(r);let t=1;for(;t<a.length&&r>a[t];)t+=2;return Math.round(a[t-1])}static roundPriceToIncrement(r,a,t){const h=o.getPriceIncrement(t||r,a);return u.roundToNearest(r,h)}static computePrecisions(r){const a=[...r];for(let t=0;t<r.length;t+=2)a[t]=o.calculatePrecision(r[t]);for(let t=1;t<r.length;t+=2)a[t]=r[t]+Math.min(r[t-1],r[t+1])*o.RELATIVE_EPS;return a}static calculatePrecision(r){let a=r>1?Math.abs(Math.floor(r)-r):r;for(let t=0;t<o.MAXIMUM_PRECISION;t++){const h=Math.floor(a+.5),M=Math.abs(a*o.RELATIVE_EPS);if(h>=a-M&&h<=a+M)return t;a*=10}return o.MAXIMUM_PRECISION}static validatePriceIncrementsOrPrecisions(r){return!(r.length===0||!Array.isArray(r)||r.findIndex(a=>a!==0)===-1)}}o.DEFAULT_INCREMENT=.01,o.DEFAULT_PRECISION=2,o.RELATIVE_EPS=1e-8,o.MAXIMUM_PRECISION=10;export{o as PriceIncrementsUtils};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export declare function uuid(): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export function uuid(){const t=()=>Math.random().toString(16).slice(-4);return`${t()+t()}-${t()}-${t()}-${t()}-${t()+t()+t()}`}
|