@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,124 @@
|
|
|
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{CanvasElement
|
|
6
|
+
import { CanvasElement, CHART_UUID } from '../../../canvas/canvas-bounds-container';
|
|
7
|
+
import { getFontFromConfig, } from '../../../chart.config';
|
|
8
|
+
import { redrawBackgroundArea } from '../../../drawers/chart-background.drawer';
|
|
9
|
+
import { avoidAntialiasing, drawLine } from '../../../utils/canvas/canvas-drawing-functions.utils';
|
|
10
|
+
import { calculateSymbolHeight, calculateTextWidth } from '../../../utils/canvas/canvas-font-measure-tool.utils';
|
|
11
|
+
import { floor } from '../../../utils/math.utils';
|
|
12
|
+
import { drawBadgeLabel, drawPlainLabel, drawRectLabel } from '../y-axis-labels.drawer';
|
|
13
|
+
export const DEFAULT_LABEL_APPEARANCE_TYPE = 'badge';
|
|
14
|
+
const DEFAULT_PADDING = 4;
|
|
15
|
+
export const priceLabelDrawersMap = {
|
|
16
|
+
badge: drawBadgeLabel,
|
|
17
|
+
rectangle: drawRectLabel,
|
|
18
|
+
plain: drawPlainLabel,
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Draws label on Y axis with provided parameters.
|
|
22
|
+
* @param ctx - canvas 2D context to draw on
|
|
23
|
+
* @param bounds - bounds of Y axis
|
|
24
|
+
* @param visualLabel
|
|
25
|
+
* @param canvasBoundsContainer
|
|
26
|
+
* @param config
|
|
27
|
+
*/
|
|
28
|
+
export function drawLabel(ctx, backgroundCtx, bounds, paneBounds, visualLabel, canvasBoundsContainer, config, colors) {
|
|
29
|
+
var _a, _b, _c, _d, _e;
|
|
30
|
+
const centralY = visualLabel.y;
|
|
31
|
+
const text = visualLabel.labelText;
|
|
32
|
+
const mode = (_a = visualLabel.mode) !== null && _a !== void 0 ? _a : 'label';
|
|
33
|
+
const appearanceType = (_b = visualLabel.labelType) !== null && _b !== void 0 ? _b : DEFAULT_LABEL_APPEARANCE_TYPE;
|
|
34
|
+
const description = visualLabel.description;
|
|
35
|
+
const textFont = (_c = visualLabel.textFont) !== null && _c !== void 0 ? _c : getFontFromConfig(config);
|
|
36
|
+
const bgColor = visualLabel.bgColor;
|
|
37
|
+
const lineColor = (_d = visualLabel.lineColor) !== null && _d !== void 0 ? _d : bgColor;
|
|
38
|
+
const descriptionWidth = calculateTextWidth(description !== null && description !== void 0 ? description : '', ctx, textFont) + 8;
|
|
39
|
+
const labelY = floor(visualLabel.y);
|
|
40
|
+
const fontHeight = calculateSymbolHeight(textFont, ctx);
|
|
41
|
+
const labelBoxTopY = centralY - fontHeight / 2;
|
|
42
|
+
const labelBoxBottomY = centralY + fontHeight / 2;
|
|
43
|
+
const labelBoxHeight = labelBoxBottomY - labelBoxTopY;
|
|
44
|
+
ctx.save();
|
|
45
|
+
ctx.fillStyle = bgColor;
|
|
46
|
+
ctx.strokeStyle = lineColor;
|
|
47
|
+
const chartBounds = canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID(CHART_UUID));
|
|
48
|
+
const drawLabel = priceLabelDrawersMap[appearanceType];
|
|
49
|
+
const showDescription = config.labels.descriptions;
|
|
50
|
+
const showLine = isLineVisible(bounds, labelY, labelBoxHeight);
|
|
51
|
+
const _drawDescription = () => showDescription && drawDescription(backgroundCtx, ctx, bounds, paneBounds, visualLabel, config.align, config);
|
|
52
|
+
let lineXStart;
|
|
53
|
+
let lineXEnd;
|
|
54
|
+
// line should touch the label
|
|
55
|
+
const lineStartAdjust = 2;
|
|
56
|
+
if (config.align === 'right') {
|
|
57
|
+
lineXStart = chartBounds.x;
|
|
58
|
+
lineXEnd = showDescription
|
|
59
|
+
? chartBounds.x + chartBounds.width - descriptionWidth
|
|
60
|
+
: chartBounds.x + chartBounds.width + lineStartAdjust;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
lineXStart = showDescription ? chartBounds.x + descriptionWidth : chartBounds.x - lineStartAdjust;
|
|
64
|
+
lineXEnd = chartBounds.x + chartBounds.width;
|
|
65
|
+
}
|
|
66
|
+
const lineY = (_e = visualLabel.lineY) !== null && _e !== void 0 ? _e : visualLabel.y;
|
|
67
|
+
const _drawLine = () => showLine && avoidAntialiasing(ctx, () => drawLine(ctx, lineXStart, lineY, lineXEnd, lineY, 1));
|
|
68
|
+
const _drawLabel = () => drawLabel(ctx, bounds, text, centralY, visualLabel, config, colors, false, backgroundCtx);
|
|
69
|
+
switch (mode) {
|
|
70
|
+
case 'line':
|
|
71
|
+
_drawLine();
|
|
72
|
+
_drawDescription();
|
|
73
|
+
break;
|
|
74
|
+
case 'line-label':
|
|
75
|
+
_drawLine();
|
|
76
|
+
_drawDescription();
|
|
77
|
+
_drawLabel();
|
|
78
|
+
break;
|
|
79
|
+
case 'label':
|
|
80
|
+
_drawDescription();
|
|
81
|
+
_drawLabel();
|
|
82
|
+
break;
|
|
83
|
+
case 'none':
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
ctx.restore();
|
|
87
|
+
}
|
|
88
|
+
const isLineVisible = (bounds, labelY, labelBoxHeight) => labelY > bounds.y + labelBoxHeight / 2 && labelY < bounds.y + bounds.height - labelBoxHeight / 2;
|
|
89
|
+
function drawDescription(backgroundCtx, ctx, labelBounds, paneBounds, visualLabel, align = 'right', yAxisState) {
|
|
90
|
+
var _a, _b, _c;
|
|
91
|
+
const description = visualLabel.description;
|
|
92
|
+
if (!description || description.length === 0) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const centralY = visualLabel.y;
|
|
96
|
+
const textFont = getFontFromConfig(yAxisState);
|
|
97
|
+
const descriptionWidth = calculateTextWidth(description, ctx, textFont);
|
|
98
|
+
const fontHeight = calculateSymbolHeight(textFont, ctx);
|
|
99
|
+
const paddingTop = (_a = visualLabel.paddingTop) !== null && _a !== void 0 ? _a : DEFAULT_PADDING;
|
|
100
|
+
const paddingBottom = (_b = visualLabel.paddingBottom) !== null && _b !== void 0 ? _b : DEFAULT_PADDING;
|
|
101
|
+
const labelBoxY = centralY - fontHeight / 2 - paddingTop;
|
|
102
|
+
const labelBoxBottom = centralY + fontHeight / 2 + paddingBottom;
|
|
103
|
+
const labelBoxHeight = labelBoxBottom - labelBoxY;
|
|
104
|
+
// do not draw, if description is out of bounds
|
|
105
|
+
if (centralY < labelBounds.y + labelBoxHeight / 2 ||
|
|
106
|
+
centralY > labelBounds.y + labelBounds.height - labelBoxHeight / 2) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
ctx.save();
|
|
110
|
+
// overlay rect
|
|
111
|
+
const width = descriptionWidth + 5;
|
|
112
|
+
const descriptionPadding = 4;
|
|
113
|
+
const rectWidth = descriptionWidth + descriptionPadding * 2;
|
|
114
|
+
const boundsEnd = paneBounds.x + paneBounds.width;
|
|
115
|
+
const x = align === 'right' ? boundsEnd - rectWidth : paneBounds.x + descriptionPadding;
|
|
116
|
+
redrawBackgroundArea(backgroundCtx, ctx, x, labelBoxY, width, labelBoxHeight, 0.8);
|
|
117
|
+
ctx.fillStyle = (_c = visualLabel.descColor) !== null && _c !== void 0 ? _c : visualLabel.bgColor;
|
|
118
|
+
ctx.font = textFont;
|
|
119
|
+
const xTextBounds = align === 'right'
|
|
120
|
+
? boundsEnd - descriptionWidth - descriptionPadding * 2
|
|
121
|
+
: paneBounds.x + descriptionPadding * 2;
|
|
122
|
+
ctx.fillText(description, xTextBounds, centralY + fontHeight / 2 - 1); // -1 for font height adjustment
|
|
123
|
+
ctx.restore();
|
|
124
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
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
6
|
import { Observable } from 'rxjs';
|
|
7
7
|
import { CanvasBoundsContainer } from '../../../canvas/canvas-bounds-container';
|
|
8
|
-
import {
|
|
8
|
+
import { YAxisConfig, YAxisLabelMode } from '../../../chart.config';
|
|
9
9
|
import EventBus from '../../../events/event-bus';
|
|
10
10
|
import { Bounds } from '../../../model/bounds.model';
|
|
11
11
|
import { CanvasModel } from '../../../model/canvas.model';
|
|
12
12
|
import { ChartBaseElement } from '../../../model/chart-base-element';
|
|
13
|
+
import { ScaleModel } from '../../../model/scale.model';
|
|
13
14
|
import { Unit } from '../../../model/scaling/viewport.model';
|
|
14
|
-
import { ChartModel } from '../../chart/chart.model';
|
|
15
15
|
import { YAxisLabelDrawConfig } from '../y-axis-labels.drawer';
|
|
16
16
|
export type YAxisVisualLabelType = 'badge' | 'rectangle' | 'plain';
|
|
17
17
|
export interface VisualYAxisLabel extends YAxisLabelDrawConfig {
|
|
@@ -27,7 +27,7 @@ export interface VisualYAxisLabel extends YAxisLabelDrawConfig {
|
|
|
27
27
|
export interface LabelGroup {
|
|
28
28
|
labels: VisualYAxisLabel[];
|
|
29
29
|
bounds?: Bounds;
|
|
30
|
-
axisState?:
|
|
30
|
+
axisState?: YAxisConfig;
|
|
31
31
|
}
|
|
32
32
|
export type ProviderGroups = Record<string, YAxisLabelsProvider[]>;
|
|
33
33
|
export declare const LabelsGroups: {
|
|
@@ -45,12 +45,13 @@ export declare const LabelsGroups: {
|
|
|
45
45
|
* - ...
|
|
46
46
|
* Anything but the base labels which are generated in other component {@link YAxisBaseLabelsModel}
|
|
47
47
|
*/
|
|
48
|
-
export declare class
|
|
48
|
+
export declare class FancyYAxisLabelsModel extends ChartBaseElement {
|
|
49
49
|
eventBus: EventBus;
|
|
50
|
-
private
|
|
50
|
+
private scale;
|
|
51
51
|
private canvasBoundsContainer;
|
|
52
|
-
private
|
|
52
|
+
private state;
|
|
53
53
|
private canvasModel;
|
|
54
|
+
private paneUUID;
|
|
54
55
|
private updateYAxisWidth;
|
|
55
56
|
orderedLabels: LabelGroup[];
|
|
56
57
|
/**
|
|
@@ -60,7 +61,7 @@ export declare class YAxisLabelsModel extends ChartBaseElement {
|
|
|
60
61
|
private labelsProviders;
|
|
61
62
|
private labelsPositionRecalculatedSubject;
|
|
62
63
|
private animFrameId;
|
|
63
|
-
constructor(eventBus: EventBus,
|
|
64
|
+
constructor(eventBus: EventBus, scale: ScaleModel, canvasBoundsContainer: CanvasBoundsContainer, state: YAxisConfig, canvasModel: CanvasModel, paneUUID: string, updateYAxisWidth: () => void);
|
|
64
65
|
/**
|
|
65
66
|
* This method is used to activate the chart and subscribe to the observables that will trigger the update of the labels.
|
|
66
67
|
* It calls the parent method doActivate() and adds a new Rx subscription to the merge of the following observables:
|
|
@@ -68,7 +69,7 @@ export declare class YAxisLabelsModel extends ChartBaseElement {
|
|
|
68
69
|
* - canvasBoundsContainer.observeBoundsChanged(CanvasElement.CHART)
|
|
69
70
|
* - chartModel.nextCandleTimeStampSubject
|
|
70
71
|
* - canvasBoundsContainer.barResizerChangedSubject
|
|
71
|
-
* - chartModel.
|
|
72
|
+
* - chartModel.scale.changed
|
|
72
73
|
* When any of these observables emit a new value, the updateLabels() method is called.
|
|
73
74
|
* @protected
|
|
74
75
|
*/
|
|
@@ -1,6 +1,206 @@
|
|
|
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 { merge, Subject } from 'rxjs';
|
|
7
|
+
import { CanvasElement } from '../../../canvas/canvas-bounds-container';
|
|
8
|
+
import { ChartBaseElement } from '../../../model/chart-base-element';
|
|
9
|
+
import { flat } from '../../../utils/array.utils';
|
|
10
|
+
import { animationFrameThrottledPrior } from '../../../utils/performance/request-animation-frame-throttle.utils';
|
|
11
|
+
import { uuid } from '../../../utils/uuid.utils';
|
|
12
|
+
import { calcLabelsYCoordinates } from './labels-positions-calculator';
|
|
13
|
+
export const LabelsGroups = {
|
|
14
|
+
MAIN: 'MAIN',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Different labels on Y axis:
|
|
18
|
+
* - last candle price
|
|
19
|
+
* - bid/ask
|
|
20
|
+
* - countdown
|
|
21
|
+
* - prev.day price
|
|
22
|
+
* - high low in viewport
|
|
23
|
+
* - drawings
|
|
24
|
+
* - studies
|
|
25
|
+
* - ...
|
|
26
|
+
* Anything but the base labels which are generated in other component {@link YAxisBaseLabelsModel}
|
|
27
|
+
*/
|
|
28
|
+
export class FancyYAxisLabelsModel extends ChartBaseElement {
|
|
29
|
+
constructor(eventBus, scale, canvasBoundsContainer, state, canvasModel, paneUUID, updateYAxisWidth) {
|
|
30
|
+
super();
|
|
31
|
+
this.eventBus = eventBus;
|
|
32
|
+
this.scale = scale;
|
|
33
|
+
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
34
|
+
this.state = state;
|
|
35
|
+
this.canvasModel = canvasModel;
|
|
36
|
+
this.paneUUID = paneUUID;
|
|
37
|
+
this.updateYAxisWidth = updateYAxisWidth;
|
|
38
|
+
this.orderedLabels = [];
|
|
39
|
+
/**
|
|
40
|
+
* an easier way to manage custom y-axis labels, than y-axis labels providers, but doesn't support overlapping avoidance
|
|
41
|
+
*/
|
|
42
|
+
this.customLabels = {};
|
|
43
|
+
this.labelsProviders = {};
|
|
44
|
+
this.labelsPositionRecalculatedSubject = new Subject();
|
|
45
|
+
this.animFrameId = `anim_cache_${uuid()}`;
|
|
46
|
+
this.initModel();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* This method is used to activate the chart and subscribe to the observables that will trigger the update of the labels.
|
|
50
|
+
* It calls the parent method doActivate() and adds a new Rx subscription to the merge of the following observables:
|
|
51
|
+
* - chartModel.observeCandlesChanged()
|
|
52
|
+
* - canvasBoundsContainer.observeBoundsChanged(CanvasElement.CHART)
|
|
53
|
+
* - chartModel.nextCandleTimeStampSubject
|
|
54
|
+
* - canvasBoundsContainer.barResizerChangedSubject
|
|
55
|
+
* - chartModel.scale.changed
|
|
56
|
+
* When any of these observables emit a new value, the updateLabels() method is called.
|
|
57
|
+
* @protected
|
|
58
|
+
*/
|
|
59
|
+
doActivate() {
|
|
60
|
+
super.doActivate();
|
|
61
|
+
this.addRxSubscription(merge(this.canvasBoundsContainer.observeBoundsChanged(CanvasElement.PANE_UUID(this.paneUUID)), this.canvasBoundsContainer.barResizerChangedSubject, this.scale.changed).subscribe(() => {
|
|
62
|
+
this.updateLabels();
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Initializes the model by calling the methods to initialize the label groups and recalculate the labels.
|
|
67
|
+
* Then, it fires the draw event on the canvas model.
|
|
68
|
+
* @private
|
|
69
|
+
*/
|
|
70
|
+
initModel() {
|
|
71
|
+
this.initLabelsGroups();
|
|
72
|
+
this.recalculateLabels();
|
|
73
|
+
this.canvasModel.fireDraw();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Initializes the labels groups.
|
|
77
|
+
* If there are labels providers, it creates a group for each one and adds the providers to their respective groups.
|
|
78
|
+
* @returns {void}
|
|
79
|
+
*/
|
|
80
|
+
initLabelsGroups() {
|
|
81
|
+
for (const groupName of Object.keys(this.labelsProviders)) {
|
|
82
|
+
this.createGroup(groupName);
|
|
83
|
+
Object.entries(this.labelsProviders[groupName]).forEach(([id, provider]) => {
|
|
84
|
+
this.addToGroup(provider, groupName, id);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Updates YAxis ordered labels.
|
|
90
|
+
* @param adjustYAxisWidth - provide "true", if you need to adjust width after new labels will be calculated.
|
|
91
|
+
*/
|
|
92
|
+
updateLabels(adjustYAxisWidth = false) {
|
|
93
|
+
// Updating labels is an expensive operation, and depends on chart data.
|
|
94
|
+
// Animation frame is needed here, because recalculation can be proceeded while rendering, and make render process fregmented.
|
|
95
|
+
this.recalculateLabels();
|
|
96
|
+
animationFrameThrottledPrior(this.animFrameId, () => {
|
|
97
|
+
adjustYAxisWidth && this.updateYAxisWidth();
|
|
98
|
+
this.canvasModel.fireDraw();
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Recalculates the labels based on the current configuration and label providers.
|
|
103
|
+
* It generates label groups and calculates their coordinates based on their weight and the label height.
|
|
104
|
+
* The coordinates are generated in the order they were passed to the generator.
|
|
105
|
+
* The ordered labels are then updated with the new coordinates and reversed.
|
|
106
|
+
* @returns {void}
|
|
107
|
+
*/
|
|
108
|
+
recalculateLabels() {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
this.orderedLabels = [];
|
|
111
|
+
const labelHeight = this.state.fontSize + ((_a = this.state.labelBoxMargin.top) !== null && _a !== void 0 ? _a : 0) + ((_b = this.state.labelBoxMargin.bottom) !== null && _b !== void 0 ? _b : 0);
|
|
112
|
+
for (const providers of Object.values(this.labelsProviders)) {
|
|
113
|
+
// generated label groups
|
|
114
|
+
const labelGroups = flat(Object.values(providers).map(c => c.getUnorderedLabels()));
|
|
115
|
+
const labelsPointsAndWeight = flat(labelGroups.map(g => g.labels)).map(label => {
|
|
116
|
+
var _a;
|
|
117
|
+
return ({
|
|
118
|
+
y: label.y,
|
|
119
|
+
weight: (_a = label.labelWeight) !== null && _a !== void 0 ? _a : Number.POSITIVE_INFINITY,
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
// coordinates are generated in order they were passed to generator
|
|
123
|
+
const updatedCoordinates = calcLabelsYCoordinates(labelsPointsAndWeight, labelHeight);
|
|
124
|
+
labelGroups.forEach(labelGroup => {
|
|
125
|
+
const points = updatedCoordinates.splice(0, labelGroup.labels.length);
|
|
126
|
+
this.orderedLabels.push(this.updateLabelsCoordinates(labelGroup, points));
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
this.orderedLabels = this.orderedLabels.reverse();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Creates a new group with the given name if it doesn't exist yet.
|
|
133
|
+
* @param {string} groupName - The name of the group to be created.
|
|
134
|
+
* @returns {void}
|
|
135
|
+
*/
|
|
136
|
+
createGroup(groupName) {
|
|
137
|
+
!this.labelsProviders[groupName] && (this.labelsProviders[groupName] = {});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Adds a YAxisLabelsProvider component to a group.
|
|
141
|
+
*
|
|
142
|
+
* @param {YAxisLabelsProvider} component - The component to add to the group.
|
|
143
|
+
* @param {string} groupName - The name of the group to add the component to.
|
|
144
|
+
* @param {string} id - The id of the component to add to the group.
|
|
145
|
+
* @returns {void}
|
|
146
|
+
*/
|
|
147
|
+
addToGroup(component, groupName, id) {
|
|
148
|
+
if (this.labelsProviders[groupName]) {
|
|
149
|
+
if (!Object.values(this.labelsProviders[groupName]).includes(component)) {
|
|
150
|
+
this.labelsProviders[groupName][id] = component;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Updates the coordinates of the labels in a LabelGroup object based on an array of points.
|
|
156
|
+
* @param {LabelGroup} labels - The LabelGroup object containing the labels to be updated.
|
|
157
|
+
* @param {number[]} points - An array of points to be used to update the y-coordinate of each label.
|
|
158
|
+
* @returns {LabelGroup} - A new LabelGroup object with updated label coordinates.
|
|
159
|
+
*/
|
|
160
|
+
updateLabelsCoordinates(labels, points) {
|
|
161
|
+
return Object.assign(Object.assign({}, labels), { labels: labels.labels.map((label, idx) => (Object.assign(Object.assign({}, label), {
|
|
162
|
+
// save original y
|
|
163
|
+
lineY: label.y, y: points[idx] }))) });
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Returns an Observable that emits a void value whenever the labels position is recalculated.
|
|
167
|
+
* The Observable is created from the labelsPositionRecalculatedSubject Subject.
|
|
168
|
+
* @returns {Observable<void>} An Observable that emits a void value whenever the labels position is recalculated.
|
|
169
|
+
*/
|
|
170
|
+
observeLabelsPositionsRecalculated() {
|
|
171
|
+
return this.labelsPositionRecalculatedSubject.asObservable();
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Registers a Y axis labels provider for a given group name and ID.
|
|
175
|
+
*
|
|
176
|
+
* @param {string} groupName - The name of the group to which the provider belongs.
|
|
177
|
+
* @param {YAxisLabelsProvider} provider - The provider to be registered.
|
|
178
|
+
* @param {string} id - The ID of the provider to be registered.
|
|
179
|
+
* @returns {void}
|
|
180
|
+
*/
|
|
181
|
+
registerYAxisLabelsProvider(groupName, provider, id) {
|
|
182
|
+
var _a;
|
|
183
|
+
const providers = (_a = this.labelsProviders[groupName]) !== null && _a !== void 0 ? _a : {};
|
|
184
|
+
providers[id] = provider;
|
|
185
|
+
this.labelsProviders[groupName] = providers;
|
|
186
|
+
this.initModel();
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Unregisters a Y axis labels provider.
|
|
190
|
+
*
|
|
191
|
+
* @param {string} groupName - The name of the group to which the provider belongs.
|
|
192
|
+
* @param {string} id - The ID of the provider to unregister.
|
|
193
|
+
*
|
|
194
|
+
* @returns {void}
|
|
195
|
+
*/
|
|
196
|
+
unregisterYAxisLabelsProvider(groupName, id) {
|
|
197
|
+
var _a;
|
|
198
|
+
const providers = (_a = this.labelsProviders[groupName]) !== null && _a !== void 0 ? _a : {};
|
|
199
|
+
delete providers[id];
|
|
200
|
+
// if group is empty, delete it too
|
|
201
|
+
if (this.labelsProviders[groupName] && Object.keys(this.labelsProviders[groupName]).length === 0) {
|
|
202
|
+
delete this.labelsProviders[groupName];
|
|
203
|
+
}
|
|
204
|
+
this.initModel();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -1,23 +1,22 @@
|
|
|
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
6
|
import { CanvasBoundsContainer } from '../../../canvas/canvas-bounds-container';
|
|
7
|
-
import {
|
|
7
|
+
import { FullChartColors } from '../../../chart.config';
|
|
8
8
|
import { Drawer } from '../../../drawers/drawing-manager';
|
|
9
9
|
import { CanvasModel } from '../../../model/canvas.model';
|
|
10
|
-
import {
|
|
10
|
+
import { PaneManager } from '../../pane/pane-manager.component';
|
|
11
|
+
import { LabelGroup } from './y-axis-labels.model';
|
|
11
12
|
export declare class YAxisPriceLabelsDrawer implements Drawer {
|
|
12
|
-
private labelsProvider;
|
|
13
13
|
private yAxisLabelsCanvasModel;
|
|
14
14
|
private backgroundCanvasModel;
|
|
15
|
-
private yAxisState;
|
|
16
15
|
private canvasBoundsContainer;
|
|
17
16
|
private yAxisColors;
|
|
18
|
-
private
|
|
19
|
-
constructor(
|
|
17
|
+
private paneManager;
|
|
18
|
+
constructor(yAxisLabelsCanvasModel: CanvasModel, backgroundCanvasModel: CanvasModel, canvasBoundsContainer: CanvasBoundsContainer, yAxisColors: FullChartColors['yAxis'], paneManager: PaneManager);
|
|
20
19
|
draw(): void;
|
|
21
|
-
drawHighlightedBackgroundBetweenLabels(): void;
|
|
20
|
+
drawHighlightedBackgroundBetweenLabels(orderedLabels: LabelGroup[]): void;
|
|
22
21
|
getCanvasIds(): Array<string>;
|
|
23
22
|
}
|
|
@@ -1,6 +1,63 @@
|
|
|
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{CanvasElement
|
|
6
|
+
import { CanvasElement, CHART_UUID, limitYToBounds, } from '../../../canvas/canvas-bounds-container';
|
|
7
|
+
import { fillRect } from '../../../utils/canvas/canvas-drawing-functions.utils';
|
|
8
|
+
import { drawLabel } from './price-label.drawer';
|
|
9
|
+
export class YAxisPriceLabelsDrawer {
|
|
10
|
+
constructor(yAxisLabelsCanvasModel, backgroundCanvasModel, canvasBoundsContainer, yAxisColors, paneManager) {
|
|
11
|
+
this.yAxisLabelsCanvasModel = yAxisLabelsCanvasModel;
|
|
12
|
+
this.backgroundCanvasModel = backgroundCanvasModel;
|
|
13
|
+
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
14
|
+
this.yAxisColors = yAxisColors;
|
|
15
|
+
this.paneManager = paneManager;
|
|
16
|
+
}
|
|
17
|
+
draw() {
|
|
18
|
+
const ctx = this.yAxisLabelsCanvasModel.ctx;
|
|
19
|
+
const backgroundCtx = this.backgroundCanvasModel.ctx;
|
|
20
|
+
this.paneManager.yExtents.forEach(extent => {
|
|
21
|
+
const yAxisBounds = extent.getYAxisBounds();
|
|
22
|
+
const paneBounds = this.canvasBoundsContainer.getBounds(CanvasElement.ALL_PANES);
|
|
23
|
+
const orderedLabels = extent.yAxis.model.fancyLabelsModel.orderedLabels;
|
|
24
|
+
this.drawHighlightedBackgroundBetweenLabels(orderedLabels);
|
|
25
|
+
orderedLabels.forEach(l => {
|
|
26
|
+
var _a;
|
|
27
|
+
const bounds = (_a = l.bounds) !== null && _a !== void 0 ? _a : yAxisBounds;
|
|
28
|
+
l.labels.forEach(vl => drawLabel(ctx, backgroundCtx, bounds, paneBounds, vl, this.canvasBoundsContainer, extent.yAxis.state, this.yAxisColors));
|
|
29
|
+
});
|
|
30
|
+
// TODO I added this as a simple mechanism to add custom labels, we need to review it
|
|
31
|
+
Object.values(extent.yAxis.model.fancyLabelsModel.customLabels).forEach(l => drawLabel(ctx, backgroundCtx, yAxisBounds, paneBounds, l, this.canvasBoundsContainer, extent.yAxis.state, this.yAxisColors));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
// this is a very simple solution which matches 2 labels with same "subGroupId"
|
|
35
|
+
// in future we may want to change it, but for now it's enough
|
|
36
|
+
// and I guess it used only for drawings
|
|
37
|
+
drawHighlightedBackgroundBetweenLabels(orderedLabels) {
|
|
38
|
+
const ctx = this.yAxisLabelsCanvasModel.ctx;
|
|
39
|
+
const map = {};
|
|
40
|
+
orderedLabels.forEach(group => {
|
|
41
|
+
group.labels.forEach(label => {
|
|
42
|
+
var _a, _b, _c;
|
|
43
|
+
if (label.subGroupId) {
|
|
44
|
+
const labels = (_a = map[label.subGroupId]) !== null && _a !== void 0 ? _a : [];
|
|
45
|
+
map[label.subGroupId] = labels;
|
|
46
|
+
labels.push(label);
|
|
47
|
+
if (labels.length === 2) {
|
|
48
|
+
const bounds = (_b = group.bounds) !== null && _b !== void 0 ? _b : this.canvasBoundsContainer.getBounds(CanvasElement.PANE_UUID_Y_AXIS(CHART_UUID));
|
|
49
|
+
ctx.save();
|
|
50
|
+
ctx.fillStyle = (_c = labels[0].highlightColor) !== null && _c !== void 0 ? _c : labels[0].bgColor;
|
|
51
|
+
// start and end are sorted in ascending order
|
|
52
|
+
const [startY, endY] = labels[0].y > labels[1].y ? [labels[1].y, labels[0].y] : [labels[0].y, labels[1].y];
|
|
53
|
+
fillRect(ctx, { x: bounds.x, y: limitYToBounds(startY, bounds) }, { x: bounds.x + bounds.width - 6, y: limitYToBounds(endY, bounds) });
|
|
54
|
+
ctx.restore();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
getCanvasIds() {
|
|
61
|
+
return [this.yAxisLabelsCanvasModel.canvasId];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -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
|
*/
|
|
@@ -8,16 +8,18 @@ import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
|
|
|
8
8
|
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
9
9
|
import { ScaleModel } from '../../model/scale.model';
|
|
10
10
|
export declare class YAxisBaseLabelsModel extends ChartBaseElement {
|
|
11
|
-
private
|
|
12
|
-
private
|
|
11
|
+
private scale;
|
|
12
|
+
private labelsGenerator;
|
|
13
13
|
private canvasBoundsContainer;
|
|
14
|
+
private paneUUID;
|
|
15
|
+
private extentIdx;
|
|
14
16
|
labels: Array<NumericAxisLabel>;
|
|
15
17
|
private prevYAxisHeight;
|
|
16
18
|
private animFrameId;
|
|
17
|
-
constructor(
|
|
19
|
+
constructor(scale: ScaleModel, labelsGenerator: NumericAxisLabelsGenerator, canvasBoundsContainer: CanvasBoundsContainer, paneUUID: string, extentIdx: number);
|
|
18
20
|
/**
|
|
19
21
|
* This method is used to activate the component. It calls the parent's doActivate method and subscribes to the merge of two observables:
|
|
20
|
-
* - this.
|
|
22
|
+
* - this.scale.yChanged
|
|
21
23
|
* - this.canvasBoundsContainer.observeBoundsChanged
|
|
22
24
|
* The merge of these two observables is used to update the labels of the component when either the y-axis scale model changes or the canvas bounds change.
|
|
23
25
|
* If the height of the canvas bounds changes by more than 1.5 times the previous height, the labels cache is invalidated and the previous y-axis height is updated.
|
|
@@ -1,6 +1,52 @@
|
|
|
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 { merge } from 'rxjs';
|
|
7
|
+
import { filter, map, tap } from 'rxjs/operators';
|
|
8
|
+
import { CanvasElement } from '../../canvas/canvas-bounds-container';
|
|
9
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
10
|
+
import { uuid } from '../../utils/uuid.utils';
|
|
11
|
+
import { animationFrameThrottledPrior } from '../../utils/performance/request-animation-frame-throttle.utils';
|
|
12
|
+
import { isDiffersBy } from '../../utils/math.utils';
|
|
13
|
+
// TODO rework, make this the source of Y labels for main chart
|
|
14
|
+
export class YAxisBaseLabelsModel extends ChartBaseElement {
|
|
15
|
+
constructor(scale, labelsGenerator, canvasBoundsContainer, paneUUID, extentIdx) {
|
|
16
|
+
super();
|
|
17
|
+
this.scale = scale;
|
|
18
|
+
this.labelsGenerator = labelsGenerator;
|
|
19
|
+
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
20
|
+
this.paneUUID = paneUUID;
|
|
21
|
+
this.extentIdx = extentIdx;
|
|
22
|
+
this.labels = [];
|
|
23
|
+
this.prevYAxisHeight = 0;
|
|
24
|
+
this.animFrameId = `anim_cache_${uuid()}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* This method is used to activate the component. It calls the parent's doActivate method and subscribes to the merge of two observables:
|
|
28
|
+
* - this.scale.yChanged
|
|
29
|
+
* - this.canvasBoundsContainer.observeBoundsChanged
|
|
30
|
+
* The merge of these two observables is used to update the labels of the component when either the y-axis scale model changes or the canvas bounds change.
|
|
31
|
+
* If the height of the canvas bounds changes by more than 1.5 times the previous height, the labels cache is invalidated and the previous y-axis height is updated.
|
|
32
|
+
*/
|
|
33
|
+
doActivate() {
|
|
34
|
+
super.doActivate();
|
|
35
|
+
this.addRxSubscription(merge(this.scale.yChanged, this.canvasBoundsContainer
|
|
36
|
+
.observeBoundsChanged(CanvasElement.PANE_UUID_Y_AXIS(this.paneUUID, this.extentIdx))
|
|
37
|
+
.pipe(map(bounds => bounds.height),
|
|
38
|
+
// do not recalculate height every time bounds is changed, recalculate only if it differs by 1.5 times
|
|
39
|
+
filter(height => isDiffersBy(height, this.prevYAxisHeight, 1.5)), tap(height => {
|
|
40
|
+
this.labelsGenerator.labelsCache.invalidate();
|
|
41
|
+
this.prevYAxisHeight = height;
|
|
42
|
+
}))).subscribe(() => this.updateLabels()));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Updates the labels of the chart's y-axis by generating new numeric labels using the yAxisLabelsGenerator object.
|
|
46
|
+
* Then, it calls the updateYAxisWidth method to update the width of the y-axis.
|
|
47
|
+
*/
|
|
48
|
+
updateLabels() {
|
|
49
|
+
this.labels = this.labelsGenerator.generateNumericLabels();
|
|
50
|
+
animationFrameThrottledPrior(this.animFrameId, () => this.canvasBoundsContainer.updateYAxisWidths());
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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 { YAxisConfig, FullChartColors } from '../../chart.config';
|
|
7
7
|
import { Bounds } from '../../model/bounds.model';
|
|
8
8
|
export interface YAxisLabelDrawProps {
|
|
9
9
|
ctx: CanvasRenderingContext2D;
|
|
@@ -37,7 +37,7 @@ export declare const DEFAULT_PRICE_LABEL_PADDING = 4;
|
|
|
37
37
|
* @param align
|
|
38
38
|
* @param yAxisState
|
|
39
39
|
*/
|
|
40
|
-
export declare function drawBadgeLabel(ctx: CanvasRenderingContext2D, bounds: Bounds, text: string, centralY: number, config: YAxisLabelDrawConfig, yAxisState:
|
|
40
|
+
export declare function drawBadgeLabel(ctx: CanvasRenderingContext2D, bounds: Bounds, text: string, centralY: number, config: YAxisLabelDrawConfig, yAxisState: YAxisConfig, yAxisColors: FullChartColors['yAxis'], drawOutside?: boolean): void;
|
|
41
41
|
/**
|
|
42
42
|
* Draws rectangle label on Y axis with provided parameters.
|
|
43
43
|
* @param ctx - canvas 2D context to draw on
|
|
@@ -48,7 +48,7 @@ export declare function drawBadgeLabel(ctx: CanvasRenderingContext2D, bounds: Bo
|
|
|
48
48
|
* @param align
|
|
49
49
|
* @param yAxisState
|
|
50
50
|
*/
|
|
51
|
-
export declare function drawRectLabel(ctx: CanvasRenderingContext2D, bounds: Bounds, text: string, centralY: number, config: YAxisLabelDrawConfig, yAxisState:
|
|
51
|
+
export declare function drawRectLabel(ctx: CanvasRenderingContext2D, bounds: Bounds, text: string, centralY: number, config: YAxisLabelDrawConfig, yAxisState: YAxisConfig, yAxisColors: FullChartColors['yAxis'], drawOutside?: boolean): void;
|
|
52
52
|
/**
|
|
53
53
|
* Draws rectangle label on Y axis with provided parameters but with transparent background.
|
|
54
54
|
* @param ctx - canvas 2D context to draw on
|
|
@@ -59,7 +59,7 @@ export declare function drawRectLabel(ctx: CanvasRenderingContext2D, bounds: Bou
|
|
|
59
59
|
* @param align
|
|
60
60
|
* @param yAxisState
|
|
61
61
|
*/
|
|
62
|
-
export declare function drawPlainLabel(ctx: CanvasRenderingContext2D, bounds: Bounds, text: string, centralY: number, config: YAxisLabelDrawConfig, yAxisState:
|
|
62
|
+
export declare function drawPlainLabel(ctx: CanvasRenderingContext2D, bounds: Bounds, text: string, centralY: number, config: YAxisLabelDrawConfig, yAxisState: YAxisConfig, yAxisColors: FullChartColors['yAxis'], drawOutside?: boolean, backgroundCtx?: CanvasRenderingContext2D): void;
|
|
63
63
|
/**
|
|
64
64
|
* Offset from the center of label to the top/bottom.
|
|
65
65
|
*
|