@devexperts/dxcharts-lite 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/chart/animation/canvas-animation.d.ts +1 -1
- package/dist/chart/animation/canvas-animation.js +135 -2
- package/dist/chart/animation/types/animation.d.ts +1 -1
- package/dist/chart/animation/types/animation.js +44 -2
- package/dist/chart/animation/types/color-alpha-animation.d.ts +2 -2
- package/dist/chart/animation/types/color-alpha-animation.js +61 -2
- package/dist/chart/animation/types/color-transition-animation.d.ts +2 -2
- package/dist/chart/animation/types/color-transition-animation.js +87 -2
- package/dist/chart/animation/types/viewport-movement-animation.d.ts +1 -1
- package/dist/chart/animation/types/viewport-movement-animation.js +64 -2
- package/dist/chart/animation/viewport-model-animation.d.ts +1 -1
- package/dist/chart/animation/viewport-model-animation.js +21 -2
- package/dist/chart/bootstrap.d.ts +52 -49
- package/dist/chart/bootstrap.js +450 -2
- package/dist/chart/canvas/canvas-bounds-container.d.ts +1 -6
- package/dist/chart/canvas/canvas-bounds-container.js +816 -2
- package/dist/chart/canvas/canvas-chart-html.d.ts +1 -1
- package/dist/chart/canvas/canvas-chart-html.js +17 -19
- package/dist/chart/canvas/chart-elements.d.ts +2 -5
- package/dist/chart/canvas/chart-elements.js +23 -2
- package/dist/chart/canvas/cursor.handler.d.ts +1 -1
- package/dist/chart/canvas/cursor.handler.js +123 -2
- package/dist/chart/canvas/layout-creator.d.ts +1 -1
- package/dist/chart/canvas/layout-creator.js +35 -2
- package/dist/chart/canvas/y-axis-bounds.container.d.ts +3 -3
- package/dist/chart/canvas/y-axis-bounds.container.js +68 -2
- package/dist/chart/chart-container.d.ts +1 -1
- package/dist/chart/chart-container.js +2 -2
- package/dist/chart/chart.config.d.ts +5 -6
- package/dist/chart/chart.config.js +646 -2
- package/dist/chart/chart.d.ts +62 -0
- package/dist/chart/chart.js +106 -0
- package/dist/chart/components/chart/basic-scale.d.ts +3 -3
- package/dist/chart/components/chart/basic-scale.js +32 -2
- package/dist/chart/components/chart/candle-transformer.functions.d.ts +1 -1
- package/dist/chart/components/chart/candle-transformer.functions.js +16 -2
- package/dist/chart/components/chart/candle-width-calculator.functions.d.ts +1 -1
- package/dist/chart/components/chart/candle-width-calculator.functions.js +3 -2
- package/dist/chart/components/chart/candle.functions.d.ts +1 -1
- package/dist/chart/components/chart/candle.functions.js +45 -2
- package/dist/chart/components/chart/chart-area-pan.handler.d.ts +4 -4
- package/dist/chart/components/chart/chart-area-pan.handler.js +198 -2
- package/dist/chart/components/chart/chart-base.model.d.ts +1 -1
- package/dist/chart/components/chart/chart-base.model.js +67 -2
- package/dist/chart/components/chart/chart.component.d.ts +8 -4
- package/dist/chart/components/chart/chart.component.js +409 -2
- package/dist/chart/components/chart/chart.model.d.ts +5 -12
- package/dist/chart/components/chart/chart.model.js +955 -2
- package/dist/chart/components/chart/data-series.high-low-provider.d.ts +1 -1
- package/dist/chart/components/chart/data-series.high-low-provider.js +35 -2
- package/dist/chart/components/chart/fake-candles.d.ts +1 -1
- package/dist/chart/components/chart/fake-candles.js +98 -2
- package/dist/chart/components/chart/price.formatter.d.ts +1 -1
- package/dist/chart/components/chart/price.formatter.js +36 -2
- package/dist/chart/components/chart/secondary-chart-colors-pool.d.ts +1 -1
- package/dist/chart/components/chart/secondary-chart-colors-pool.js +69 -2
- package/dist/chart/components/cross_tool/cross-tool.component.d.ts +1 -1
- package/dist/chart/components/cross_tool/cross-tool.component.js +86 -2
- package/dist/chart/components/cross_tool/cross-tool.drawer.d.ts +1 -1
- package/dist/chart/components/cross_tool/cross-tool.drawer.js +33 -2
- package/dist/chart/components/cross_tool/cross-tool.model.d.ts +1 -1
- package/dist/chart/components/cross_tool/cross-tool.model.js +108 -2
- package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.d.ts +1 -1
- package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.js +138 -2
- package/dist/chart/components/cross_tool/types/none.drawer.d.ts +1 -1
- package/dist/chart/components/cross_tool/types/none.drawer.js +4 -2
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.d.ts +1 -1
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.js +29 -2
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.d.ts +1 -1
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.js +25 -2
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.d.ts +1 -1
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.js +54 -2
- package/dist/chart/components/dynamic-objects/dynamic-objects.component.d.ts +13 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.component.js +20 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.drawer.d.ts +18 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.drawer.js +23 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.model.d.ts +63 -0
- package/dist/chart/components/dynamic-objects/dynamic-objects.model.js +136 -0
- package/dist/chart/components/events/events-hit-test.drawer.d.ts +1 -1
- package/dist/chart/components/events/events-hit-test.drawer.js +64 -2
- package/dist/chart/components/events/events.component.d.ts +1 -1
- package/dist/chart/components/events/events.component.js +62 -2
- package/dist/chart/components/events/events.drawer.d.ts +1 -1
- package/dist/chart/components/events/events.drawer.js +196 -2
- package/dist/chart/components/events/events.model.d.ts +1 -1
- package/dist/chart/components/events/events.model.js +70 -2
- package/dist/chart/components/grid/grid.component.d.ts +3 -3
- package/dist/chart/components/grid/grid.component.js +32 -2
- package/dist/chart/components/grid/grid.drawer.d.ts +5 -4
- package/dist/chart/components/grid/grid.drawer.js +107 -2
- package/dist/chart/components/high_low/high-low.component.d.ts +1 -1
- package/dist/chart/components/high_low/high-low.component.js +13 -2
- package/dist/chart/components/high_low/high-low.drawer.d.ts +1 -1
- package/dist/chart/components/high_low/high-low.drawer.js +127 -2
- package/dist/chart/components/highlights/highlights.component.d.ts +1 -1
- package/dist/chart/components/highlights/highlights.component.js +47 -2
- package/dist/chart/components/highlights/highlights.drawer.d.ts +1 -1
- package/dist/chart/components/highlights/highlights.drawer.js +155 -2
- package/dist/chart/components/highlights/highlights.model.d.ts +1 -1
- package/dist/chart/components/highlights/highlights.model.js +76 -2
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.d.ts +2 -2
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.js +200 -2
- package/dist/chart/components/navigation_map/navigation-map-move.handler.d.ts +3 -3
- package/dist/chart/components/navigation_map/navigation-map-move.handler.js +109 -2
- package/dist/chart/components/navigation_map/navigation-map.component.d.ts +1 -1
- package/dist/chart/components/navigation_map/navigation-map.component.js +113 -2
- package/dist/chart/components/navigation_map/navigation-map.drawer.d.ts +1 -1
- package/dist/chart/components/navigation_map/navigation-map.drawer.js +245 -2
- package/dist/chart/components/navigation_map/navigation-map.model.d.ts +1 -1
- package/dist/chart/components/navigation_map/navigation-map.model.js +34 -3
- package/dist/chart/components/pan/chart-pan.component.d.ts +3 -3
- package/dist/chart/components/pan/chart-pan.component.js +52 -2
- package/dist/chart/components/pane/extent/y-extent-component.d.ts +13 -19
- package/dist/chart/components/pane/extent/y-extent-component.js +121 -2
- package/dist/chart/components/pane/pane-hit-test.controller.d.ts +1 -1
- package/dist/chart/components/pane/pane-hit-test.controller.js +56 -2
- package/dist/chart/components/pane/pane-manager.component.d.ts +11 -6
- package/dist/chart/components/pane/pane-manager.component.js +149 -2
- package/dist/chart/components/pane/pane.component.d.ts +18 -34
- package/dist/chart/components/pane/pane.component.js +279 -2
- package/dist/chart/components/resizer/bar-resizer.component.d.ts +1 -1
- package/dist/chart/components/resizer/bar-resizer.component.js +140 -2
- package/dist/chart/components/resizer/bar-resizer.drawer.d.ts +1 -1
- package/dist/chart/components/resizer/bar-resizer.drawer.js +47 -2
- package/dist/chart/components/snapshot/snapshot.component.d.ts +1 -1
- package/dist/chart/components/snapshot/snapshot.component.js +49 -2
- package/dist/chart/components/volumes/separate-volumes.component.d.ts +7 -11
- package/dist/chart/components/volumes/separate-volumes.component.js +64 -2
- package/dist/chart/components/volumes/volume-color-resolvers.functions.d.ts +1 -1
- package/dist/chart/components/volumes/volume-color-resolvers.functions.js +19 -2
- package/dist/chart/components/volumes/volumes.component.d.ts +9 -9
- package/dist/chart/components/volumes/volumes.component.js +95 -2
- package/dist/chart/components/volumes/volumes.drawer.d.ts +6 -13
- package/dist/chart/components/volumes/volumes.drawer.js +141 -2
- package/dist/chart/components/volumes/volumes.formatter.d.ts +1 -1
- package/dist/chart/components/volumes/volumes.formatter.js +32 -2
- package/dist/chart/components/volumes/volumes.model.d.ts +3 -3
- package/dist/chart/components/volumes/volumes.model.js +44 -2
- package/dist/chart/components/watermark/water-mark.component.d.ts +1 -1
- package/dist/chart/components/watermark/water-mark.component.js +104 -2
- package/dist/chart/components/watermark/water-mark.drawer.d.ts +1 -1
- package/dist/chart/components/watermark/water-mark.drawer.js +188 -2
- package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.d.ts +1 -1
- package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.js +28 -2
- package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.d.ts +1 -1
- package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.js +188 -2
- package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.d.ts +1 -1
- package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.js +77 -2
- package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.d.ts +1 -1
- package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.js +80 -2
- package/dist/chart/components/x_axis/time/parser/time-formats.model.d.ts +1 -1
- package/dist/chart/components/x_axis/time/parser/time-formats.model.js +15 -2
- package/dist/chart/components/x_axis/time/x-axis-weights.functions.d.ts +2 -2
- package/dist/chart/components/x_axis/time/x-axis-weights.functions.js +144 -2
- package/dist/chart/components/x_axis/time/x-axis-weights.generator.d.ts +1 -1
- package/dist/chart/components/x_axis/time/x-axis-weights.generator.js +74 -2
- package/dist/chart/components/x_axis/x-axis-draw.functions.d.ts +1 -1
- package/dist/chart/components/x_axis/x-axis-draw.functions.js +50 -2
- package/dist/chart/components/x_axis/x-axis-labels.drawer.d.ts +1 -1
- package/dist/chart/components/x_axis/x-axis-labels.drawer.js +71 -2
- package/dist/chart/components/x_axis/x-axis-labels.generator.d.ts +3 -3
- package/dist/chart/components/x_axis/x-axis-labels.generator.js +333 -2
- package/dist/chart/components/x_axis/x-axis-labels.model.d.ts +1 -1
- package/dist/chart/components/x_axis/x-axis-labels.model.js +36 -2
- package/dist/chart/components/x_axis/x-axis-scale.handler.d.ts +3 -3
- package/dist/chart/components/x_axis/x-axis-scale.handler.js +61 -2
- package/dist/chart/components/x_axis/x-axis-time-labels.drawer.d.ts +1 -1
- package/dist/chart/components/x_axis/x-axis-time-labels.drawer.js +83 -2
- package/dist/chart/components/x_axis/x-axis.component.d.ts +3 -3
- package/dist/chart/components/x_axis/x-axis.component.js +120 -2
- package/dist/chart/components/y_axis/label-color.functions.d.ts +1 -1
- package/dist/chart/components/y_axis/label-color.functions.js +54 -2
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.d.ts +5 -5
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.js +34 -2
- package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.d.ts +4 -4
- package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.js +68 -2
- package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.d.ts +1 -1
- package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.js +57 -2
- package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.d.ts +1 -1
- package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.js +96 -2
- package/dist/chart/components/y_axis/price_labels/price-label.drawer.d.ts +3 -3
- package/dist/chart/components/y_axis/price_labels/price-label.drawer.js +120 -2
- package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.d.ts +10 -9
- package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.js +202 -2
- package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.d.ts +7 -8
- package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.js +59 -2
- package/dist/chart/components/y_axis/y-axis-base-labels.model.d.ts +7 -5
- package/dist/chart/components/y_axis/y-axis-base-labels.model.js +48 -2
- package/dist/chart/components/y_axis/y-axis-labels.drawer.d.ts +5 -5
- package/dist/chart/components/y_axis/y-axis-labels.drawer.js +162 -2
- package/dist/chart/components/y_axis/y-axis-scale.handler.d.ts +3 -3
- package/dist/chart/components/y_axis/y-axis-scale.handler.js +73 -2
- package/dist/chart/components/y_axis/y-axis.component.d.ts +33 -42
- package/dist/chart/components/y_axis/y-axis.component.js +221 -2
- package/dist/chart/components/y_axis/y-axis.drawer.d.ts +10 -13
- package/dist/chart/components/y_axis/y-axis.drawer.js +97 -2
- package/dist/chart/components/y_axis/y-axis.model.d.ts +10 -18
- package/dist/chart/components/y_axis/y-axis.model.js +34 -2
- package/dist/chart/drawers/chart-background.drawer.d.ts +1 -1
- package/dist/chart/drawers/chart-background.drawer.js +70 -2
- package/dist/chart/drawers/chart-type-drawers/area.drawer.d.ts +1 -1
- package/dist/chart/drawers/chart-type-drawers/area.drawer.js +70 -2
- package/dist/chart/drawers/chart-type-drawers/bar.drawer.d.ts +1 -1
- package/dist/chart/drawers/chart-type-drawers/bar.drawer.js +58 -2
- package/dist/chart/drawers/chart-type-drawers/baseline.drawer.d.ts +1 -1
- package/dist/chart/drawers/chart-type-drawers/baseline.drawer.js +85 -2
- package/dist/chart/drawers/chart-type-drawers/candle.drawer.d.ts +1 -1
- package/dist/chart/drawers/chart-type-drawers/candle.drawer.js +163 -2
- package/dist/chart/drawers/chart-type-drawers/histogram.drawer.d.ts +1 -1
- package/dist/chart/drawers/chart-type-drawers/histogram.drawer.js +58 -2
- package/dist/chart/drawers/chart-type-drawers/line.drawer.d.ts +1 -1
- package/dist/chart/drawers/chart-type-drawers/line.drawer.js +39 -2
- package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.d.ts +1 -1
- package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.js +20 -2
- package/dist/chart/drawers/clear-canvas.drawer.d.ts +1 -1
- package/dist/chart/drawers/clear-canvas.drawer.js +15 -2
- package/dist/chart/drawers/composite.drawer.d.ts +1 -1
- package/dist/chart/drawers/composite.drawer.js +68 -2
- package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.js +51 -2
- package/dist/chart/drawers/data-series-drawers/color-candle.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/color-candle.drawer.js +36 -2
- package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.js +17 -2
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.js +107 -2
- package/dist/chart/drawers/data-series-drawers/histogram.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/histogram.drawer.js +24 -2
- package/dist/chart/drawers/data-series-drawers/linear.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/linear.drawer.js +20 -2
- package/dist/chart/drawers/data-series-drawers/points.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/points.drawer.js +20 -2
- package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.js +8 -2
- package/dist/chart/drawers/data-series-drawers/text.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/text.drawer.js +26 -2
- package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.js +36 -2
- package/dist/chart/drawers/data-series-drawers/triangle.drawer.d.ts +1 -1
- package/dist/chart/drawers/data-series-drawers/triangle.drawer.js +23 -2
- package/dist/chart/drawers/data-series.drawer.d.ts +6 -8
- package/dist/chart/drawers/data-series.drawer.js +57 -2
- package/dist/chart/drawers/drawing-manager.d.ts +2 -2
- package/dist/chart/drawers/drawing-manager.js +178 -2
- package/dist/chart/drawers/ht-data-series.drawer.d.ts +1 -1
- package/dist/chart/drawers/ht-data-series.drawer.js +38 -2
- package/dist/chart/events/event-bus.d.ts +1 -1
- package/dist/chart/events/event-bus.js +74 -2
- package/dist/chart/events/events.d.ts +1 -1
- package/dist/chart/events/events.js +4 -2
- package/dist/chart/inputhandlers/candle-tap.handler.d.ts +1 -1
- package/dist/chart/inputhandlers/candle-tap.handler.js +47 -2
- package/dist/chart/inputhandlers/chart-resize.handler.d.ts +1 -1
- package/dist/chart/inputhandlers/chart-resize.handler.js +99 -2
- package/dist/chart/inputhandlers/cross-event-producer.component.d.ts +1 -1
- package/dist/chart/inputhandlers/cross-event-producer.component.js +68 -2
- package/dist/chart/inputhandlers/hover-producer.component.d.ts +3 -3
- package/dist/chart/inputhandlers/hover-producer.component.js +229 -2
- package/dist/chart/inputhandlers/main-canvas-touch.handler.d.ts +3 -3
- package/dist/chart/inputhandlers/main-canvas-touch.handler.js +81 -2
- package/dist/chart/inputlisteners/canvas-input-listener.component.d.ts +1 -1
- package/dist/chart/inputlisteners/canvas-input-listener.component.js +630 -2
- package/dist/chart/model/baseline.model.d.ts +1 -1
- package/dist/chart/model/baseline.model.js +89 -2
- package/dist/chart/model/bounds.model.d.ts +1 -1
- package/dist/chart/model/bounds.model.js +2 -2
- package/dist/chart/model/candle-hover.d.ts +1 -1
- package/dist/chart/model/candle-hover.js +71 -2
- package/dist/chart/model/candle-series-high-low.provider.d.ts +1 -1
- package/dist/chart/model/candle-series-high-low.provider.js +46 -2
- package/dist/chart/model/candle-series.model.d.ts +4 -4
- package/dist/chart/model/candle-series.model.js +246 -2
- package/dist/chart/model/candle.model.d.ts +1 -1
- package/dist/chart/model/candle.model.js +70 -2
- package/dist/chart/model/canvas.model.d.ts +1 -1
- package/dist/chart/model/canvas.model.js +229 -2
- package/dist/chart/model/chart-base-element.d.ts +1 -1
- package/dist/chart/model/chart-base-element.js +130 -2
- package/dist/chart/model/compare-series-hover.d.ts +1 -1
- package/dist/chart/model/compare-series-hover.js +26 -2
- package/dist/chart/model/data-series-view.d.ts +6 -6
- package/dist/chart/model/data-series-view.js +112 -2
- package/dist/chart/model/data-series.config.d.ts +1 -1
- package/dist/chart/model/data-series.config.js +15 -2
- package/dist/chart/model/data-series.model.d.ts +5 -5
- package/dist/chart/model/data-series.model.js +282 -2
- package/dist/chart/model/date-time.formatter.d.ts +1 -1
- package/dist/chart/model/date-time.formatter.js +152 -2
- package/dist/chart/model/hit-test-canvas.model.d.ts +2 -2
- package/dist/chart/model/hit-test-canvas.model.js +257 -2
- package/dist/chart/model/main-candle-series.model.d.ts +2 -2
- package/dist/chart/model/main-candle-series.model.js +30 -2
- package/dist/chart/model/scale.model.d.ts +3 -2
- package/dist/chart/model/scale.model.js +317 -2
- package/dist/chart/model/scaling/auto-scale.model.d.ts +1 -1
- package/dist/chart/model/scaling/auto-scale.model.js +98 -2
- package/dist/chart/model/scaling/constrait.functions.d.ts +1 -1
- package/dist/chart/model/scaling/constrait.functions.js +62 -2
- package/dist/chart/model/scaling/lock-ratio.model.d.ts +1 -1
- package/dist/chart/model/scaling/lock-ratio.model.js +18 -2
- package/dist/chart/model/scaling/move-chart.functions.d.ts +1 -1
- package/dist/chart/model/scaling/move-chart.functions.js +23 -2
- package/dist/chart/model/scaling/viewport.model.d.ts +3 -3
- package/dist/chart/model/scaling/viewport.model.js +280 -2
- package/dist/chart/model/scaling/x-zooming.functions.d.ts +1 -1
- package/dist/chart/model/scaling/x-zooming.functions.js +36 -2
- package/dist/chart/model/time-zone.model.d.ts +1 -1
- package/dist/chart/model/time-zone.model.js +110 -2
- package/dist/chart/model/visual-candle.d.ts +1 -1
- package/dist/chart/model/visual-candle.js +135 -2
- package/dist/chart/utils/__tests__/array.utils.test.d.ts +1 -1
- package/dist/chart/utils/__tests__/array.utils.test.js +136 -2
- package/dist/chart/utils/{perfomance/debounce.utils.js → __tests__/math.utils.test.d.ts} +2 -2
- package/dist/chart/utils/__tests__/math.utils.test.js +19 -0
- package/dist/chart/utils/__tests__/object.utils.test.d.ts +1 -1
- package/dist/chart/utils/__tests__/object.utils.test.js +12 -2
- package/dist/chart/utils/__tests__/priceIncrementsUtils.test.d.ts +1 -1
- package/dist/chart/utils/__tests__/priceIncrementsUtils.test.js +30 -2
- package/dist/chart/utils/array.utils.d.ts +2 -2
- package/dist/chart/utils/array.utils.js +270 -2
- package/dist/chart/utils/auto-period-detector.utils.d.ts +1 -1
- package/dist/chart/utils/auto-period-detector.utils.js +40 -2
- package/dist/chart/utils/candles-generator-ts.utils.d.ts +1 -1
- package/dist/chart/utils/candles-generator-ts.utils.js +21 -2
- package/dist/chart/utils/candles-generator.utils.d.ts +1 -1
- package/dist/chart/utils/candles-generator.utils.js +162 -2
- package/dist/chart/utils/candles.utils.d.ts +1 -1
- package/dist/chart/utils/candles.utils.js +43 -2
- package/dist/chart/utils/canvas/canvas-drawing-functions.utils.d.ts +1 -1
- package/dist/chart/utils/canvas/canvas-drawing-functions.utils.js +145 -2
- package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.d.ts +1 -1
- package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.js +52 -2
- package/dist/chart/utils/canvas/canvas-text-functions.utils.d.ts +1 -1
- package/dist/chart/utils/canvas/canvas-text-functions.utils.js +157 -2
- package/dist/chart/utils/color.utils.d.ts +1 -1
- package/dist/chart/utils/color.utils.js +32 -2
- package/dist/chart/utils/device/browser.utils.d.ts +1 -1
- package/dist/chart/utils/device/browser.utils.js +11 -2
- package/dist/chart/utils/device/device-detector.utils.d.ts +1 -1
- package/dist/chart/utils/device/device-detector.utils.js +25 -2
- package/dist/chart/utils/device/device-pixel-ratio.utils.d.ts +1 -1
- package/dist/chart/utils/device/device-pixel-ratio.utils.js +22 -2
- package/dist/chart/utils/device/touchpad.utils.d.ts +1 -1
- package/dist/chart/utils/device/touchpad.utils.js +92 -2
- package/dist/chart/utils/dom.utils.d.ts +1 -1
- package/dist/chart/utils/dom.utils.js +16 -2
- package/dist/chart/utils/function.utils.d.ts +1 -1
- package/dist/chart/utils/function.utils.js +17 -2
- package/dist/chart/utils/linkedList.utils.d.ts +28 -0
- package/dist/chart/utils/linkedList.utils.js +138 -0
- package/dist/chart/utils/math.utils.d.ts +1 -1
- package/dist/chart/utils/math.utils.js +116 -2
- package/dist/chart/utils/merge.utils.d.ts +1 -1
- package/dist/chart/utils/merge.utils.js +57 -2
- package/dist/chart/utils/object.utils.d.ts +1 -1
- package/dist/chart/utils/object.utils.js +44 -2
- package/dist/chart/utils/{perfomance → performance}/animation-frame-cache.utils.d.ts +1 -1
- package/dist/chart/utils/performance/animation-frame-cache.utils.js +77 -0
- package/dist/chart/utils/{perfomance → performance}/debounce.utils.d.ts +1 -1
- package/dist/chart/utils/performance/debounce.utils.js +12 -0
- package/dist/chart/utils/{perfomance → performance}/memoize.utils.d.ts +1 -1
- package/dist/chart/utils/performance/memoize.utils.js +74 -0
- package/dist/chart/utils/{perfomance → performance}/request-animation-frame-throttle.utils.d.ts +1 -1
- package/dist/chart/utils/performance/request-animation-frame-throttle.utils.js +43 -0
- package/dist/chart/utils/{perfomance → performance}/throttle.utils.d.ts +1 -1
- package/dist/chart/utils/performance/throttle.utils.js +26 -0
- package/dist/chart/utils/price-increments.utils.d.ts +2 -1
- package/dist/chart/utils/price-increments.utils.js +128 -2
- package/dist/chart/utils/uuid.utils.d.ts +1 -1
- package/dist/chart/utils/uuid.utils.js +5 -2
- package/dist/dxchart.min.js +10 -13
- package/dist/index.d.ts +4 -4
- package/dist/index.js +21 -2
- package/package.json +4 -4
- package/dist/chart/utils/perfomance/animation-frame-cache.utils.js +0 -6
- package/dist/chart/utils/perfomance/memoize.utils.js +0 -6
- package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.js +0 -6
- package/dist/chart/utils/perfomance/throttle.utils.js +0 -6
|
@@ -1,6 +1,283 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { distinctUntilChanged } from 'rxjs/operators';
|
|
7
|
+
import { areBoundsChanged, CanvasElement, } from '../../canvas/canvas-bounds-container';
|
|
8
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
9
|
+
import { SyncedByXScaleModel } from '../../model/scale.model';
|
|
10
|
+
import { firstOf, flatMap, lastOf } from '../../utils/array.utils';
|
|
11
|
+
import { createCandlesOffsetProvider } from '../chart/data-series.high-low-provider';
|
|
12
|
+
import { GridComponent } from '../grid/grid.component';
|
|
13
|
+
import { YAxisComponent } from '../y_axis/y-axis.component';
|
|
14
|
+
import { createDefaultYExtentHighLowProvider, YExtentComponent, } from './extent/y-extent-component';
|
|
15
|
+
export class PaneComponent extends ChartBaseElement {
|
|
16
|
+
get scale() {
|
|
17
|
+
return this.mainExtent.scale;
|
|
18
|
+
}
|
|
19
|
+
get yAxis() {
|
|
20
|
+
return this.mainExtent.yAxis;
|
|
21
|
+
}
|
|
22
|
+
get dataSeries() {
|
|
23
|
+
return flatMap(this.yExtentComponents, c => Array.from(c.dataSeries));
|
|
24
|
+
}
|
|
25
|
+
constructor(chartBaseModel, mainCanvasModel, yAxisLabelsCanvasModel, dynamicObjectsCanvasModel, hitTestController, config, mainScale, drawingManager, chartPanComponent, canvasInputListener, canvasAnimation, cursorHandler, eventBus, canvasBoundsContainer, uuid, seriesAddedSubject, seriesRemovedSubject, options) {
|
|
26
|
+
super();
|
|
27
|
+
this.chartBaseModel = chartBaseModel;
|
|
28
|
+
this.mainCanvasModel = mainCanvasModel;
|
|
29
|
+
this.yAxisLabelsCanvasModel = yAxisLabelsCanvasModel;
|
|
30
|
+
this.dynamicObjectsCanvasModel = dynamicObjectsCanvasModel;
|
|
31
|
+
this.hitTestController = hitTestController;
|
|
32
|
+
this.config = config;
|
|
33
|
+
this.mainScale = mainScale;
|
|
34
|
+
this.drawingManager = drawingManager;
|
|
35
|
+
this.chartPanComponent = chartPanComponent;
|
|
36
|
+
this.canvasInputListener = canvasInputListener;
|
|
37
|
+
this.canvasAnimation = canvasAnimation;
|
|
38
|
+
this.cursorHandler = cursorHandler;
|
|
39
|
+
this.eventBus = eventBus;
|
|
40
|
+
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
41
|
+
this.uuid = uuid;
|
|
42
|
+
this.seriesAddedSubject = seriesAddedSubject;
|
|
43
|
+
this.seriesRemovedSubject = seriesRemovedSubject;
|
|
44
|
+
this._paneOrder = 0;
|
|
45
|
+
this.yExtentComponents = [];
|
|
46
|
+
this.getYAxisBounds = () => {
|
|
47
|
+
return this.canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID_Y_AXIS(this.uuid));
|
|
48
|
+
};
|
|
49
|
+
this.valueFormatter = (value, dataSeries) => {
|
|
50
|
+
return this.mainExtent.valueFormatter(value, dataSeries);
|
|
51
|
+
};
|
|
52
|
+
const yExtentComponent = this.createExtentComponent(options);
|
|
53
|
+
this.mainExtent = yExtentComponent;
|
|
54
|
+
this.ht = this.canvasBoundsContainer.getBoundsHitTest(CanvasElement.PANE_UUID(uuid), {
|
|
55
|
+
// this is needed to reduce cross event fire zone, so cross event won't be fired when hover resizer
|
|
56
|
+
// maybe we need to rework it, this isn't perfect - top and bottom panes will have small no-hover area
|
|
57
|
+
extensionY: -this.config.components.paneResizer.dragZone,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Method that activates the canvas bounds container and recalculates the zoom Y of the scale model.
|
|
62
|
+
* @protected
|
|
63
|
+
* @function
|
|
64
|
+
* @returns {void}
|
|
65
|
+
*/
|
|
66
|
+
doActivate() {
|
|
67
|
+
super.doActivate();
|
|
68
|
+
this.addRxSubscription(this.canvasBoundsContainer
|
|
69
|
+
.observeBoundsChanged(CanvasElement.PANE_UUID(this.uuid))
|
|
70
|
+
.pipe(distinctUntilChanged(areBoundsChanged))
|
|
71
|
+
.subscribe(() => {
|
|
72
|
+
this.yExtentComponents.forEach(c => c.scale.recalculateZoomY());
|
|
73
|
+
this.dynamicObjectsCanvasModel.fireDraw();
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
toY(price) {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
return (_b = (_a = this.mainExtent.mainDataSeries) === null || _a === void 0 ? void 0 : _a.view.toY(price)) !== null && _b !== void 0 ? _b : this.scale.toY(price);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Creates a new GridComponent instance with the provided parameters.
|
|
82
|
+
* @param {string} uuid - The unique identifier of the pane.
|
|
83
|
+
* @param {ScaleModel} scaleModel - The scale model used to calculate the scale of the grid.
|
|
84
|
+
* @param {NumericYAxisLabelsGenerator} yAxisLabelsGenerator - The generator used to create the labels for the y-axis.
|
|
85
|
+
* @returns {GridComponent} - The newly created GridComponent instance.
|
|
86
|
+
*/
|
|
87
|
+
createGridComponent(uuid, scale, yAxisLabelsGenerator, yAxisState) {
|
|
88
|
+
const gridComponent = new GridComponent(this.mainCanvasModel, scale, this.config, yAxisState, `PANE_${uuid}_grid_drawer`, this.drawingManager, () => this.canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID(uuid)), () => this.canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID(uuid)), () => [], () => yAxisLabelsGenerator.generateNumericLabels());
|
|
89
|
+
return gridComponent;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Creates a handler for Y-axis panning of the chart.
|
|
93
|
+
* @private
|
|
94
|
+
* @param {string} uuid - The unique identifier of the chart pane.
|
|
95
|
+
* @param {ScaleModel} scaleModel - The scale model of the chart.
|
|
96
|
+
* @returns {Unsubscriber}
|
|
97
|
+
*/
|
|
98
|
+
createYPanHandler(uuid, scale) {
|
|
99
|
+
const dragNDropComponent = this.chartPanComponent.chartAreaPanHandler.registerChartYPanHandler(scale, this.canvasBoundsContainer.getBoundsHitTest(CanvasElement.PANE_UUID(uuid)));
|
|
100
|
+
return [
|
|
101
|
+
() => {
|
|
102
|
+
this.chartPanComponent.chartAreaPanHandler.removeChildEntity(dragNDropComponent);
|
|
103
|
+
dragNDropComponent.disable();
|
|
104
|
+
},
|
|
105
|
+
dragNDropComponent,
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
addCursors(extentIdx, yAxisComponent) {
|
|
109
|
+
const paneYAxis = CanvasElement.PANE_UUID_Y_AXIS(this.uuid, extentIdx);
|
|
110
|
+
this.cursorHandler.setCursorForCanvasEl(paneYAxis, yAxisComponent.state.cursor);
|
|
111
|
+
return () => this.cursorHandler.removeCursorForCanvasEl(paneYAxis);
|
|
112
|
+
}
|
|
113
|
+
createExtentComponent(options) {
|
|
114
|
+
var _a, _b;
|
|
115
|
+
const extentIdx = this.yExtentComponents.length;
|
|
116
|
+
const getBounds = () => this.canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID(this.uuid));
|
|
117
|
+
const scaleModel = (_a = options === null || options === void 0 ? void 0 : options.scale) !== null && _a !== void 0 ? _a : new SyncedByXScaleModel(this.mainScale, this.config, getBounds, this.canvasAnimation);
|
|
118
|
+
const [unsub, dragNDrop] = this.createYPanHandler(this.uuid, scaleModel);
|
|
119
|
+
// creating partially resolved constructor except formatter & dataSeriesProvider - bcs it's not possible to provide formatter
|
|
120
|
+
// before y-extent is created
|
|
121
|
+
const createYAxisComponent = (formatter, dataSeriesProvider) => new YAxisComponent(this.eventBus, this.config, this.yAxisLabelsCanvasModel, scaleModel, this.canvasInputListener, this.canvasBoundsContainer, this.chartPanComponent, this.cursorHandler, formatter, dataSeriesProvider, this.uuid, extentIdx);
|
|
122
|
+
const yExtentComponent = new YExtentComponent(this.uuid, extentIdx, this, this.chartBaseModel, this.canvasBoundsContainer, this.hitTestController, this.dynamicObjectsCanvasModel, scaleModel, createYAxisComponent, dragNDrop);
|
|
123
|
+
yExtentComponent.addSubscription(unsub);
|
|
124
|
+
yExtentComponent.addSubscription(this.addCursors(extentIdx, yExtentComponent.yAxis));
|
|
125
|
+
(options === null || options === void 0 ? void 0 : options.paneFormatters) && yExtentComponent.setValueFormatters(options.paneFormatters);
|
|
126
|
+
const useDefaultHighLow = (_b = options === null || options === void 0 ? void 0 : options.useDefaultHighLow) !== null && _b !== void 0 ? _b : true;
|
|
127
|
+
if (useDefaultHighLow) {
|
|
128
|
+
scaleModel.autoScaleModel.setHighLowProvider('default', createCandlesOffsetProvider(() => ({ top: 10, bottom: 10, left: 0, right: 0, visible: true }), createDefaultYExtentHighLowProvider(yExtentComponent)));
|
|
129
|
+
}
|
|
130
|
+
const gridComponent = this.createGridComponent(this.uuid, scaleModel, yExtentComponent.yAxis.model.labelsGenerator, yExtentComponent.yAxis.state);
|
|
131
|
+
yExtentComponent.addChildEntity(gridComponent);
|
|
132
|
+
yExtentComponent.activate();
|
|
133
|
+
this.yExtentComponents.push(yExtentComponent);
|
|
134
|
+
this.canvasBoundsContainer.updateYAxisWidths();
|
|
135
|
+
return yExtentComponent;
|
|
136
|
+
}
|
|
137
|
+
removeExtentComponent(extentComponent) {
|
|
138
|
+
extentComponent.disable();
|
|
139
|
+
this.yExtentComponents.splice(extentComponent.idx, 1);
|
|
140
|
+
// re-index extents
|
|
141
|
+
this.yExtentComponents.forEach((c, idx) => (c.idx = idx));
|
|
142
|
+
this.canvasBoundsContainer.updateYAxisWidths();
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* This method updates the view by calling the doAutoScale method of the scaleModel and firing the Draw event using the eventBus.
|
|
146
|
+
* @private
|
|
147
|
+
*/
|
|
148
|
+
updateView() {
|
|
149
|
+
this.yExtentComponents.forEach(c => {
|
|
150
|
+
c.scale.doAutoScale();
|
|
151
|
+
c.yAxis.model.labelsGenerator.generateNumericLabels();
|
|
152
|
+
});
|
|
153
|
+
this.canvasBoundsContainer.updateYAxisWidths();
|
|
154
|
+
this.eventBus.fireDraw();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Merges all the y-axis extents on the pane into one.
|
|
158
|
+
*/
|
|
159
|
+
mergeYExtents() {
|
|
160
|
+
for (let i = 1; i < this.yExtentComponents.length; i++) {
|
|
161
|
+
const extent = this.yExtentComponents[i];
|
|
162
|
+
extent.dataSeries.forEach(s => s.moveToExtent(this.mainExtent));
|
|
163
|
+
extent.disable();
|
|
164
|
+
}
|
|
165
|
+
this.canvasBoundsContainer.updateYAxisWidths();
|
|
166
|
+
this.yExtentComponents = [this.mainExtent];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Returns the bounds of the pane component.
|
|
170
|
+
*/
|
|
171
|
+
getBounds() {
|
|
172
|
+
return this.mainExtent.getBounds();
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Hides the pane by removing its bounds from the canvasBoundsContainer and firing a draw event.
|
|
176
|
+
* @function
|
|
177
|
+
* @name hide
|
|
178
|
+
* @memberof PaneComponent
|
|
179
|
+
* @returns {void}
|
|
180
|
+
*/
|
|
181
|
+
hide() {
|
|
182
|
+
this._paneOrder = this.canvasBoundsContainer.panesOrder.indexOf(this.uuid);
|
|
183
|
+
this.canvasBoundsContainer.removedPaneBounds(this.uuid);
|
|
184
|
+
this.eventBus.fireDraw();
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Adds the bounds of the pane to the canvas bounds container and fires a draw event.
|
|
188
|
+
* @function
|
|
189
|
+
* @name show
|
|
190
|
+
* @memberof PaneComponent
|
|
191
|
+
* @returns {void}
|
|
192
|
+
*/
|
|
193
|
+
show() {
|
|
194
|
+
this.canvasBoundsContainer.addPaneBounds(this.uuid, this._paneOrder);
|
|
195
|
+
this.eventBus.fireDraw();
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Creates a new DataSeriesModel object.
|
|
199
|
+
* @returns {DataSeriesModel} - The newly created DataSeriesModel object.
|
|
200
|
+
*/
|
|
201
|
+
createDataSeries() {
|
|
202
|
+
var _a;
|
|
203
|
+
return (_a = this.mainExtent) === null || _a === void 0 ? void 0 : _a.createDataSeries();
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Adds a new data series to the chart.
|
|
207
|
+
* @param {DataSeriesModel} series - The data series to be added.
|
|
208
|
+
* @returns {void}
|
|
209
|
+
*/
|
|
210
|
+
addDataSeries(series) {
|
|
211
|
+
this.mainExtent.addDataSeries(series);
|
|
212
|
+
this.updateView();
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Removes a data series from the chart.
|
|
216
|
+
*
|
|
217
|
+
* @param {DataSeriesModel} series - The data series to be removed.
|
|
218
|
+
* @returns {void}
|
|
219
|
+
*/
|
|
220
|
+
removeDataSeries(series) {
|
|
221
|
+
this.mainExtent.removeDataSeries(series);
|
|
222
|
+
this.updateView();
|
|
223
|
+
}
|
|
224
|
+
// TODO hack, remove when each pane will have separate y-axis component
|
|
225
|
+
/**
|
|
226
|
+
* Returns the type of the y-axis component for the current pane.
|
|
227
|
+
*
|
|
228
|
+
* @returns {PriceAxisType} The 'regular' type of the y-axis component for the current pane.
|
|
229
|
+
*
|
|
230
|
+
*/
|
|
231
|
+
getAxisType() {
|
|
232
|
+
return 'regular';
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Moves the canvas bounds container up by calling the movePaneUp method with the uuid of the current object.
|
|
236
|
+
* @returns {void}
|
|
237
|
+
*/
|
|
238
|
+
moveUp() {
|
|
239
|
+
this.canvasBoundsContainer.movePaneUp(this.uuid);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Moves the canvas bounds container down by calling the movePaneDown method with the uuid of the current object.
|
|
243
|
+
* @returns {void}
|
|
244
|
+
*/
|
|
245
|
+
moveDown() {
|
|
246
|
+
this.canvasBoundsContainer.movePaneDown(this.uuid);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Checks if the current pane can move up.
|
|
250
|
+
* @returns {boolean} - Returns true if the current pane can move up, otherwise false.
|
|
251
|
+
*/
|
|
252
|
+
canMoveUp() {
|
|
253
|
+
const firstPane = firstOf(this.canvasBoundsContainer.panesOrder);
|
|
254
|
+
return this.uuid !== firstPane;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Checks if the current pane can move down.
|
|
258
|
+
*
|
|
259
|
+
* @returns {boolean} - Returns true if the current pane is not the last one in the canvasBoundsContainer, otherwise returns false.
|
|
260
|
+
*/
|
|
261
|
+
canMoveDown() {
|
|
262
|
+
const lastPane = lastOf(this.canvasBoundsContainer.panesOrder);
|
|
263
|
+
return this.uuid !== lastPane;
|
|
264
|
+
}
|
|
265
|
+
get regularFormatter() {
|
|
266
|
+
return this.mainExtent.formatters.regular;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Sets the pane value formatters for the current instance.
|
|
270
|
+
* @param {YExtentFormatters} formatters - The pane value formatters to be set.
|
|
271
|
+
*/
|
|
272
|
+
setPaneValueFormatters(formatters) {
|
|
273
|
+
this.mainExtent.setValueFormatters(formatters);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Returns the regular value from Y coordinate.
|
|
277
|
+
* @param {number} y - The Y coordinate.
|
|
278
|
+
* @returns {number} - The regular value.
|
|
279
|
+
*/
|
|
280
|
+
regularValueFromY(y) {
|
|
281
|
+
return this.mainExtent.regularValueFromY(y);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
@@ -1,6 +1,144 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import { distinctUntilChanged, skip, startWith } from 'rxjs/operators';
|
|
8
|
+
import { DynamicDrawerType } from '../../drawers/drawing-manager';
|
|
9
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
10
|
+
import { DragNDropYComponent } from '../dran-n-drop_helper/drag-n-drop-y.component';
|
|
11
|
+
import { BarResizerDrawer } from './bar-resizer.drawer';
|
|
12
|
+
/**
|
|
13
|
+
* Bar separator between panes.
|
|
14
|
+
* Used to resize the areas height or just draw a fixed line.
|
|
15
|
+
* Supports hover animation.
|
|
16
|
+
*
|
|
17
|
+
* @doc-tags chart-core,resizer
|
|
18
|
+
*/
|
|
19
|
+
export class BarResizerComponent extends ChartBaseElement {
|
|
20
|
+
constructor(id, boundsProvider, hitTest, dragTickCb, chartPanComponent, canvasModel, drawingManager, canvasInputListener, canvasAnimation, config, canvasBoundsContainer) {
|
|
21
|
+
super();
|
|
22
|
+
this.id = id;
|
|
23
|
+
this.boundsProvider = boundsProvider;
|
|
24
|
+
this.hitTest = hitTest;
|
|
25
|
+
this.dragTickCb = dragTickCb;
|
|
26
|
+
this.chartPanComponent = chartPanComponent;
|
|
27
|
+
this.canvasModel = canvasModel;
|
|
28
|
+
this.drawingManager = drawingManager;
|
|
29
|
+
this.canvasInputListener = canvasInputListener;
|
|
30
|
+
this.canvasAnimation = canvasAnimation;
|
|
31
|
+
this.config = config;
|
|
32
|
+
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
33
|
+
this.initialY = 0;
|
|
34
|
+
this.resizeEvent$ = new Subject();
|
|
35
|
+
this.onYDragStart = () => {
|
|
36
|
+
this.config.components.crossTool.type = 'none';
|
|
37
|
+
this.initialY = this.boundsProvider().y;
|
|
38
|
+
};
|
|
39
|
+
this.onYDragEnd = () => {
|
|
40
|
+
this.config.components.crossTool.type = 'cross-and-labels';
|
|
41
|
+
this.initialY = this.boundsProvider().y;
|
|
42
|
+
this.canvasBoundsContainer.graphsHeightRatioChangedSubject.next(this.canvasBoundsContainer.graphsHeightRatio);
|
|
43
|
+
};
|
|
44
|
+
this.onYDragTick = (dragInfo) => {
|
|
45
|
+
const { delta: yDelta, draggedPixels } = dragInfo;
|
|
46
|
+
// in case cursor moves outside the bar - do not generate "tick"
|
|
47
|
+
if (Math.abs(this.initialY - this.boundsProvider().y + draggedPixels) >= 0) {
|
|
48
|
+
this.dragTickCb(yDelta);
|
|
49
|
+
this.resizeEvent$.next();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
this.animationId = `${this.id}_RESIZER`;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* This method activates the pane resizer component.
|
|
56
|
+
* It calls the parent class's doActivate method and then checks if the fixedMode property is set to false in the config object.
|
|
57
|
+
* If it is false, it creates a new DragNDropYComponent and adds it to the component list.
|
|
58
|
+
* It also adds a subscription to the canvasInputListener to observe mouse enter events and
|
|
59
|
+
* handle hover animations if the animation is enabled in the config object.
|
|
60
|
+
* Finally, it creates a new BarResizerDrawer and adds it to the drawing manager as a DynamicDrawerType.paneResizer with the current id.
|
|
61
|
+
* It also adds a subscription to remove the drawer when the component is deactivated.
|
|
62
|
+
* @protected
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
|
+
doActivate() {
|
|
66
|
+
super.doActivate();
|
|
67
|
+
const fixedMode = this.config.components.paneResizer.fixedMode;
|
|
68
|
+
if (!fixedMode) {
|
|
69
|
+
const dragNDropYComponent = new DragNDropYComponent(this.hitTest, {
|
|
70
|
+
onDragTick: this.onYDragTick,
|
|
71
|
+
onDragStart: this.onYDragStart,
|
|
72
|
+
onDragEnd: this.onYDragEnd,
|
|
73
|
+
}, this.canvasInputListener, this.chartPanComponent);
|
|
74
|
+
this.addChildEntity(dragNDropYComponent);
|
|
75
|
+
if (this.config.animation.paneResizer.enabled) {
|
|
76
|
+
this.addRxSubscription(this.canvasInputListener
|
|
77
|
+
.observeMouseEnter(this.hitTest, true)
|
|
78
|
+
.pipe(
|
|
79
|
+
// set initial pipe state to false, so animation will play for the first time only for appearing
|
|
80
|
+
startWith(false), distinctUntilChanged(), skip(1))
|
|
81
|
+
.subscribe(enter => {
|
|
82
|
+
if (enter) {
|
|
83
|
+
this.handleHoverAnimation('appearing');
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.handleHoverAnimation('fading');
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const barResizerDrawer = new BarResizerDrawer(this.config, this.boundsProvider, this.canvasModel, this.canvasAnimation, this.animationId);
|
|
92
|
+
this.drawingManager.addDrawer(barResizerDrawer, DynamicDrawerType.paneResizer(this.id));
|
|
93
|
+
this.addSubscription(() => this.drawingManager.removeDrawerByName(DynamicDrawerType.paneResizer(this.id)));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* This method is called when the component is being deactivated.
|
|
97
|
+
* It calls the parent method doDeactivate() and then completes the resizeEvent$ observable.
|
|
98
|
+
* @protected
|
|
99
|
+
* @returns {void}
|
|
100
|
+
*/
|
|
101
|
+
doDeactivate() {
|
|
102
|
+
super.doDeactivate();
|
|
103
|
+
this.resizeEvent$.complete();
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* This function handles the hover animation of a pane resizer. It takes a type parameter which can be either 'fading' or 'appearing'.
|
|
107
|
+
* If the background mode is enabled, it gets the color alpha animation from the canvasAnimation and starts the color alpha animation
|
|
108
|
+
* with the given animationId and the color and type provided in the parameter. If the background mode is not enabled, it gets the color transition
|
|
109
|
+
* animation from the canvasAnimation and starts the color transition animation with the given animationId, startColor, endColor and type
|
|
110
|
+
* provided in the parameter and the duration from the config. If there is an animation in progress, it reverts it.
|
|
111
|
+
*
|
|
112
|
+
* @param {string} type - The type of animation, can be either 'fading' or 'appearing'.
|
|
113
|
+
* @returns {void}
|
|
114
|
+
*/
|
|
115
|
+
handleHoverAnimation(type) {
|
|
116
|
+
let animation;
|
|
117
|
+
if (this.config.animation.paneResizer.bgMode) {
|
|
118
|
+
animation = this.canvasAnimation.getColorAlphaAnimation(this.animationId);
|
|
119
|
+
if (!animation || !animation.animationInProgress) {
|
|
120
|
+
this.canvasAnimation.startColorAlphaAnimation(this.animationId, [
|
|
121
|
+
{
|
|
122
|
+
color: this.config.colors.paneResizer.bgHoverColor,
|
|
123
|
+
type,
|
|
124
|
+
},
|
|
125
|
+
]);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
animation = this.canvasAnimation.getColorTransitionAnimation(this.animationId);
|
|
130
|
+
if (!animation || !animation.animationInProgress) {
|
|
131
|
+
this.canvasAnimation.startColorTransitionAnimation(this.animationId, [
|
|
132
|
+
{
|
|
133
|
+
startColor: this.config.colors.paneResizer.bgColor,
|
|
134
|
+
endColor: this.config.colors.paneResizer.bgHoverColor,
|
|
135
|
+
type,
|
|
136
|
+
},
|
|
137
|
+
], this.config.animation.paneResizer.duration);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (animation && animation.animationInProgress) {
|
|
141
|
+
animation.revert();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
-
export class BarResizerDrawer
|
|
6
|
+
export class BarResizerDrawer {
|
|
7
|
+
constructor(config, boundsProvider, canvasModel, canvasAnimation, animationId) {
|
|
8
|
+
this.config = config;
|
|
9
|
+
this.boundsProvider = boundsProvider;
|
|
10
|
+
this.canvasModel = canvasModel;
|
|
11
|
+
this.canvasAnimation = canvasAnimation;
|
|
12
|
+
this.animationId = animationId;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Draws the pane resizer on the canvas if it is visible.
|
|
16
|
+
* The resizer is drawn with a fixed mode or with an animation.
|
|
17
|
+
* The resizer's position and size are determined by the bounds provider.
|
|
18
|
+
* The yAxisWidth is calculated based on the canvas bounds container.
|
|
19
|
+
* The resizerXOffset and resizerWidthOffset are calculated based on the yAxis alignment.
|
|
20
|
+
* The resizer is filled with a color based on the animation or the config colors.
|
|
21
|
+
* If the bgMode is true, the resizer is filled without the drag zone, otherwise it is filled with the drag zone.
|
|
22
|
+
*/
|
|
23
|
+
draw() {
|
|
24
|
+
if (this.config.components.paneResizer.visible) {
|
|
25
|
+
const fixedMode = this.config.components.paneResizer.fixedMode;
|
|
26
|
+
const resizer = this.boundsProvider();
|
|
27
|
+
const ctx = this.canvasModel.ctx;
|
|
28
|
+
const animation = this.canvasAnimation.getColorAlphaAnimation(this.animationId);
|
|
29
|
+
const drag = this.config.components.paneResizer.dragZone;
|
|
30
|
+
if (!fixedMode && animation) {
|
|
31
|
+
ctx.fillStyle = animation.getColor(0);
|
|
32
|
+
ctx.fillRect(resizer.x, resizer.y - drag, resizer.width, resizer.height + 2 * drag);
|
|
33
|
+
}
|
|
34
|
+
ctx.fillStyle = this.config.colors.paneResizer.lineColor;
|
|
35
|
+
if (this.config.animation.paneResizer.bgMode) {
|
|
36
|
+
ctx.fillRect(resizer.x, resizer.y, resizer.width, resizer.height);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
ctx.fillRect(resizer.x, resizer.y - drag, resizer.width, resizer.height + 2 * drag);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Returns an array of canvas IDs.
|
|
45
|
+
*
|
|
46
|
+
* @returns {Array<string>} An array containing the ID of the canvas model.
|
|
47
|
+
*/
|
|
48
|
+
getCanvasIds() {
|
|
49
|
+
return [this.canvasModel.canvasId];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
-
import{ChartBaseElement
|
|
6
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
7
|
+
/**
|
|
8
|
+
* Snapshot Component.
|
|
9
|
+
* Allows to copy, download and share snapshot
|
|
10
|
+
*/
|
|
11
|
+
export class SnapshotComponent extends ChartBaseElement {
|
|
12
|
+
constructor(elements, canvasModel) {
|
|
13
|
+
super();
|
|
14
|
+
this.elements = elements;
|
|
15
|
+
this.canvasModel = canvasModel;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Implements doActivate method.
|
|
19
|
+
* @protected
|
|
20
|
+
* @returns {void}
|
|
21
|
+
*/
|
|
22
|
+
doActivate() {
|
|
23
|
+
super.doActivate();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a snapshot of the canvas and returns it as a Promise of Blob object.
|
|
27
|
+
* @param {function} userDrawCallback - Optional callback function that takes a CanvasRenderingContext2D object
|
|
28
|
+
* as a parameter and allows the user to draw on the canvas before taking the snapshot.
|
|
29
|
+
* @returns {Promise<Blob>} - A Promise that resolves with a Blob object representing the snapshot of the canvas.
|
|
30
|
+
* @throws {Error} - If the snapshot isn't supported, an error is thrown.
|
|
31
|
+
*/
|
|
32
|
+
createSnapshot(userDrawCallback) {
|
|
33
|
+
const snapshotCanvas = this.canvasModel.canvas;
|
|
34
|
+
const ctx = this.canvasModel.ctx;
|
|
35
|
+
if (ctx) {
|
|
36
|
+
ctx.clearRect(0, 0, snapshotCanvas.width, snapshotCanvas.height);
|
|
37
|
+
const width = snapshotCanvas.width / window.devicePixelRatio;
|
|
38
|
+
const height = snapshotCanvas.height / window.devicePixelRatio;
|
|
39
|
+
ctx.drawImage(this.elements.backgroundCanvas, 0, 0, width, height);
|
|
40
|
+
ctx.drawImage(this.elements.mainCanvas, 0, 0, width, height);
|
|
41
|
+
ctx.drawImage(this.elements.dynamicObjectsCanvas, 0, 0, width, height);
|
|
42
|
+
ctx.drawImage(this.elements.crossToolCanvas, 0, 0, width, height);
|
|
43
|
+
userDrawCallback && userDrawCallback(ctx);
|
|
44
|
+
return new Promise((resolve, fail) => this.elements.snapshotCanvas.toBlob(blob => {
|
|
45
|
+
return blob ? resolve(blob) : fail('Blob is null');
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
console.error("Snapshot isn't supported");
|
|
50
|
+
return Promise.reject();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { BarType, FullChartConfig } from '../../chart.config';
|
|
8
|
-
import { CanvasModel } from '../../model/canvas.model';
|
|
6
|
+
import { FullChartConfig } from '../../chart.config';
|
|
9
7
|
import { DrawingManager } from '../../drawers/drawing-manager';
|
|
10
|
-
import {
|
|
8
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
11
9
|
import { Pixel, Unit } from '../../model/scaling/viewport.model';
|
|
12
10
|
import { ChartComponent } from '../chart/chart.component';
|
|
13
11
|
import { PaneManager } from '../pane/pane-manager.component';
|
|
14
|
-
import {
|
|
12
|
+
import { PaneComponent } from '../pane/pane.component';
|
|
15
13
|
import { VolumesModel } from './volumes.model';
|
|
16
14
|
export declare class SeparateVolumesComponent extends ChartBaseElement {
|
|
17
|
-
private canvasModel;
|
|
18
15
|
private chartComponent;
|
|
19
16
|
private drawingManager;
|
|
20
|
-
|
|
17
|
+
config: FullChartConfig;
|
|
21
18
|
private volumesModel;
|
|
22
|
-
private readonly volumesColorByChartTypeMap;
|
|
23
19
|
private paneManager;
|
|
24
20
|
static UUID: string;
|
|
25
|
-
|
|
26
|
-
constructor(
|
|
21
|
+
pane: PaneComponent | undefined;
|
|
22
|
+
constructor(chartComponent: ChartComponent, drawingManager: DrawingManager, config: FullChartConfig, volumesModel: VolumesModel, paneManager: PaneManager);
|
|
27
23
|
protected doActivate(): void;
|
|
28
24
|
/**
|
|
29
25
|
* Activates the separate volumes feature.
|