@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,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
|
+
import { Animation } from './animation';
|
|
7
|
+
import { AnimationConfig } from '../canvas-animation';
|
|
8
|
+
import { Unit, ViewportModel, Zoom } from '../../model/scaling/viewport.model';
|
|
9
|
+
export type easingFn = (normalizedTime: number) => number;
|
|
10
|
+
export interface ViewportMovementAnimationConfig extends AnimationConfig {
|
|
11
|
+
targetXStart: Unit;
|
|
12
|
+
targetXEnd: Unit;
|
|
13
|
+
targetYStart: Unit;
|
|
14
|
+
targetYEnd: Unit;
|
|
15
|
+
targetZoomX: Zoom;
|
|
16
|
+
targetZoomY: Zoom;
|
|
17
|
+
easingFn?: easingFn;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Animates the viewport X movement. Uses d3-ease library for easing functions.
|
|
21
|
+
* https://www.npmjs.com/package/d3-ease
|
|
22
|
+
* @doc-tags animation,scaling
|
|
23
|
+
*/
|
|
24
|
+
export declare class ViewportMovementAnimation extends Animation {
|
|
25
|
+
private viewportModel;
|
|
26
|
+
readonly animationConfig: ViewportMovementAnimationConfig;
|
|
27
|
+
readonly xStart: number;
|
|
28
|
+
readonly xEnd: number;
|
|
29
|
+
readonly yStart: number;
|
|
30
|
+
readonly yEnd: number;
|
|
31
|
+
readonly zoomX: number;
|
|
32
|
+
readonly zoomY: number;
|
|
33
|
+
readonly easingFn: easingFn;
|
|
34
|
+
readonly id: string;
|
|
35
|
+
constructor(viewportModel: ViewportModel, animationConfig: ViewportMovementAnimationConfig, onTickFunction?: () => void);
|
|
36
|
+
/**
|
|
37
|
+
* Updates the viewport model's properties based on the animation configuration and easing function. If an animation is in progress, the properties are updated based on the current progress of the animation. The updated properties include the start and end coordinates for the x and y axes, as well as the zoom level for both axes. The updated properties are then applied to the viewport model.
|
|
38
|
+
*/
|
|
39
|
+
tick(): void;
|
|
40
|
+
/**
|
|
41
|
+
* This method finishes the animation and applies the target viewport model configuration. It calls the `finishAnimation()` method of the parent class and then applies the target configuration to the `viewportModel` object. The target configuration includes the `xStart`, `xEnd`, `yStart`, `yEnd`, `zoomX`, `zoomY`, and `inverseY` properties.
|
|
42
|
+
*/
|
|
43
|
+
finishAnimation(): void;
|
|
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{Animation as e}from"./animation";import{easeExpOut as h}from"../../utils/math.utils";import{uuid as m}from"../../utils/uuid.utils";export class ViewportMovementAnimation extends e{constructor(t,i,o){var n;super(i,o),this.viewportModel=t,this.animationConfig=i,this.id=m(),this.xStart=t.xStart,this.xEnd=t.xEnd,this.yStart=t.yStart,this.yEnd=t.yEnd,this.zoomX=t.zoomX,this.zoomY=t.zoomY,this.easingFn=(n=i.easingFn)!==null&&n!==void 0?n:h}tick(){if(super.tick(),this.animationInProgress){const t=this.easingFn(this.getProgress()),i=this.xStart+(this.animationConfig.targetXStart-this.xStart)*t,o=this.xEnd+(this.animationConfig.targetXEnd-this.xEnd)*t,n=this.yStart+(this.animationConfig.targetYStart-this.yStart)*t,s=this.yEnd+(this.animationConfig.targetYEnd-this.yEnd)*t,a=this.zoomX+(this.animationConfig.targetZoomX-this.zoomX)*t,r=this.zoomY+(this.animationConfig.targetZoomY-this.zoomY)*t;this.viewportModel.apply({xStart:i,xEnd:o,yStart:n,yEnd:s,zoomX:a,zoomY:r,inverseY:this.viewportModel.inverseY})}}finishAnimation(){super.finishAnimation(),this.viewportModel.apply({xStart:this.animationConfig.targetXStart,xEnd:this.animationConfig.targetXEnd,yStart:this.animationConfig.targetYStart,yEnd:this.animationConfig.targetYEnd,zoomX:this.animationConfig.targetZoomX,zoomY:this.animationConfig.targetZoomY,inverseY:this.viewportModel.inverseY})}}
|
|
@@ -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
|
+
import { CanvasAnimation } from './canvas-animation';
|
|
7
|
+
import { ViewportModel, ViewportModelState } from '../model/scaling/viewport.model';
|
|
8
|
+
/**
|
|
9
|
+
* Starts the animation for chart viewport movement.
|
|
10
|
+
* @param canvasAnimation
|
|
11
|
+
* @param viewportModel
|
|
12
|
+
* @param state
|
|
13
|
+
* @doc-tags animation,viewport
|
|
14
|
+
*/
|
|
15
|
+
export declare const startViewportModelAnimation: (canvasAnimation: CanvasAnimation, viewportModel: ViewportModel, state: ViewportModelState) => 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
|
+
const a=30;export const startViewportModelAnimation=(n,o,t)=>{const r=n.startViewportMovementAnimation(o,{duration:30,targetXStart:t.xStart,targetXEnd:t.xEnd,targetYStart:t.yStart,targetYEnd:t.yEnd,targetZoomX:t.zoomX,targetZoomY:t.zoomY});o.currentAnimation=r};
|
|
@@ -0,0 +1,266 @@
|
|
|
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 { CanvasAnimation } from './animation/canvas-animation';
|
|
7
|
+
import { CanvasBoundsContainer } from './canvas/canvas-bounds-container';
|
|
8
|
+
import { ValidatedChartElements } from './canvas/chart-elements';
|
|
9
|
+
import { CursorHandler } from './canvas/cursor.handler';
|
|
10
|
+
import ChartContainer from './chart-container';
|
|
11
|
+
import { BarType, ChartColors, ChartConfigComponentsOffsets, FullChartConfig, GridComponentConfig, PartialChartConfig } from './chart.config';
|
|
12
|
+
import { ChartComponent } from './components/chart/chart.component';
|
|
13
|
+
import { ChartModel } from './components/chart/chart.model';
|
|
14
|
+
import { CrossToolComponent } from './components/cross_tool/cross-tool.component';
|
|
15
|
+
import { CrossToolType } from './components/cross_tool/cross-tool.model';
|
|
16
|
+
import { EventsComponent } from './components/events/events.component';
|
|
17
|
+
import { HighlightsComponent } from './components/highlights/highlights.component';
|
|
18
|
+
import { Highlight } from './components/highlights/highlights.model';
|
|
19
|
+
import { NavigationMapComponent } from './components/navigation_map/navigation-map.component';
|
|
20
|
+
import { ChartPanComponent } from './components/pan/chart-pan.component';
|
|
21
|
+
import { PaneManager } from './components/pane/pane-manager.component';
|
|
22
|
+
import { YExtentFormatters } from './components/pane/pane.component';
|
|
23
|
+
import { SnapshotComponent } from './components/snapshot/snapshot.component';
|
|
24
|
+
import { VolumesComponent } from './components/volumes/volumes.component';
|
|
25
|
+
import { WaterMarkComponent } from './components/watermark/water-mark.component';
|
|
26
|
+
import { XAxisComponent } from './components/x_axis/x-axis.component';
|
|
27
|
+
import { YAxisComponent } from './components/y_axis/y-axis.component';
|
|
28
|
+
import { DrawingManager } from './drawers/drawing-manager';
|
|
29
|
+
import EventBus from './events/event-bus';
|
|
30
|
+
import { ChartResizeHandler } from './inputhandlers/chart-resize.handler';
|
|
31
|
+
import { CrossEventProducerComponent } from './inputhandlers/cross-event-producer.component';
|
|
32
|
+
import { HoverProducerComponent } from './inputhandlers/hover-producer.component';
|
|
33
|
+
import { CanvasInputListenerComponent, Point } from './inputlisteners/canvas-input-listener.component';
|
|
34
|
+
import { CanvasModel } from './model/canvas.model';
|
|
35
|
+
import { ChartEntity } from './model/chart-base-element';
|
|
36
|
+
import { HitTestCanvasModel } from './model/hit-test-canvas.model';
|
|
37
|
+
import { ScaleModel } from './model/scale.model';
|
|
38
|
+
import { TimeZoneModel } from './model/time-zone.model';
|
|
39
|
+
import { DeepPartial } from './utils/object.utils';
|
|
40
|
+
export type FitType = 'studies' | 'orders' | 'positions';
|
|
41
|
+
export default class ChartBootstrap implements ChartContainer {
|
|
42
|
+
id: string;
|
|
43
|
+
bus: EventBus;
|
|
44
|
+
config: FullChartConfig;
|
|
45
|
+
parentElement: HTMLElement;
|
|
46
|
+
elements: ValidatedChartElements;
|
|
47
|
+
components: Array<any>;
|
|
48
|
+
chartComponents: Array<ChartEntity>;
|
|
49
|
+
xAxisComponent: XAxisComponent;
|
|
50
|
+
yAxisComponent: YAxisComponent;
|
|
51
|
+
watermarkComponent: WaterMarkComponent;
|
|
52
|
+
snapshotComponent: SnapshotComponent;
|
|
53
|
+
navigationMapComponent: NavigationMapComponent;
|
|
54
|
+
userInputListenerComponents: Array<ChartEntity>;
|
|
55
|
+
drawingManager: DrawingManager;
|
|
56
|
+
crossEventProducer: CrossEventProducerComponent;
|
|
57
|
+
cursorHandler: CursorHandler;
|
|
58
|
+
clearer: () => void;
|
|
59
|
+
scaleModel: ScaleModel;
|
|
60
|
+
timeZoneModel: TimeZoneModel;
|
|
61
|
+
chartModel: ChartModel;
|
|
62
|
+
backgroundCanvasModel: CanvasModel;
|
|
63
|
+
mainCanvasModel: CanvasModel;
|
|
64
|
+
dataSeriesCanvasModel: CanvasModel;
|
|
65
|
+
overSeriesCanvasModel: CanvasModel;
|
|
66
|
+
hitTestCanvasModel: HitTestCanvasModel;
|
|
67
|
+
canvasBoundsContainer: CanvasBoundsContainer;
|
|
68
|
+
canvasInputListener: CanvasInputListenerComponent;
|
|
69
|
+
volumesComponent: VolumesComponent;
|
|
70
|
+
highlightsComponent: HighlightsComponent;
|
|
71
|
+
chartComponent: ChartComponent;
|
|
72
|
+
eventsComponent: EventsComponent;
|
|
73
|
+
crossToolComponent: CrossToolComponent;
|
|
74
|
+
chartPanComponent: ChartPanComponent;
|
|
75
|
+
paneManager: PaneManager;
|
|
76
|
+
hoverProducer: HoverProducerComponent;
|
|
77
|
+
canvasModels: CanvasModel[];
|
|
78
|
+
chartResizeHandler: ChartResizeHandler;
|
|
79
|
+
canvasAnimation: CanvasAnimation;
|
|
80
|
+
constructor(element: HTMLElement, userConfig?: PartialChartConfig);
|
|
81
|
+
/**
|
|
82
|
+
* Creates a configuration object for overriding UTC time in a chart.
|
|
83
|
+
* @param {ChartModel} chartModel - The chart model object.
|
|
84
|
+
* @returns {Object} - The configuration object containing a pattern and a test function.
|
|
85
|
+
* The pattern is a string representing the date format to be used for the override.
|
|
86
|
+
* The test function checks if the pattern contains hours/minutes/seconds and if the current chart period is more than 1 day.
|
|
87
|
+
* If both conditions are met, the function returns true, indicating that the override should be applied.
|
|
88
|
+
* Note: The chartModel dependency should be removed and the period should be put in a global config somewhere.
|
|
89
|
+
*/
|
|
90
|
+
createUTCTimeOverrideConfig(chartModel: ChartModel): {
|
|
91
|
+
pattern: string;
|
|
92
|
+
test: (pattern: string) => boolean;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Merges a local configuration object with a global configuration object recursively.
|
|
96
|
+
* @template L - Type of the local configuration object.
|
|
97
|
+
* @param {L} local - The local configuration object to be merged.
|
|
98
|
+
* @param {Record<string, any>} global - The global configuration object to be merged.
|
|
99
|
+
* @returns {L} - The merged local configuration object.
|
|
100
|
+
*/
|
|
101
|
+
static mergeConfig<L extends Record<string, any>>(local: L, global: Record<string, any>): L;
|
|
102
|
+
/**
|
|
103
|
+
* Returns the FullChartConfig object.
|
|
104
|
+
*
|
|
105
|
+
* @returns {FullChartConfig} The FullChartConfig object.
|
|
106
|
+
*/
|
|
107
|
+
getConfig(): FullChartConfig;
|
|
108
|
+
/**
|
|
109
|
+
* Sets the right-to-left (RTL) configuration of the component.
|
|
110
|
+
*
|
|
111
|
+
* @param {boolean} rtl - A boolean value indicating whether the component should be displayed in RTL mode.
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
114
|
+
setRtl(rtl: boolean): void;
|
|
115
|
+
setChartType(type: BarType): void;
|
|
116
|
+
/**
|
|
117
|
+
* Disables user controls by deactivating all userInputListenerComponents and disabling hitTestCanvasModel.
|
|
118
|
+
* @returns {void}
|
|
119
|
+
*/
|
|
120
|
+
disableUserControls(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Enables user controls for the hit test canvas model and all the user input listener components.
|
|
123
|
+
* @returns {void}
|
|
124
|
+
*/
|
|
125
|
+
enableUserControls(): void;
|
|
126
|
+
/**
|
|
127
|
+
* Sets the configuration for the grid component of the chart.
|
|
128
|
+
* @param {GridComponentConfig} config - The configuration object for the grid component.
|
|
129
|
+
* @returns {void}
|
|
130
|
+
*/
|
|
131
|
+
setGridConfig(config: GridComponentConfig): void;
|
|
132
|
+
/**
|
|
133
|
+
* Sets the visibility of the grid component.
|
|
134
|
+
* @param {boolean} visible - A boolean value indicating whether the grid should be visible or not.
|
|
135
|
+
* @returns {void}
|
|
136
|
+
*/
|
|
137
|
+
setGridVisible(visible: boolean): void;
|
|
138
|
+
/**
|
|
139
|
+
* Sets the visibility of the vertical grid lines in the grid component.
|
|
140
|
+
* @param {boolean} showVertical - A boolean value indicating whether to show or hide the vertical grid lines.
|
|
141
|
+
* @returns {void}
|
|
142
|
+
*/
|
|
143
|
+
setGridVertical(showVertical: boolean): void;
|
|
144
|
+
/**
|
|
145
|
+
* Sets the visibility of the horizontal grid lines in the chart.
|
|
146
|
+
* @param {boolean} showHorizontal - A boolean value indicating whether to show or hide the horizontal grid lines.
|
|
147
|
+
* @returns {void}
|
|
148
|
+
*/
|
|
149
|
+
setGridHorizontal(showHorizontal: boolean): void;
|
|
150
|
+
/**
|
|
151
|
+
* Deactivates the chart by clearing the canvas listeners and disabling user controls.
|
|
152
|
+
* This method is a hack and should not be used unless an activation/deactivation cycle is implemented.
|
|
153
|
+
* It is implemented to prevent memory leaks in the chart when components are deactivated.
|
|
154
|
+
* @returns {void}
|
|
155
|
+
* @todo This method should be revised soon.
|
|
156
|
+
*/
|
|
157
|
+
deactivate(): void;
|
|
158
|
+
/**
|
|
159
|
+
* This method triggers the 'draw' event on the 'bus' object.
|
|
160
|
+
* @returns {void}
|
|
161
|
+
*/
|
|
162
|
+
redraw(): void;
|
|
163
|
+
/**
|
|
164
|
+
* Returns the offsets of the chart components from the chart configuration object.
|
|
165
|
+
*
|
|
166
|
+
* @returns {ChartConfigComponentsOffsets} The offsets of the chart components.
|
|
167
|
+
*/
|
|
168
|
+
getOffsets(): ChartConfigComponentsOffsets;
|
|
169
|
+
/**
|
|
170
|
+
* Sets the visibility of the volumes separately and updates the yAxis width.
|
|
171
|
+
* @param {boolean} separate - A boolean value indicating whether to show the volumes separately or not. Default value is false.
|
|
172
|
+
*/
|
|
173
|
+
showSeparateVolumes(separate?: boolean): void;
|
|
174
|
+
/**
|
|
175
|
+
* Sets the auto scale property of the scale model.
|
|
176
|
+
* @param {boolean} auto - A boolean value indicating whether the auto scale is enabled or not. Default value is true.
|
|
177
|
+
*/
|
|
178
|
+
setAutoScale(auto?: boolean): void;
|
|
179
|
+
/**
|
|
180
|
+
* Sets the visibility of the borders of the candles in the chart.
|
|
181
|
+
* @param {boolean} show - A boolean value indicating whether to show or hide the borders of the candles. Default value is true.
|
|
182
|
+
* @returns {void}
|
|
183
|
+
*/
|
|
184
|
+
setShowCandleBorders(show?: boolean): void;
|
|
185
|
+
/**
|
|
186
|
+
* Returns related Y-axis coordinate by provided value
|
|
187
|
+
* @param price
|
|
188
|
+
*/
|
|
189
|
+
valueToY(price: number): number;
|
|
190
|
+
/**
|
|
191
|
+
* Sets the visibility of the high-low component.
|
|
192
|
+
* @param {boolean} visible - Whether the high-low component should be visible or not. Default is true.
|
|
193
|
+
* @returns {void}
|
|
194
|
+
*/
|
|
195
|
+
setHighLowVisible(visible?: boolean): void;
|
|
196
|
+
/**
|
|
197
|
+
* Sets the visibility of the cross tool component.
|
|
198
|
+
* @param {string} type - The type of cross tool to be displayed. Default value is 'cross-and-labels'.
|
|
199
|
+
* @returns {void}
|
|
200
|
+
*/
|
|
201
|
+
setCrossToolVisible(type?: CrossToolType): void;
|
|
202
|
+
/**
|
|
203
|
+
* @deprecated use {@link highlightsComponent.setHighlightsVisible} instead
|
|
204
|
+
*/
|
|
205
|
+
setHighlightsVisible(visible?: boolean): void;
|
|
206
|
+
/**
|
|
207
|
+
* @deprecated use {@link highlightsComponent.setHighlights} instead
|
|
208
|
+
*/
|
|
209
|
+
setHighlightsData(data: Highlight[]): void;
|
|
210
|
+
/**
|
|
211
|
+
* Sets the colors of the chart.
|
|
212
|
+
*
|
|
213
|
+
* @param {DeepPartial<ChartColors>} colors - An object containing the colors to be set.
|
|
214
|
+
* @returns {void}
|
|
215
|
+
*/
|
|
216
|
+
setColors(colors: DeepPartial<ChartColors>): void;
|
|
217
|
+
/**
|
|
218
|
+
* Adds a mouse move event listener to a canvas element.
|
|
219
|
+
* @param {string} canvasElement - The ID of the canvas element to add the listener to.
|
|
220
|
+
* @param {function} handler - The function to be called when the mouse moves over the canvas element.
|
|
221
|
+
* @returns {function} - A function that removes the event listener when called.
|
|
222
|
+
*/
|
|
223
|
+
addMouseMoveOnChartElementHandler(canvasElement: string, handler: (point: Point) => void): () => void;
|
|
224
|
+
/**
|
|
225
|
+
* Adds a mouse enter event handler to a chart element.
|
|
226
|
+
*
|
|
227
|
+
* @param {string} canvasElement - The ID of the canvas element to attach the event handler to.
|
|
228
|
+
* @param {(mouseEnter: boolean) => void} handler - The function to be called when the mouse enters or leaves the element.
|
|
229
|
+
* @param {boolean} [skipWhileDragging=false] - Whether to skip the event while the user is dragging the chart.
|
|
230
|
+
* @returns {Function} - A function that can be called to unsubscribe from the event.
|
|
231
|
+
*/
|
|
232
|
+
addMouseEnterOnChartElementHandler(canvasElement: string, handler: (mouseEnter: boolean) => void, skipWhileDragging?: boolean): () => void;
|
|
233
|
+
/**
|
|
234
|
+
* Adds a click event listener to a chart element on the canvas.
|
|
235
|
+
* @param {string} canvasElement - The element on the canvas to add the click event listener to.
|
|
236
|
+
* @param {function} handler - The function to be called when the element is clicked. It takes a Point object as a parameter.
|
|
237
|
+
* @returns {function} - A function that can be called to unsubscribe the click event listener.
|
|
238
|
+
*/
|
|
239
|
+
addClickOnChartElementHandler(canvasElement: string, handler: (point: Point) => void): () => void;
|
|
240
|
+
/**
|
|
241
|
+
* Adds a drag event listener to the specified canvas element.
|
|
242
|
+
* @param {string} canvasElement - The ID of the canvas element to add the listener to.
|
|
243
|
+
* @param {(xPosition: number) => void} handler - The function to be called when a drag event occurs. It takes the x position of the drag event as a parameter.
|
|
244
|
+
* @returns {() => void} - A function that can be called to unsubscribe from the drag event listener.
|
|
245
|
+
*/
|
|
246
|
+
addDragEventsListener(canvasElement: string, handler: (xPosition: number) => void): () => void;
|
|
247
|
+
/**
|
|
248
|
+
* Contains tear-down logic for chart
|
|
249
|
+
* Use when you want to unmount the chart from the host app
|
|
250
|
+
*/
|
|
251
|
+
destroy(): void;
|
|
252
|
+
/**
|
|
253
|
+
* Registers a chart component and includes it in the the chart lifecycle
|
|
254
|
+
* @param initComponent - a function for component init
|
|
255
|
+
* @param onComponentInit - will be called after component init
|
|
256
|
+
*/
|
|
257
|
+
registerComponent<C extends ChartEntity>(initComponent: (chartInstance: ChartBootstrap) => C, onComponentInit?: (component: C) => void): void;
|
|
258
|
+
/**
|
|
259
|
+
* Registers number formatters for pane
|
|
260
|
+
* @param uuid - pane's id
|
|
261
|
+
* @param formatters - object, that contains 3 fileds: 'regular', 'percent', 'logarithmic'.
|
|
262
|
+
* Each filed must have it's own formatter.
|
|
263
|
+
* If 'percent' and 'logarithmic' formatters did not provided, 'regular' will be applied.
|
|
264
|
+
*/
|
|
265
|
+
registerPaneFormatters(uuid: string, formatters: YExtentFormatters): void;
|
|
266
|
+
}
|
|
@@ -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{merge as Y}from"rxjs";import{CanvasAnimation as N}from"./animation/canvas-animation";import{CHART_UUID as W,CanvasBoundsContainer as Z,CanvasElement as x}from"./canvas/canvas-bounds-container";import{CursorHandler as X}from"./canvas/cursor.handler";import{createDefaultLayoutTemplate as j,extractElements as q}from"./canvas/layout-creator";import{mergeWithDefaultConfig as J}from"./chart.config";import{ChartBaseModel as K}from"./components/chart/chart-base.model";import{ChartComponent as Q}from"./components/chart/chart.component";import{ChartModel as $}from"./components/chart/chart.model";import{CrossToolComponent as tt}from"./components/cross_tool/cross-tool.component";import{EventsComponent as et}from"./components/events/events.component";import{GridComponent as st}from"./components/grid/grid.component";import{HighLowComponent as nt}from"./components/high_low/high-low.component";import{HighlightsComponent as ot}from"./components/highlights/highlights.component";import{NavigationMapComponent as it}from"./components/navigation_map/navigation-map.component";import{ChartPanComponent as rt}from"./components/pan/chart-pan.component";import{PaneManager as at}from"./components/pane/pane-manager.component";import{SnapshotComponent as ht}from"./components/snapshot/snapshot.component";import{VolumesComponent as ct}from"./components/volumes/volumes.component";import{WaterMarkComponent as mt}from"./components/watermark/water-mark.component";import{XAxisComponent as dt}from"./components/x_axis/x-axis.component";import{YAxisComponent as pt}from"./components/y_axis/y-axis.component";import{ClearCanvasDrawer as S}from"./drawers/clear-canvas.drawer";import{DrawingManager as lt}from"./drawers/drawing-manager";import Ct from"./events/event-bus";import{EVENT_DRAW as ut}from"./events/events";import{CandleTapHandler as vt}from"./inputhandlers/candle-tap.handler";import{ChartResizeHandler as gt}from"./inputhandlers/chart-resize.handler";import{CrossEventProducerComponent as ft}from"./inputhandlers/cross-event-producer.component";import{HoverProducerComponent as Mt}from"./inputhandlers/hover-producer.component";import{CanvasInputListenerComponent as wt}from"./inputlisteners/canvas-input-listener.component";import{createCanvasModel as f,createMainCanvasModel as bt}from"./model/canvas.model";import{HitTestCanvasModel as Tt}from"./model/hit-test-canvas.model";import{ScaleModel as Et}from"./model/scale.model";import{TimeZoneModel as Ht}from"./model/time-zone.model";import{clearerSafe as At}from"./utils/function.utils";import{merge as St}from"./utils/merge.utils";export default class B{constructor(t,n={}){var s,h;this.components=[],this.chartComponents=[],this.userInputListenerComponents=[],this.canvasModels=[],this.parentElement=t;const e=n;J(e),this.config=e;const M=j(e);t.innerHTML="",t.appendChild(M.content),this.id=(s=t.getAttribute("data-id"))!==null&&s!==void 0?s:"",e.fixedSize&&(t.style.width=e.fixedSize.width+"px",t.style.height=e.fixedSize.height+"px");const C=new Ht(e);this.timeZoneModel=C;const w=this.timeZoneModel.getFormatterFactory(),r=q(t);this.elements=r;const i=new Ct;this.bus=i;const u=new gt(t,(h=r.chartResizer)!==null&&h!==void 0?h:t,i,this.canvasModels,e);this.chartResizeHandler=u,u.subscribeResize(),this.components.push(u.unsubscribeAnimationUpdate.bind(u));const o=new lt(i,u);this.drawingManager=o;const p=bt(i,r.mainCanvas,r.chartResizer,this.config.components.chart.type,this.config,o,this.canvasModels);this.mainCanvasModel=p;const E=f(i,r.overDataSeriesCanvas,e,o,this.canvasModels,r.chartResizer);this.overSeriesCanvasModel=E;const I=new S(E);o.addDrawer(I,"OVER_SERIES_CLEAR"),this.dataSeriesCanvasModel=f(i,r.dataSeriesCanvas,e,o,this.canvasModels,r.chartResizer);const D=new S(this.dataSeriesCanvasModel);o.addDrawer(D,"SERIES_CLEAR");const F=f(i,r.yAxisLabelsCanvas,e,o,this.canvasModels,r.chartResizer),a=new Z(e,i,p,w,u);this.canvasBoundsContainer=a;const b=r.mainCanvas.parentElement;if(b===null)throw new Error("Couldn't get main canvas parent");const c=new wt(i,b);this.canvasInputListener=c,this.chartComponents.push(this.canvasInputListener);const g=new Tt(i,r.hitTestCanvas,c,a,o,e,this.canvasModels,r.chartResizer);this.hitTestCanvasModel=g;const P=new S(g);o.addDrawer(P,"HIT_TEST_CLEAR");const H=new N(i);this.canvasAnimation=H;const m=new Et(e,()=>a.getBounds(x.CHART),H);this.scaleModel=m;const T=f(i,r.backgroundCanvas,e,o,this.canvasModels,r.chartResizer,{willReadFrequently:!0});this.backgroundCanvasModel=T,this.cursorHandler=new X(r.canvasArea,c,a,g),this.chartComponents.push(this.cursorHandler),this.crossEventProducer=new ft(c,a),this.chartComponents.push(this.crossEventProducer);const L=new K("candle"),v=new rt(i,m,a,e,H,c,b,L);this.chartPanComponent=v,this.chartComponents.push(v),this.userInputListenerComponents.push(v.chartAreaPanHandler);const l=new at(L,this.userInputListenerComponents,i,m,a,e,H,c,o,this.dataSeriesCanvasModel,this.cursorHandler,this.crossEventProducer,v,p);this.paneManager=l,this.chartComponents.push(l),this.chartModel=new $(L,l,i,this.dataSeriesCanvasModel,e,m,w,b,a,u);const A=new Q(this.chartModel,this.dataSeriesCanvasModel,e,m,a,o,g,c,T,v,l,this.cursorHandler);this.chartComponents.push(A),this.chartComponent=A;const d=this.chartComponent.chartModel;this.chartModel=d,this.canvasBoundsContainer.setMainCandleSeries(this.chartModel.mainCandleSeries),g.addSubscriber(l.hitTestController),this.xAxisComponent=new dt(i,e,p,A,m,a,c,u,this.drawingManager,C,v,this.cursorHandler,T),this.chartComponents.push(this.xAxisComponent),this.userInputListenerComponents.push(this.xAxisComponent.xAxisScaleHandler);const z=new S(p);o.addDrawer(z,"MAIN_CLEAR");const _=new vt(b,d,c,e);this.chartComponents.push(_),this.watermarkComponent=new mt(l,d,i,e,a,E,o),this.chartComponents.push(this.watermarkComponent);const U=f(i,r.crossToolCanvas,e,o,this.canvasModels,r.chartResizer);this.highlightsComponent=new ot(i,e,d,p,a,o),this.chartComponents.push(this.highlightsComponent),e.useUTCTimeOverride&&e.dateFormatter&&!e.dateFormatter.utcTimeOverride&&(e.dateFormatter.utcTimeOverride=this.createUTCTimeOverrideConfig(d)),this.navigationMapComponent=new it(i,d,p,e,c,a,o,w,v,this.cursorHandler),this.chartComponents.push(this.navigationMapComponent),this.userInputListenerComponents.push(this.navigationMapComponent.navigationMapMoveHandler);const O=new nt(e,this.dataSeriesCanvasModel,d,a,o);this.chartComponents.push(O),this.yAxisComponent=new pt(i,e,p,F,T,d,m,this.canvasInputListener,a,this.drawingManager,v,l,this.cursorHandler),this.chartComponents.push(this.yAxisComponent),this.userInputListenerComponents.push(this.yAxisComponent.yAxisScaleHandler),this.volumesComponent=new ct(this.dataSeriesCanvasModel,A,m,a,o,e,l,this.yAxisComponent),this.chartComponents.push(this.volumesComponent);const V=new st(p,m,e,"GRID",o,()=>this.canvasBoundsContainer.getBounds(x.ALL_PANES),()=>this.canvasBoundsContainer.getBounds(x.PANE_UUID(W)),()=>this.xAxisComponent.xAxisLabelsGenerator.labels,()=>this.yAxisComponent.yAxisModel.yAxisBaseLabelsModel.labels,()=>this.chartModel.toY(this.chartModel.getBaseLine()),()=>e.components.grid.visible);this.chartComponents.push(V),this.hoverProducer=new Mt(this.crossEventProducer,m,e,d,c,this.canvasBoundsContainer,this.paneManager,C,w),this.chartComponents.push(this.hoverProducer),this.crossToolComponent=new tt(e,U,a,o,l,this.crossEventProducer,this.hoverProducer),this.chartComponents.push(this.crossToolComponent);const k=f(i,r.snapshotCanvas,e,o,this.canvasModels,r.chartResizer),R=new ht(this.elements,k);this.snapshotComponent=R,this.chartComponents.push(R);const y=new et(e,E,g,d,a,o,w,this.cursorHandler,T);this.eventsComponent=y,this.chartComponents.push(y),this.chartComponents.forEach(G=>G.activate()),this.enableUserControls(),o.reorderDrawers(e.drawingOrder),this.clearer=At(this.components)}createUTCTimeOverrideConfig(t){const n=new RegExp("HH|H|mm|m|s|ss|sss|SSS");return{pattern:"MM/dd/YY",test:s=>n.test(s)&&(t.getPeriod()||0)>=86400}}static mergeConfig(t,n){for(const s in n)s in t?typeof t[s]=="object"&&B.mergeConfig(t[s],n[s]):t[s]=n[s];return t}getConfig(){return this.config}setRtl(t){this.config.rtl=t,this.bus.fire(ut)}setChartType(t){this.chartComponent.setChartType(t)}disableUserControls(){this.userInputListenerComponents.forEach(t=>t.deactivate()),this.hitTestCanvasModel.disableUserControls()}enableUserControls(){this.userInputListenerComponents.forEach(t=>t.activate()),this.hitTestCanvasModel.enableUserControls()}setGridConfig(t){var n,s,h,e,M;const C=this.config.components.grid;C.visible=(n=t.visible)!==null&&n!==void 0?n:!1,C.dash=(s=t.dash)!==null&&s!==void 0?s:[0,0],C.width=(h=t.width)!==null&&h!==void 0?h:1,C.color=(e=t.color)!==null&&e!==void 0?e:"#FFFFFF",this.config.colors.chartAreaTheme.gridColor=(M=t.color)!==null&&M!==void 0?M:"#FFFFFF",this.redraw()}setGridVisible(t){this.config.components&&this.config.components.grid&&(this.config.components.grid.visible=t,this.redraw())}setGridVertical(t){this.config.components.grid.vertical=t,this.redraw()}setGridHorizontal(t){this.config.components.grid.horizontal=t,this.redraw()}deactivate(){this.clearer(),this.disableUserControls(),this.chartComponents.forEach(t=>t.deactivate())}redraw(){this.bus.fireDraw()}getOffsets(){return this.config.components&&this.config.components.offsets}showSeparateVolumes(t=!1){this.volumesComponent&&(this.volumesComponent.setShowVolumesSeparatly(t),this.canvasBoundsContainer.updateYAxisWidths())}setAutoScale(t=!0){this.scaleModel.autoScale(t)}setShowCandleBorders(t=!0){this.config.components&&this.config.components.chart&&(this.config.components.chart.showCandlesBorder=t,this.redraw())}valueToY(t){return this.chartModel.toY(t)}setHighLowVisible(t=!0){this.config.components&&this.config.components.highLow&&(this.config.components.highLow.visible=t,this.redraw())}setCrossToolVisible(t="cross-and-labels"){this.config.components&&this.config.components.crossTool&&(this.config.components.crossTool.type=t,this.redraw())}setHighlightsVisible(t=!0){var n;!((n=this.config.components)===null||n===void 0)&&n.highlights&&(this.config.components.highlights.visible=t,this.redraw())}setHighlightsData(t){this.highlightsComponent.setHighlights(t)}setColors(t){St(this.config.colors,t,{addIfMissing:!0,overrideExisting:!0}),this.redraw()}addMouseMoveOnChartElementHandler(t,n){const s=this.canvasBoundsContainer.getBoundsHitTest(t),h=this.canvasInputListener.observeMouseMove(s).subscribe(n);return()=>h.unsubscribe()}addMouseEnterOnChartElementHandler(t,n,s=!1){const h=this.canvasBoundsContainer.getBoundsHitTest(t),e=this.canvasInputListener.observeMouseEnter(h,s).subscribe(n);return()=>e.unsubscribe()}addClickOnChartElementHandler(t,n){const s=this.canvasBoundsContainer.getBoundsHitTest(t),h=this.canvasInputListener.observeClick(s).subscribe(n);return()=>h.unsubscribe()}addDragEventsListener(t,n){const s=this.canvasBoundsContainer.getBoundsHitTest(t),h=Y(this.canvasInputListener.observeYDrag(s),this.canvasInputListener.observeXDrag(s)).subscribe(n);return()=>h.unsubscribe()}destroy(){this.bus.setMuted(!0),this.chartComponents.forEach(t=>t.disable()),this.parentElement.childNodes.forEach(t=>t.remove()),this.parentElement.style.width="",this.parentElement.style.height=""}registerComponent(t,n){const s=t(this);this.components.push(s),n&&n(s),s.activate()}registerPaneFormatters(t,n){var s;(s=this.paneManager.paneComponents[t])===null||s===void 0||s.setPaneValueFormatters(n)}}
|