@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,311 @@
|
|
|
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 EventBus from '../events/event-bus';
|
|
7
|
+
import { Observable, Subject } from 'rxjs';
|
|
8
|
+
import { ChartBaseElement } from '../model/chart-base-element';
|
|
9
|
+
import { HitBoundsTest } from '../canvas/canvas-bounds-container';
|
|
10
|
+
import { Bounds } from '../model/bounds.model';
|
|
11
|
+
type CustomMouseEvent = MouseEvent | TouchEvent;
|
|
12
|
+
/**
|
|
13
|
+
* Gathers user input on canvas element:
|
|
14
|
+
* Chart update order should be following:
|
|
15
|
+
* 1. update currentPoints
|
|
16
|
+
* 2. fire drag, so chart scale is updated if dragged
|
|
17
|
+
* 3. fire cross - it should have updated chart coordinates
|
|
18
|
+
* - mouse drag X / Y
|
|
19
|
+
* - zooming (wheel event)
|
|
20
|
+
* - touch start and move
|
|
21
|
+
*/
|
|
22
|
+
export declare class CanvasInputListenerComponent extends ChartBaseElement {
|
|
23
|
+
private eventBus;
|
|
24
|
+
private element;
|
|
25
|
+
static DRAG_START_EVENTS: readonly ["mousedown", "touchstart"];
|
|
26
|
+
static DRAG_EVENTS: readonly ["mousemove", "touchmove"];
|
|
27
|
+
static DRAG_END_EVENTS: string[];
|
|
28
|
+
private xDragStartSubject;
|
|
29
|
+
private xDragSubject;
|
|
30
|
+
private xDragTickSubject;
|
|
31
|
+
private xDragEndSubject;
|
|
32
|
+
private yDragStartSubject;
|
|
33
|
+
private yDragSubject;
|
|
34
|
+
private yDragTickSubject;
|
|
35
|
+
private yDragEndSubject;
|
|
36
|
+
private mouseMoveSubject;
|
|
37
|
+
private mouseMoveDocumentSubject;
|
|
38
|
+
private clickSubject;
|
|
39
|
+
private clickDocumentSubject;
|
|
40
|
+
private dbClickSubject;
|
|
41
|
+
private mouseDownSubject;
|
|
42
|
+
private mouseUpSubject;
|
|
43
|
+
private mouseUpDocumentSubject;
|
|
44
|
+
private wheelSubject;
|
|
45
|
+
private touchStartSubject;
|
|
46
|
+
private touchMoveSubject;
|
|
47
|
+
private touchEndSubject;
|
|
48
|
+
private touchCancelSubject;
|
|
49
|
+
private contextMenuSubject;
|
|
50
|
+
private longTouchSubject;
|
|
51
|
+
private pinchSubject;
|
|
52
|
+
private scrollGestureSubject;
|
|
53
|
+
mouseLeavesCanvasSubject: Subject<boolean>;
|
|
54
|
+
dragStartPoint: Point;
|
|
55
|
+
prevDragPoint: Point;
|
|
56
|
+
currentPoint: Point;
|
|
57
|
+
currentPointDocument: Point;
|
|
58
|
+
dragging: boolean;
|
|
59
|
+
dragStartEvent?: CustomMouseEvent;
|
|
60
|
+
canvasBounds: Bounds;
|
|
61
|
+
constructor(eventBus: EventBus, element: HTMLElement);
|
|
62
|
+
private documentDragListeners;
|
|
63
|
+
private dragProcessListener;
|
|
64
|
+
private dragStartListener;
|
|
65
|
+
/**
|
|
66
|
+
* This methods allows change scale, only if dragging using primary mouse button or touch.
|
|
67
|
+
* @param e
|
|
68
|
+
*/
|
|
69
|
+
private isDraggable;
|
|
70
|
+
/**
|
|
71
|
+
* This methods allows you to start dragging programmatically
|
|
72
|
+
* @param e
|
|
73
|
+
*/
|
|
74
|
+
startDragging(e: CustomMouseEvent): void;
|
|
75
|
+
/**
|
|
76
|
+
* This methods allows you to move mouse pointer programmatically
|
|
77
|
+
* @param e
|
|
78
|
+
*/
|
|
79
|
+
movePointer(e: CustomMouseEvent): void;
|
|
80
|
+
/**
|
|
81
|
+
* This methods allows you to stop dragging programmatically
|
|
82
|
+
*/
|
|
83
|
+
stopDragging(): void;
|
|
84
|
+
private dragListener;
|
|
85
|
+
private updateElementOffsetListener;
|
|
86
|
+
private dragEndListener;
|
|
87
|
+
private clickHandler;
|
|
88
|
+
/**
|
|
89
|
+
* Prevents text selection inside chart-core canvas. TODO Do we need it?
|
|
90
|
+
*/
|
|
91
|
+
private fixTextSelection;
|
|
92
|
+
doActivate(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the current mouse point.
|
|
95
|
+
*
|
|
96
|
+
* @returns {Point} The current mouse point.
|
|
97
|
+
*/
|
|
98
|
+
getCurrentMousePoint(): Point;
|
|
99
|
+
/**
|
|
100
|
+
* Private method that tracks the mouse position by adding event listeners for drag events on the document.
|
|
101
|
+
* The event listeners are added on the capture phase to ensure that every other listener gets an actual state for current points.
|
|
102
|
+
* The method also adds a subscription to remove the event listeners when they are no longer needed.
|
|
103
|
+
*/
|
|
104
|
+
private trackMousePosition;
|
|
105
|
+
private updateCurrentPoints;
|
|
106
|
+
/**
|
|
107
|
+
* Updates the current point of the document based on the provided event.
|
|
108
|
+
* @param {CustomMouseEvent} e - The event that triggered the update.
|
|
109
|
+
* @returns {void}
|
|
110
|
+
*/
|
|
111
|
+
private updateCurrentDocumentPoint;
|
|
112
|
+
/**
|
|
113
|
+
* Updates the current mouse point based on the provided CustomMouseEvent.
|
|
114
|
+
* @param {CustomMouseEvent} e - The CustomMouseEvent object containing the mouse/touch coordinates.
|
|
115
|
+
* @returns {void}
|
|
116
|
+
* @private
|
|
117
|
+
*/
|
|
118
|
+
private updateCurrentMousePoint;
|
|
119
|
+
/**
|
|
120
|
+
* Creates a new object with the same properties as the provided Point object.
|
|
121
|
+
* @param {Point} point - The Point object to be copied.
|
|
122
|
+
* @returns {Object} - A new object with the same properties as the provided Point object.
|
|
123
|
+
* @private
|
|
124
|
+
* @static
|
|
125
|
+
*/
|
|
126
|
+
private static copyPoint;
|
|
127
|
+
/**
|
|
128
|
+
* This method allows to observe mouse move events only in specific areas.
|
|
129
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that takes x and y coordinates as arguments and returns a boolean value indicating whether the event should be observed or not.
|
|
130
|
+
* @returns {Observable<Point>} - An observable that emits a Point object whenever a mouse move event occurs within the specified area.
|
|
131
|
+
*/
|
|
132
|
+
observeMouseMove(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
133
|
+
/**
|
|
134
|
+
* Returns an Observable that emits the mouse move events only if the user is not dragging.
|
|
135
|
+
* @returns {Observable<Point>} An Observable that emits the mouse move events.
|
|
136
|
+
*/
|
|
137
|
+
observeMouseMoveNoDrag(): Observable<Point>;
|
|
138
|
+
/**
|
|
139
|
+
* Observes any element hover in all document not only <canvas>
|
|
140
|
+
* @param hitBoundsTest
|
|
141
|
+
* @return point position in chart
|
|
142
|
+
*/
|
|
143
|
+
observeMouseMoveDocument(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
144
|
+
/**
|
|
145
|
+
* Observes any element hover in all document not only <canvas>
|
|
146
|
+
* @param hitBoundsTest
|
|
147
|
+
* @return absolute point position in document
|
|
148
|
+
*/
|
|
149
|
+
observeMouseMoveDocumentAnyElement(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
150
|
+
/**
|
|
151
|
+
* Returns an Observable that emits an Event object whenever a click event occurs on the document.
|
|
152
|
+
* The Observable is created from a Subject that emits the click event.
|
|
153
|
+
* @returns {Observable<Event>} An Observable that emits an Event object whenever a click event occurs on the document.
|
|
154
|
+
*/
|
|
155
|
+
observeClickOnDocument(): Observable<Event>;
|
|
156
|
+
/**
|
|
157
|
+
* Returns observable which contains point position relative to chart canvas. (not document point!)
|
|
158
|
+
* @param hitBoundsTest {HitBoundsTest}
|
|
159
|
+
*/
|
|
160
|
+
observeXDragStart(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
161
|
+
/**
|
|
162
|
+
* Returns an Observable that emits the xDragSubject value if the hitBoundsTest function returns true for the currentPoint.
|
|
163
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that takes the currentPoint's x and y coordinates as arguments and returns a boolean value.
|
|
164
|
+
* @returns {Observable<number>} - An Observable that emits the xDragSubject value if the hitBoundsTest function returns true for the currentPoint.
|
|
165
|
+
*/
|
|
166
|
+
observeXDrag(hitBoundsTest?: HitBoundsTest): Observable<number>;
|
|
167
|
+
/**
|
|
168
|
+
* Returns an Observable that emits when the xDragEndSubject emits and the hitBoundsTest function returns true for the currentPoint.
|
|
169
|
+
* @param {HitBoundsTest} [hitBoundsTest=() => true] - A function that takes the currentPoint's x and y coordinates as arguments and returns a boolean indicating whether the point is within the desired bounds.
|
|
170
|
+
* @returns {Observable<void>} - An Observable that emits when the xDragEndSubject emits and the hitBoundsTest function returns true for the currentPoint.
|
|
171
|
+
*/
|
|
172
|
+
observeXDragEnd(hitBoundsTest?: HitBoundsTest): Observable<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Returns an Observable that emits a number every time a drag tick event occurs on the X axis.
|
|
175
|
+
* The number emitted represents the current position of the drag on the X axis.
|
|
176
|
+
* The Observable is created from a Subject that emits the drag tick events.
|
|
177
|
+
* @returns {Observable<number>} An Observable that emits a number every time a drag tick event occurs on the X axis.
|
|
178
|
+
*/
|
|
179
|
+
observeXDragTick(): Observable<number>;
|
|
180
|
+
/**
|
|
181
|
+
* Returns observable which contains point position relative to chart canvas. (not document point!)
|
|
182
|
+
* @param hitBoundsTest {HitBoundsTest}
|
|
183
|
+
*/
|
|
184
|
+
observeYDragStart(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
185
|
+
/**
|
|
186
|
+
* Returns an observable that emits the y-drag subject and filters it based on the hitBoundsTest function.
|
|
187
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that returns a boolean indicating whether the current point is within the bounds.
|
|
188
|
+
* @returns {Observable<number>} - An observable that emits the y-drag subject.
|
|
189
|
+
*/
|
|
190
|
+
observeYDrag(hitBoundsTest?: HitBoundsTest): Observable<number>;
|
|
191
|
+
/**
|
|
192
|
+
* Returns an Observable that emits when the yDragEndSubject emits and the hitBoundsTest function returns true for the currentPoint.
|
|
193
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that takes in the x and y coordinates of the currentPoint and returns a boolean indicating whether the point is within the bounds.
|
|
194
|
+
* @returns {Observable<void>} - An Observable that emits when the yDragEndSubject emits and the hitBoundsTest function returns true for the currentPoint.
|
|
195
|
+
*/
|
|
196
|
+
observeYDragEnd(hitBoundsTest?: HitBoundsTest): Observable<void>;
|
|
197
|
+
/**
|
|
198
|
+
* Returns an Observable that emits a number every time the yDragTickSubject emits a value.
|
|
199
|
+
* The emitted value is the value emitted by the yDragTickSubject.
|
|
200
|
+
* @returns {Observable<number>} An Observable that emits a number every time the yDragTickSubject emits a value.
|
|
201
|
+
*/
|
|
202
|
+
observeYDragTick(): Observable<number>;
|
|
203
|
+
/**
|
|
204
|
+
* Returns an Observable that emits a boolean value when the mouse enters the canvas.
|
|
205
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that tests whether the mouse pointer is within the bounds of the canvas.
|
|
206
|
+
* @param {boolean} skipWhenDragging - A flag that determines whether to skip the mouse enter event when the user is dragging.
|
|
207
|
+
* @returns {Observable<boolean>} - An Observable that emits a boolean value when the mouse enters or leaves the canvas.
|
|
208
|
+
*/
|
|
209
|
+
observeMouseEnter(hitBoundsTest?: HitBoundsTest, skipWhenDragging?: boolean): Observable<boolean>;
|
|
210
|
+
/**
|
|
211
|
+
* Returns an observable that emits a value when the mouse leaves the canvas.
|
|
212
|
+
* @returns {Observable} An observable that emits a value when the mouse leaves the canvas.
|
|
213
|
+
*/
|
|
214
|
+
observeMouseLeavesCanvas(): Observable<boolean>;
|
|
215
|
+
/**
|
|
216
|
+
* Returns an Observable that emits a Point object when the element is clicked within the bounds specified by the hitBoundsTest function.
|
|
217
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that takes the x and y coordinates of the click event and returns a boolean indicating whether the click is within the desired bounds.
|
|
218
|
+
* @returns {Observable<Point>} - An Observable that emits a Point object when the element is clicked within the specified bounds.
|
|
219
|
+
*/
|
|
220
|
+
observeClick(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
221
|
+
/**
|
|
222
|
+
* Returns an Observable that emits a Point object when a double click event occurs within the bounds of the current point.
|
|
223
|
+
* @param {HitBoundsTest} [hitBoundsTest=() => true] - A function that tests if the double click event occurred within the bounds of the current point.
|
|
224
|
+
* @returns {Observable<Point>} An Observable that emits a Point object when a double click event occurs within the bounds of the current point.
|
|
225
|
+
*/
|
|
226
|
+
observeDbClick(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
227
|
+
/**
|
|
228
|
+
* Returns an Observable that emits WheelEvent objects when the wheelSubject emits a new value.
|
|
229
|
+
* The emitted events are filtered by the hitBoundsTest function, which is passed as an optional parameter.
|
|
230
|
+
* If the hitBoundsTest function is not provided, it defaults to a function that always returns true.
|
|
231
|
+
* @param {HitBoundsTest} [hitBoundsTest=() => true] - A function that takes the currentPoint's x and y coordinates as arguments and returns a boolean value.
|
|
232
|
+
* @returns {Observable<WheelEvent>} - An Observable that emits WheelEvent objects.
|
|
233
|
+
*/
|
|
234
|
+
observeWheel(hitBoundsTest?: HitBoundsTest): Observable<WheelEvent>;
|
|
235
|
+
/**
|
|
236
|
+
* Returns an Observable that emits WheelEvent when a pinch event occurs and the hitBoundsTest function returns true for the current point.
|
|
237
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that takes the current point's x and y coordinates as arguments and returns a boolean indicating whether the point is within the desired bounds.
|
|
238
|
+
* @returns {Observable<WheelEvent>} - An Observable that emits WheelEvent when a pinch event occurs and the hitBoundsTest function returns true for the current point.
|
|
239
|
+
*/
|
|
240
|
+
observePinch(hitBoundsTest?: HitBoundsTest): Observable<WheelEvent>;
|
|
241
|
+
/**
|
|
242
|
+
* Returns an Observable that emits a WheelEvent whenever a scroll gesture is detected.
|
|
243
|
+
* The Observable is created from a Subject that is subscribed to by the component's template.
|
|
244
|
+
* @returns {Observable<WheelEvent>} An Observable that emits a WheelEvent whenever a scroll gesture is detected.
|
|
245
|
+
*/
|
|
246
|
+
observeScrollGesture(): Observable<WheelEvent>;
|
|
247
|
+
/**
|
|
248
|
+
* Returns an Observable that emits TouchEvent when a touchstart event occurs within the bounds of the current point.
|
|
249
|
+
* @param {HitBoundsTest} [hitBoundsTest=() => true] - A function that tests if the touch event occurred within the bounds of the current point.
|
|
250
|
+
* @returns {Observable<TouchEvent>} - An Observable that emits TouchEvent when a touchstart event occurs within the bounds of the current point.
|
|
251
|
+
*/
|
|
252
|
+
observeTouchStart(hitBoundsTest?: HitBoundsTest): Observable<TouchEvent>;
|
|
253
|
+
/**
|
|
254
|
+
* Returns an Observable that emits TouchEvent objects when the user moves their finger on the screen.
|
|
255
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that takes the x and y coordinates of the current touch point and returns a boolean indicating whether the touch is within the desired bounds.
|
|
256
|
+
* @returns {Observable<TouchEvent>} - An Observable that emits TouchEvent objects when the user moves their finger on the screen within the specified bounds.
|
|
257
|
+
*/
|
|
258
|
+
observeTouchMove(hitBoundsTest?: HitBoundsTest): Observable<TouchEvent>;
|
|
259
|
+
/**
|
|
260
|
+
* Returns an Observable that emits a TouchEvent when the touch end event occurs on the document.
|
|
261
|
+
* The Observable is created from a Subject that is subscribed to the touchEndSubject.
|
|
262
|
+
* @returns {Observable<TouchEvent>} An Observable that emits a TouchEvent when the touch end event occurs on the document.
|
|
263
|
+
*/
|
|
264
|
+
observeTouchEndDocument(): Observable<TouchEvent>;
|
|
265
|
+
/**
|
|
266
|
+
* Returns an Observable that emits a TouchEvent when the touchcancel event is triggered on the document.
|
|
267
|
+
* @return {Observable<TouchEvent>} An Observable that emits a TouchEvent when the touchcancel event is triggered on the document.
|
|
268
|
+
*/
|
|
269
|
+
observeTouchCancelDocument(): Observable<TouchEvent>;
|
|
270
|
+
/**
|
|
271
|
+
* Returns an Observable that emits the Point object when the mouse button is pressed down within the bounds of the current point.
|
|
272
|
+
* @param {HitBoundsTest} [hitBoundsTest=() => true] - A function that tests whether the mouse click is within the bounds of the current point.
|
|
273
|
+
* @returns {Observable<Point>} - An Observable that emits the Point object when the mouse button is pressed down within the bounds of the current point.
|
|
274
|
+
*/
|
|
275
|
+
observeMouseDown(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
276
|
+
/**
|
|
277
|
+
* Returns an Observable that emits the Point where the mouse button is released,
|
|
278
|
+
* filtered by the hitBoundsTest function that determines if the currentPoint is within the bounds.
|
|
279
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that takes the x and y coordinates of the currentPoint and returns a boolean indicating if it is within the bounds.
|
|
280
|
+
* @returns {Observable<Point>} - An Observable that emits the Point where the mouse button is released, filtered by the hitBoundsTest function.
|
|
281
|
+
*/
|
|
282
|
+
observeMouseUp(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
283
|
+
/**
|
|
284
|
+
* Returns an Observable that emits the Point where the mouse button is released on the document.
|
|
285
|
+
* @param {HitBoundsTest} hitBoundsTest - A function that returns a boolean indicating whether the mouseup event occurred within the bounds of the element.
|
|
286
|
+
* @returns {Observable<Point>} - An Observable that emits the Point where the mouse button is released on the document.
|
|
287
|
+
*/
|
|
288
|
+
observeMouseUpDocument(hitBoundsTest?: HitBoundsTest): Observable<Point>;
|
|
289
|
+
/**
|
|
290
|
+
* Returns an Observable that emits a MouseEvent when a context menu event is triggered and the mouse pointer is within the bounds of the element.
|
|
291
|
+
* @param {HitBoundsTest} [hitBoundsTest=() => true] - A function that returns a boolean indicating whether the mouse pointer is within the bounds of the element.
|
|
292
|
+
* @returns {Observable<MouseEvent>} - An Observable that emits a MouseEvent when a context menu event is triggered and the mouse pointer is within the bounds of the element.
|
|
293
|
+
*/
|
|
294
|
+
observeContextMenu(hitBoundsTest?: HitBoundsTest): Observable<MouseEvent>;
|
|
295
|
+
/**
|
|
296
|
+
* Returns an Observable that emits a TouchEvent when a long touch is detected on the current element.
|
|
297
|
+
* @param {HitBoundsTest} [hitBoundsTest=() => true] - A function that returns a boolean indicating whether the touch event occurred within the bounds of the current element.
|
|
298
|
+
* @returns {Observable<TouchEvent>} - An Observable that emits a TouchEvent when a long touch is detected on the current element.
|
|
299
|
+
*/
|
|
300
|
+
observeLongTouch(hitBoundsTest?: HitBoundsTest): Observable<TouchEvent>;
|
|
301
|
+
/**
|
|
302
|
+
* Returns the current point of the object.
|
|
303
|
+
* @returns {Point} The current point of the object.
|
|
304
|
+
*/
|
|
305
|
+
getCurrentPoint(): Point;
|
|
306
|
+
}
|
|
307
|
+
export interface Point {
|
|
308
|
+
x: number;
|
|
309
|
+
y: number;
|
|
310
|
+
}
|
|
311
|
+
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
|
+
import{subscribeListener as n}from"../utils/dom.utils";import{merge as x,Subject as i}from"rxjs";import{ChartBaseElement as j}from"../model/chart-base-element";import{distinctUntilChanged as E,filter as s,map as v,tap as D}from"rxjs/operators";import{EVENT_RESIZED as f}from"../events/events";import{deviceDetector as y}from"../utils/device/device-detector.utils";import{touchpadDetector as L}from"../utils/device/touchpad.utils";var p;(function(a){a[a.left=0]="left",a[a.middle=1]="middle",a[a.right=2]="right"})(p||(p={}));class o extends j{constructor(t,r){super(),this.eventBus=t,this.element=r,this.xDragStartSubject=new i,this.xDragSubject=new i,this.xDragTickSubject=new i,this.xDragEndSubject=new i,this.yDragStartSubject=new i,this.yDragSubject=new i,this.yDragTickSubject=new i,this.yDragEndSubject=new i,this.mouseMoveSubject=new i,this.mouseMoveDocumentSubject=new i,this.clickSubject=new i,this.clickDocumentSubject=new i,this.dbClickSubject=new i,this.mouseDownSubject=new i,this.mouseUpSubject=new i,this.mouseUpDocumentSubject=new i,this.wheelSubject=new i,this.touchStartSubject=new i,this.touchMoveSubject=new i,this.touchEndSubject=new i,this.touchCancelSubject=new i,this.contextMenuSubject=new i,this.longTouchSubject=new i,this.pinchSubject=new i,this.scrollGestureSubject=new i,this.mouseLeavesCanvasSubject=new i,this.dragStartPoint={x:0,y:0},this.prevDragPoint={x:0,y:0},this.currentPoint={x:0,y:0},this.currentPointDocument={x:0,y:0},this.dragging=!1,this.canvasBounds={x:0,y:0,pageX:0,pageY:0,width:0,height:0},this.documentDragListeners=[],this.dragProcessListener=()=>{this.xDragSubject.next(this.currentPoint.x-this.dragStartPoint.x),this.yDragSubject.next(this.currentPoint.y-this.dragStartPoint.y),this.xDragTickSubject.next(this.currentPoint.x-this.prevDragPoint.x),this.yDragTickSubject.next(this.currentPoint.y-this.prevDragPoint.y),this.prevDragPoint.x=this.currentPoint.x,this.prevDragPoint.y=this.currentPoint.y},this.dragStartListener=u=>{this.isDraggable(u)&&(this.updateCurrentPoints(u),this.dragging=!0,this.dragStartEvent=u,this.documentDragListeners.forEach(c=>c()),this.dragStartPoint=o.copyPoint(this.currentPoint),this.xDragStartSubject.next(this.dragStartPoint),this.yDragStartSubject.next(this.dragStartPoint),this.prevDragPoint=Object.assign({},this.dragStartPoint),o.DRAG_EVENTS.forEach(c=>{document.addEventListener(c,this.dragProcessListener,!0);const e=document.removeEventListener.bind(document,c,this.dragProcessListener,!0);this.documentDragListeners.push(e),this.addSubscription(e)}),this.dragProcessListener())},this.dragListener=()=>this.mouseMoveDocumentSubject.next(this.currentPoint),this.updateElementOffsetListener=()=>this.mouseMoveSubject.next(this.currentPoint),this.dragEndListener=()=>{this.dragging=!1,this.documentDragListeners.forEach(u=>u()),this.xDragEndSubject.next(),this.yDragEndSubject.next()},this.clickHandler=()=>this.clickSubject.next(this.currentPoint),this.updateCurrentPoints=u=>{this.updateCurrentDocumentPoint(u),this.updateCurrentMousePoint(u)}}isDraggable(t){return t instanceof MouseEvent?t.button===p.left:t instanceof TouchEvent}startDragging(t){this.updateCurrentPoints(t),this.dragStartListener(t)}movePointer(t){this.updateCurrentPoints(t),this.dragListener(),this.updateElementOffsetListener(),this.dragging&&this.dragProcessListener()}stopDragging(){this.dragEndListener()}fixTextSelection(){const t=r=>(r.preventDefault(),!1);this.element.addEventListener("selectstart",t,!1),this.addSubscription(this.element.removeEventListener.bind(this.element,"selectstart",t,!1))}doActivate(){this.fixTextSelection(),this.documentDragListeners=[],o.DRAG_START_EVENTS.forEach(e=>{this.element.addEventListener(e,this.dragStartListener),this.addSubscription(()=>this.element.removeEventListener(e,this.dragStartListener))}),this.trackMousePosition(),o.DRAG_EVENTS.forEach(e=>{document.addEventListener(e,this.dragListener),this.addSubscription(document.removeEventListener.bind(document,e,this.dragListener)),this.element.addEventListener(e,this.updateElementOffsetListener),this.addSubscription(this.element.removeEventListener.bind(this.element,e,this.updateElementOffsetListener))}),o.DRAG_END_EVENTS.forEach(e=>{document.addEventListener(e,this.dragEndListener),this.addSubscription(document.removeEventListener.bind(document,e,this.dragEndListener))}),this.addSubscription(n(this.element,this.clickHandler,"click"));const t=e=>{this.clickDocumentSubject.next(e)};this.addSubscription(n(document,t,"click"));const r=y();if(r==="apple"||r==="mobile"){const b=(()=>{let h=null;return()=>{h?(this.dbClickSubject.next(this.currentPoint),clearTimeout(h),h=null):h=window.setTimeout(()=>{h=null},250)}})();this.addSubscription(n(this.element,b,"touchend"))}const u=(e,b=500,h=2)=>{e.preventDefault();let d=null;const g={x:e.touches[0].clientX,y:e.touches[0].clientY};let l={x:0,y:0};const P=S=>{l={x:S.touches[0].clientX,y:S.touches[0].clientY},(Math.sqrt(Math.pow(l.x-g.x,2)+Math.pow(l.y-g.y,2))>h||S.touches.length>1)&&m()},m=()=>{d&&(clearTimeout(d),d=null),this.element.removeEventListener("touchend",m),this.element.removeEventListener("touchmove",P)};d=setTimeout(()=>this.longTouchSubject.next(e),b),this.element.addEventListener("touchmove",P,{passive:!0}),this.element.addEventListener("touchend",m)};this.addSubscription(n(this.element,e=>u(e),"touchstart")),this.addSubscription(n(this.element,()=>this.dbClickSubject.next(this.currentPoint),"dblclick")),this.addSubscription(n(this.element,e=>this.touchStartSubject.next(e),"touchstart")),this.addSubscription(n(this.element,e=>this.touchMoveSubject.next(e),"touchmove",!0)),this.addSubscription(n(this.element,e=>this.touchEndSubject.next(e),"touchend")),this.addSubscription(n(this.element,e=>this.touchCancelSubject.next(e),"touchcancel")),this.addSubscription(n(this.element,e=>{e.ctrlKey?this.pinchSubject.next(e):L(e)?this.scrollGestureSubject.next(e):this.wheelSubject.next(e),e.preventDefault()},"wheel")),this.addSubscription(n(this.element,e=>this.contextMenuSubject.next(e),"contextmenu")),this.addSubscription(n(this.element,()=>this.mouseDownSubject.next(this.currentPoint),"mousedown")),this.addSubscription(n(this.element,()=>this.mouseUpSubject.next(this.currentPoint),"mouseup")),this.addSubscription(n(document,()=>this.mouseUpDocumentSubject.next(this.currentPoint),"mouseup")),this.addRxSubscription(this.eventBus.observe(f).subscribe(()=>{const e=this.element.getBoundingClientRect();this.canvasBounds.x=e.left,this.canvasBounds.y=e.top,this.canvasBounds.width=e.width,this.canvasBounds.height=e.height}));const c=()=>{this.mouseLeavesCanvasSubject.next(!0)};this.element.addEventListener("mouseleave",c,!1),this.addSubscription(this.element.removeEventListener.bind(this.element,"mouseleave",c,!1))}getCurrentMousePoint(){return this.currentPoint}trackMousePosition(){o.DRAG_EVENTS.forEach(t=>{document.addEventListener(t,this.updateCurrentPoints,!0),this.addSubscription(()=>document.removeEventListener(t,this.updateCurrentPoints,!0))})}updateCurrentDocumentPoint(t){"pageX"in t?this.currentPointDocument.x=t.pageX:t.touches!==void 0&&(this.currentPointDocument.x=t.touches[0].pageX),"pageY"in t?this.currentPointDocument.y=t.pageY:t.touches!==void 0&&(this.currentPointDocument.y=t.touches[0].pageY)}updateCurrentMousePoint(t){const r=this.element.getBoundingClientRect();"clientX"in t?this.currentPoint.x=t.clientX-r.left:t.touches!==void 0&&(this.currentPoint.x=t.touches[0].clientX-r.left),"clientY"in t?this.currentPoint.y=t.clientY-r.top:t.touches!==void 0&&(this.currentPoint.y=t.touches[0].clientY-r.top)}static copyPoint(t){return{x:t.x,y:t.y}}observeMouseMove(t=()=>!0){return this.mouseMoveSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeMouseMoveNoDrag(){return this.mouseMoveSubject.asObservable().pipe(s(()=>!this.dragging))}observeMouseMoveDocument(t=()=>!0){return this.mouseMoveDocumentSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeMouseMoveDocumentAnyElement(t=()=>!0){return this.mouseMoveDocumentSubject.asObservable().pipe(s(()=>t(this.currentPointDocument.x,this.currentPointDocument.y)),v(()=>this.currentPointDocument))}observeClickOnDocument(){return this.clickDocumentSubject.asObservable()}observeXDragStart(t=()=>!0){return this.xDragStartSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeXDrag(t=()=>!0){return this.xDragSubject.pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeXDragEnd(t=()=>!0){return this.xDragEndSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeXDragTick(){return this.xDragTickSubject.asObservable()}observeYDragStart(t=()=>!0){return this.yDragStartSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeYDrag(t=()=>!0){return this.yDragSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeYDragEnd(t=()=>!0){return this.yDragEndSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeYDragTick(){return this.yDragTickSubject.asObservable()}observeMouseEnter(t=()=>!0,r=!1){const u=this.mouseMoveSubject.asObservable().pipe(s(()=>!(r&&this.dragging)),v(()=>t(this.currentPoint.x,this.currentPoint.y))),c=this.observeMouseLeavesCanvas().pipe(v(()=>!1));return x(u,c).pipe(E())}observeMouseLeavesCanvas(){return this.mouseLeavesCanvasSubject.asObservable()}observeClick(t=()=>!0){return this.clickSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeDbClick(t=()=>!0){return this.dbClickSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeWheel(t=()=>!0){return this.wheelSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observePinch(t=()=>!0){return this.pinchSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeScrollGesture(){return this.scrollGestureSubject.asObservable()}observeTouchStart(t=()=>!0){return this.touchStartSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeTouchMove(t=()=>!0){return this.touchMoveSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeTouchEndDocument(){return this.touchEndSubject.asObservable()}observeTouchCancelDocument(){return this.touchCancelSubject.asObservable()}observeMouseDown(t=()=>!0){return this.mouseDownSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeMouseUp(t=()=>!0){return this.mouseUpSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeMouseUpDocument(t=()=>!0){return this.mouseUpDocumentSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)))}observeContextMenu(t=()=>!0){return this.contextMenuSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)),D(r=>r.preventDefault()))}observeLongTouch(t=()=>!0){return this.longTouchSubject.asObservable().pipe(s(()=>t(this.currentPoint.x,this.currentPoint.y)),D(r=>r.preventDefault()))}getCurrentPoint(){return this.currentPoint}}o.DRAG_START_EVENTS=["mousedown","touchstart"],o.DRAG_EVENTS=["mousemove","touchmove"],o.DRAG_END_EVENTS=["mouseup","touchend","touchcancel"];export{o as CanvasInputListenerComponent};
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { CanvasBoundsContainer, HitBoundsTest } from '../canvas/canvas-bounds-container';
|
|
7
|
+
import { CursorHandler } from '../canvas/cursor.handler';
|
|
8
|
+
import { FullChartConfig } from '../chart.config';
|
|
9
|
+
import { ChartBaseElement } from './chart-base-element';
|
|
10
|
+
import { ChartModel } from '../components/chart/chart.model';
|
|
11
|
+
import { ChartPanComponent } from '../components/pan/chart-pan.component';
|
|
12
|
+
import { CanvasModel } from './canvas.model';
|
|
13
|
+
import { CanvasInputListenerComponent } from '../inputlisteners/canvas-input-listener.component';
|
|
14
|
+
import { Bounds } from './bounds.model';
|
|
15
|
+
export declare const BASELINE_RESIZER_UUID = "BASELINE_RESIZER";
|
|
16
|
+
/**
|
|
17
|
+
* Baseline separator for baseline chart
|
|
18
|
+
* Used to resize baseline area on chart.
|
|
19
|
+
*/
|
|
20
|
+
export declare class BaselineModel extends ChartBaseElement {
|
|
21
|
+
private chartModel;
|
|
22
|
+
private canvasModel;
|
|
23
|
+
private canvasInputListener;
|
|
24
|
+
private config;
|
|
25
|
+
private canvasBoundContainer;
|
|
26
|
+
private cursorHandler;
|
|
27
|
+
readonly resizerBounds: Bounds;
|
|
28
|
+
baselineYPercents: number;
|
|
29
|
+
ht: HitBoundsTest;
|
|
30
|
+
constructor(chartModel: ChartModel, chartPanComponent: ChartPanComponent, canvasModel: CanvasModel, canvasInputListener: CanvasInputListenerComponent, config: FullChartConfig, canvasBoundContainer: CanvasBoundsContainer, cursorHandler: CursorHandler);
|
|
31
|
+
protected doActivate(): void;
|
|
32
|
+
private dragTickCb;
|
|
33
|
+
/**
|
|
34
|
+
* Recalculates the bounds of the baseline resizer based on the current chart and y-axis bounds.
|
|
35
|
+
* @private
|
|
36
|
+
* @function
|
|
37
|
+
* @name recalculateBounds
|
|
38
|
+
* @memberof ClassName
|
|
39
|
+
* @returns {void}
|
|
40
|
+
*/
|
|
41
|
+
private recalculateBounds;
|
|
42
|
+
/**
|
|
43
|
+
* Moves the baseline of the chart to the specified y coordinate.
|
|
44
|
+
* @param {number} y - The y coordinate to move the baseline to.
|
|
45
|
+
* @returns {void}
|
|
46
|
+
*/
|
|
47
|
+
moveBaseLine(y: number): void;
|
|
48
|
+
/**
|
|
49
|
+
* This method is called when the component is being deactivated.
|
|
50
|
+
* It calls the doDeactivate method of the parent class.
|
|
51
|
+
* @protected
|
|
52
|
+
*/
|
|
53
|
+
protected doDeactivate(): void;
|
|
54
|
+
}
|
|
@@ -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{CanvasBoundsContainer as l,CanvasElement as t,isInVerticalBounds as g}from"../canvas/canvas-bounds-container";import{ChartBaseElement as C}from"./chart-base-element";import{DragNDropYComponent as v}from"../components/dran-n-drop_helper/drag-n-drop-y.component";export const BASELINE_RESIZER_UUID="BASELINE_RESIZER";export class BaselineModel extends C{constructor(s,e,n,i,r,a,h){super(),this.chartModel=s,this.canvasModel=n,this.canvasInputListener=i,this.config=r,this.canvasBoundContainer=a,this.cursorHandler=h,this.resizerBounds={x:0,y:0,pageX:0,pageY:0,height:0,width:0},this.baselineYPercents=50,this.ht=l.hitTestOf(this.resizerBounds,{extensionY:this.config.components.paneResizer.dragZone}),this.dragTickCb=d=>{const{delta:u}=d,B=this.canvasBoundContainer.getBounds(t.CHART),o=this.canvasInputListener.getCurrentPoint().y;u!==0&&g(o,B)&&(this.moveBaseLine(o),this.canvasModel.fireDraw())};const c=new v(this.ht,{onDragTick:this.dragTickCb},i,e);this.addChildEntity(c)}doActivate(){super.doActivate(),this.addRxSubscription(this.canvasBoundContainer.observeBoundsChanged(t.CHART).subscribe(()=>this.recalculateBounds())),this.chartModel.chartTypeChanged.subscribe(s=>{s==="baseline"?this.cursorHandler.setCursorForBounds("BASELINE_RESIZER",this.resizerBounds,this.config.components.baseline.cursor,this.config.components.baseline.dragZone):this.cursorHandler.removeCursorForCanvasEl("BASELINE_RESIZER")})}recalculateBounds(){const s=this.canvasBoundContainer.getBounds(t.CHART),e=this.canvasBoundContainer.getBounds(t.Y_AXIS);this.resizerBounds.x=s.x,this.resizerBounds.width=s.width+e.width,this.resizerBounds.height=this.config.components.baseline.height;const n=s.y+s.height*(this.baselineYPercents/100);this.resizerBounds.y=n,this.canvasBoundContainer.bounds[BASELINE_RESIZER_UUID]=this.resizerBounds}moveBaseLine(s){const e=this.canvasBoundContainer.getBounds(t.CHART);this.baselineYPercents=(s-e.y)*100/e.height,this.resizerBounds.y=s}doDeactivate(){super.doDeactivate()}}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 BoundsProvider {
|
|
7
|
+
(): Bounds;
|
|
8
|
+
}
|
|
9
|
+
export interface Bounds {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
pageX: number;
|
|
13
|
+
pageY: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 VisualCandle from './visual-candle';
|
|
7
|
+
import { BaseHover, HoverProducerPart } from '../inputhandlers/hover-producer.component';
|
|
8
|
+
import { ChartModel } from '../components/chart/chart.model';
|
|
9
|
+
export interface CandleHover {
|
|
10
|
+
readonly visualCandle: VisualCandle;
|
|
11
|
+
readonly high: number;
|
|
12
|
+
readonly low: number;
|
|
13
|
+
readonly open: number;
|
|
14
|
+
readonly close: number;
|
|
15
|
+
readonly volume: number;
|
|
16
|
+
readonly highY: number;
|
|
17
|
+
readonly lowY: number;
|
|
18
|
+
readonly openY: number;
|
|
19
|
+
readonly closeY: number;
|
|
20
|
+
readonly closestOHLCY: number;
|
|
21
|
+
readonly highFormatted: string;
|
|
22
|
+
readonly lowFormatted: string;
|
|
23
|
+
readonly openFormatted: string;
|
|
24
|
+
readonly closeFormatted: string;
|
|
25
|
+
}
|
|
26
|
+
export declare class CandleHoverProducerPart implements HoverProducerPart<CandleHover | undefined> {
|
|
27
|
+
private chartModel;
|
|
28
|
+
constructor(chartModel: ChartModel);
|
|
29
|
+
/**
|
|
30
|
+
* Returns a CandleHover object or undefined based on the provided BaseHover object.
|
|
31
|
+
* @param {BaseHover} hover - The BaseHover object containing the x and y coordinates.
|
|
32
|
+
* @returns {CandleHover | undefined} - The CandleHover object or undefined if mainSeriesCandle is falsy.
|
|
33
|
+
*/
|
|
34
|
+
getData(hover: BaseHover): CandleHover | undefined;
|
|
35
|
+
}
|
|
@@ -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
|
+
class l{constructor(t,e,r,s){this.visualCandle=t,this.price=e,this.priceFormatter=r,this.toY=s}get high(){return this.visualCandle.high}get low(){return this.visualCandle.low}get open(){return this.visualCandle.open}get close(){return this.visualCandle.close}get volume(){return this.visualCandle.candle.volume}get openY(){return this.toY(this.open)}get closeY(){return this.toY(this.close)}get highY(){return this.toY(this.high)}get lowY(){return this.toY(this.low)}get openFormatted(){return this.priceFormatter(this.open)}get closeFormatted(){return this.priceFormatter(this.close)}get highFormatted(){return this.priceFormatter(this.high)}get lowFormatted(){return this.priceFormatter(this.low)}get closestOHLCY(){return this.toY([this.close,this.open,this.high,this.low].sort((t,e)=>Math.abs(t-this.price)-Math.abs(e-this.price))[0])}}export class CandleHoverProducerPart{constructor(t){this.chartModel=t}getData(t){const{x:e,y:r}=t,h=this.chartModel.candleFromX(e).idx||0,i=this.chartModel.getVisualCandle(h),a=this.chartModel.priceFromY(r);return i&&new l(i,a,this.chartModel.pane.regularFormatter,this.chartModel.toY)}}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { HighLowProvider } from './scaling/auto-scale.model';
|
|
7
|
+
import VisualCandle from './visual-candle';
|
|
8
|
+
import { HighLowWithIndex } from './scale.model';
|
|
9
|
+
import { CandleSeriesModel } from './candle-series.model';
|
|
10
|
+
/**
|
|
11
|
+
* Candles high low provider.
|
|
12
|
+
* @param candleSeriesModel
|
|
13
|
+
* @doc-tags viewport,scaling
|
|
14
|
+
*/
|
|
15
|
+
export declare const createCandleSeriesHighLowProvider: (candleSeriesModel: CandleSeriesModel) => HighLowProvider;
|
|
16
|
+
/**
|
|
17
|
+
* Calculates the high and low values for given candles array.
|
|
18
|
+
* @param visualCandles
|
|
19
|
+
*/
|
|
20
|
+
export declare const calculateCandlesHighLow: (visualCandles: VisualCandle[]) => HighLowWithIndex;
|
|
@@ -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 createCandleSeriesHighLowProvider=i=>({isHighLowActive:()=>!0,calculateHighLow:t=>{const o=t?t.xStart:i.scaleModel.xStart,n=t?t.xEnd:i.scaleModel.xEnd,{dataIdxStart:a,dataIdxEnd:r}=i.calculateDataViewportIndexes(o,n),x=i.visualPoints.slice(a,r+1),h=calculateCandlesHighLow(x),c=()=>{var s,l;return(l=(s=i.visualPoints[a])===null||s===void 0?void 0:s.close)!==null&&l!==void 0?l:1};return Object.assign(Object.assign({},h),{low:i.view.toAxisUnits(h.low,c),high:i.view.toAxisUnits(h.high,c)})}}),calculateCandlesHighLow=i=>{const t={high:Number.MIN_SAFE_INTEGER,low:Number.MAX_SAFE_INTEGER,highIdx:0,lowIdx:0};for(let o=0;o<i.length;o++){const n=i[o];n.high>t.high&&(t.high=n.high,t.highIdx=o),n.low<t.low&&(t.low=n.low,t.lowIdx=o)}return t};
|