@devexperts/dxcharts-lite 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +151 -0
- package/README.md +184 -0
- package/dist/chart/animation/canvas-animation.d.ts +96 -0
- package/dist/chart/animation/canvas-animation.js +6 -0
- package/dist/chart/animation/types/animation.d.ts +35 -0
- package/dist/chart/animation/types/animation.js +6 -0
- package/dist/chart/animation/types/color-alpha-animation.d.ts +43 -0
- package/dist/chart/animation/types/color-alpha-animation.js +6 -0
- package/dist/chart/animation/types/color-transition-animation.d.ts +59 -0
- package/dist/chart/animation/types/color-transition-animation.js +6 -0
- package/dist/chart/animation/types/viewport-movement-animation.d.ts +44 -0
- package/dist/chart/animation/types/viewport-movement-animation.js +6 -0
- package/dist/chart/animation/viewport-model-animation.d.ts +15 -0
- package/dist/chart/animation/viewport-model-animation.js +6 -0
- package/dist/chart/bootstrap.d.ts +266 -0
- package/dist/chart/bootstrap.js +6 -0
- package/dist/chart/canvas/canvas-bounds-container.d.ts +347 -0
- package/dist/chart/canvas/canvas-bounds-container.js +6 -0
- package/dist/chart/canvas/canvas-chart-html.d.ts +7 -0
- package/dist/chart/canvas/canvas-chart-html.js +23 -0
- package/dist/chart/canvas/chart-elements.d.ts +22 -0
- package/dist/chart/canvas/chart-elements.js +6 -0
- package/dist/chart/canvas/cursor.handler.d.ts +71 -0
- package/dist/chart/canvas/cursor.handler.js +6 -0
- package/dist/chart/canvas/layout-creator.d.ts +20 -0
- package/dist/chart/canvas/layout-creator.js +6 -0
- package/dist/chart/canvas/y-axis-bounds.container.d.ts +54 -0
- package/dist/chart/canvas/y-axis-bounds.container.js +6 -0
- package/dist/chart/chart-container.d.ts +18 -0
- package/dist/chart/chart-container.js +6 -0
- package/dist/chart/chart.config.d.ts +774 -0
- package/dist/chart/chart.config.js +6 -0
- package/dist/chart/components/chart/basic-scale.d.ts +22 -0
- package/dist/chart/components/chart/basic-scale.js +6 -0
- package/dist/chart/components/chart/candle-transformer.functions.d.ts +11 -0
- package/dist/chart/components/chart/candle-transformer.functions.js +6 -0
- package/dist/chart/components/chart/candle-width-calculator.functions.d.ts +7 -0
- package/dist/chart/components/chart/candle-width-calculator.functions.js +6 -0
- package/dist/chart/components/chart/candle.functions.d.ts +19 -0
- package/dist/chart/components/chart/candle.functions.js +6 -0
- package/dist/chart/components/chart/chart-area-pan.handler.d.ts +88 -0
- package/dist/chart/components/chart/chart-area-pan.handler.js +6 -0
- package/dist/chart/components/chart/chart-base.model.d.ts +55 -0
- package/dist/chart/components/chart/chart-base.model.js +6 -0
- package/dist/chart/components/chart/chart.component.d.ts +251 -0
- package/dist/chart/components/chart/chart.component.js +6 -0
- package/dist/chart/components/chart/chart.model.d.ts +448 -0
- package/dist/chart/components/chart/chart.model.js +6 -0
- package/dist/chart/components/chart/data-series.high-low-provider.d.ts +25 -0
- package/dist/chart/components/chart/data-series.high-low-provider.js +6 -0
- package/dist/chart/components/chart/fake-candles.d.ts +18 -0
- package/dist/chart/components/chart/fake-candles.js +6 -0
- package/dist/chart/components/chart/price.formatter.d.ts +12 -0
- package/dist/chart/components/chart/price.formatter.js +6 -0
- package/dist/chart/components/chart/secondary-chart-colors-pool.d.ts +43 -0
- package/dist/chart/components/chart/secondary-chart-colors-pool.js +6 -0
- package/dist/chart/components/cross_tool/cross-tool.component.d.ts +69 -0
- package/dist/chart/components/cross_tool/cross-tool.component.js +6 -0
- package/dist/chart/components/cross_tool/cross-tool.drawer.d.ts +32 -0
- package/dist/chart/components/cross_tool/cross-tool.drawer.js +6 -0
- package/dist/chart/components/cross_tool/cross-tool.model.d.ts +63 -0
- package/dist/chart/components/cross_tool/cross-tool.model.js +6 -0
- package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.d.ts +44 -0
- package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.js +6 -0
- package/dist/chart/components/cross_tool/types/none.drawer.d.ts +9 -0
- package/dist/chart/components/cross_tool/types/none.drawer.js +6 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.d.ts +27 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.js +6 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.d.ts +23 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.js +6 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.d.ts +46 -0
- package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.js +6 -0
- package/dist/chart/components/events/events-hit-test.drawer.d.ts +34 -0
- package/dist/chart/components/events/events-hit-test.drawer.js +6 -0
- package/dist/chart/components/events/events.component.d.ts +45 -0
- package/dist/chart/components/events/events.component.js +6 -0
- package/dist/chart/components/events/events.drawer.d.ts +87 -0
- package/dist/chart/components/events/events.drawer.js +6 -0
- package/dist/chart/components/events/events.model.d.ts +64 -0
- package/dist/chart/components/events/events.model.js +6 -0
- package/dist/chart/components/grid/grid.component.d.ts +34 -0
- package/dist/chart/components/grid/grid.component.js +6 -0
- package/dist/chart/components/grid/grid.drawer.d.ts +55 -0
- package/dist/chart/components/grid/grid.drawer.js +6 -0
- package/dist/chart/components/high_low/high-low.component.d.ts +17 -0
- package/dist/chart/components/high_low/high-low.component.js +6 -0
- package/dist/chart/components/high_low/high-low.drawer.d.ts +69 -0
- package/dist/chart/components/high_low/high-low.drawer.js +6 -0
- package/dist/chart/components/highlights/highlights.component.d.ts +42 -0
- package/dist/chart/components/highlights/highlights.component.js +6 -0
- package/dist/chart/components/highlights/highlights.drawer.d.ts +56 -0
- package/dist/chart/components/highlights/highlights.drawer.js +6 -0
- package/dist/chart/components/highlights/highlights.model.d.ts +66 -0
- package/dist/chart/components/highlights/highlights.model.js +6 -0
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.d.ts +63 -0
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.js +6 -0
- package/dist/chart/components/navigation_map/navigation-map-move.handler.d.ts +36 -0
- package/dist/chart/components/navigation_map/navigation-map-move.handler.js +6 -0
- package/dist/chart/components/navigation_map/navigation-map.component.d.ts +52 -0
- package/dist/chart/components/navigation_map/navigation-map.component.js +6 -0
- package/dist/chart/components/navigation_map/navigation-map.drawer.d.ts +96 -0
- package/dist/chart/components/navigation_map/navigation-map.drawer.js +6 -0
- package/dist/chart/components/navigation_map/navigation-map.model.d.ts +25 -0
- package/dist/chart/components/navigation_map/navigation-map.model.js +7 -0
- package/dist/chart/components/pan/chart-pan.component.d.ts +52 -0
- package/dist/chart/components/pan/chart-pan.component.js +6 -0
- package/dist/chart/components/pane/extent/y-extent-component.d.ts +91 -0
- package/dist/chart/components/pane/extent/y-extent-component.js +6 -0
- package/dist/chart/components/pane/pane-hit-test.controller.d.ts +39 -0
- package/dist/chart/components/pane/pane-hit-test.controller.js +6 -0
- package/dist/chart/components/pane/pane-manager.component.d.ts +87 -0
- package/dist/chart/components/pane/pane-manager.component.js +6 -0
- package/dist/chart/components/pane/pane.component.d.ts +193 -0
- package/dist/chart/components/pane/pane.component.js +6 -0
- package/dist/chart/components/resizer/bar-resizer.component.d.ts +72 -0
- package/dist/chart/components/resizer/bar-resizer.component.js +6 -0
- package/dist/chart/components/resizer/bar-resizer.drawer.d.ts +34 -0
- package/dist/chart/components/resizer/bar-resizer.drawer.js +6 -0
- package/dist/chart/components/snapshot/snapshot.component.d.ts +31 -0
- package/dist/chart/components/snapshot/snapshot.component.js +6 -0
- package/dist/chart/components/volumes/separate-volumes.component.d.ts +45 -0
- package/dist/chart/components/volumes/separate-volumes.component.js +6 -0
- package/dist/chart/components/volumes/volume-color-resolvers.functions.d.ts +11 -0
- package/dist/chart/components/volumes/volume-color-resolvers.functions.js +6 -0
- package/dist/chart/components/volumes/volumes.component.d.ts +59 -0
- package/dist/chart/components/volumes/volumes.component.js +6 -0
- package/dist/chart/components/volumes/volumes.drawer.d.ts +71 -0
- package/dist/chart/components/volumes/volumes.drawer.js +6 -0
- package/dist/chart/components/volumes/volumes.formatter.d.ts +6 -0
- package/dist/chart/components/volumes/volumes.formatter.js +6 -0
- package/dist/chart/components/volumes/volumes.model.d.ts +32 -0
- package/dist/chart/components/volumes/volumes.model.js +6 -0
- package/dist/chart/components/watermark/water-mark.component.d.ts +75 -0
- package/dist/chart/components/watermark/water-mark.component.js +6 -0
- package/dist/chart/components/watermark/water-mark.drawer.d.ts +68 -0
- package/dist/chart/components/watermark/water-mark.drawer.js +6 -0
- package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.d.ts +25 -0
- package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.js +6 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.d.ts +55 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.js +6 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.d.ts +23 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.js +6 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.d.ts +28 -0
- package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.js +6 -0
- package/dist/chart/components/x_axis/time/parser/time-formats.model.d.ts +33 -0
- package/dist/chart/components/x_axis/time/parser/time-formats.model.js +6 -0
- package/dist/chart/components/x_axis/time/x-axis-weights.functions.d.ts +62 -0
- package/dist/chart/components/x_axis/time/x-axis-weights.functions.js +6 -0
- package/dist/chart/components/x_axis/time/x-axis-weights.generator.d.ts +33 -0
- package/dist/chart/components/x_axis/time/x-axis-weights.generator.js +6 -0
- package/dist/chart/components/x_axis/x-axis-draw.functions.d.ts +17 -0
- package/dist/chart/components/x_axis/x-axis-draw.functions.js +6 -0
- package/dist/chart/components/x_axis/x-axis-labels.drawer.d.ts +42 -0
- package/dist/chart/components/x_axis/x-axis-labels.drawer.js +6 -0
- package/dist/chart/components/x_axis/x-axis-labels.generator.d.ts +141 -0
- package/dist/chart/components/x_axis/x-axis-labels.generator.js +6 -0
- package/dist/chart/components/x_axis/x-axis-labels.model.d.ts +39 -0
- package/dist/chart/components/x_axis/x-axis-labels.model.js +6 -0
- package/dist/chart/components/x_axis/x-axis-scale.handler.d.ts +38 -0
- package/dist/chart/components/x_axis/x-axis-scale.handler.js +6 -0
- package/dist/chart/components/x_axis/x-axis-time-labels.drawer.d.ts +54 -0
- package/dist/chart/components/x_axis/x-axis-time-labels.drawer.js +6 -0
- package/dist/chart/components/x_axis/x-axis.component.d.ts +73 -0
- package/dist/chart/components/x_axis/x-axis.component.js +6 -0
- package/dist/chart/components/y_axis/label-color.functions.d.ts +18 -0
- package/dist/chart/components/y_axis/label-color.functions.js +6 -0
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.d.ts +22 -0
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.js +6 -0
- package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.d.ts +33 -0
- package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.js +6 -0
- package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.d.ts +27 -0
- package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.js +6 -0
- package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.d.ts +35 -0
- package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.js +6 -0
- package/dist/chart/components/y_axis/price_labels/price-label.drawer.d.ts +23 -0
- package/dist/chart/components/y_axis/price_labels/price-label.drawer.js +6 -0
- package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.d.ts +159 -0
- package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.js +6 -0
- package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.d.ts +23 -0
- package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.js +6 -0
- package/dist/chart/components/y_axis/y-axis-base-labels.model.d.ts +31 -0
- package/dist/chart/components/y_axis/y-axis-base-labels.model.js +6 -0
- package/dist/chart/components/y_axis/y-axis-labels.drawer.d.ts +70 -0
- package/dist/chart/components/y_axis/y-axis-labels.drawer.js +6 -0
- package/dist/chart/components/y_axis/y-axis-scale.handler.d.ts +32 -0
- package/dist/chart/components/y_axis/y-axis-scale.handler.js +6 -0
- package/dist/chart/components/y_axis/y-axis.component.d.ts +158 -0
- package/dist/chart/components/y_axis/y-axis.component.js +6 -0
- package/dist/chart/components/y_axis/y-axis.drawer.d.ts +72 -0
- package/dist/chart/components/y_axis/y-axis.drawer.js +6 -0
- package/dist/chart/components/y_axis/y-axis.model.d.ts +33 -0
- package/dist/chart/components/y_axis/y-axis.model.js +6 -0
- package/dist/chart/drawers/chart-background.drawer.d.ts +19 -0
- package/dist/chart/drawers/chart-background.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/area.drawer.d.ts +13 -0
- package/dist/chart/drawers/chart-type-drawers/area.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/bar.drawer.d.ts +14 -0
- package/dist/chart/drawers/chart-type-drawers/bar.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/baseline.drawer.d.ts +15 -0
- package/dist/chart/drawers/chart-type-drawers/baseline.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/candle.drawer.d.ts +25 -0
- package/dist/chart/drawers/chart-type-drawers/candle.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/histogram.drawer.d.ts +13 -0
- package/dist/chart/drawers/chart-type-drawers/histogram.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/line.drawer.d.ts +13 -0
- package/dist/chart/drawers/chart-type-drawers/line.drawer.js +6 -0
- package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.d.ts +13 -0
- package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.js +6 -0
- package/dist/chart/drawers/clear-canvas.drawer.d.ts +16 -0
- package/dist/chart/drawers/clear-canvas.drawer.js +6 -0
- package/dist/chart/drawers/composite.drawer.d.ts +25 -0
- package/dist/chart/drawers/composite.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.d.ts +23 -0
- package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.js +6 -0
- package/dist/chart/drawers/data-series-drawers/color-candle.drawer.d.ts +17 -0
- package/dist/chart/drawers/data-series-drawers/color-candle.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.d.ts +8 -0
- package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.js +6 -0
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.d.ts +21 -0
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/histogram.drawer.d.ts +11 -0
- package/dist/chart/drawers/data-series-drawers/histogram.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/linear.drawer.d.ts +12 -0
- package/dist/chart/drawers/data-series-drawers/linear.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/points.drawer.d.ts +11 -0
- package/dist/chart/drawers/data-series-drawers/points.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.d.ts +9 -0
- package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/text.drawer.d.ts +13 -0
- package/dist/chart/drawers/data-series-drawers/text.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.d.ts +12 -0
- package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.js +6 -0
- package/dist/chart/drawers/data-series-drawers/triangle.drawer.d.ts +12 -0
- package/dist/chart/drawers/data-series-drawers/triangle.drawer.js +6 -0
- package/dist/chart/drawers/data-series.drawer.d.ts +39 -0
- package/dist/chart/drawers/data-series.drawer.js +6 -0
- package/dist/chart/drawers/drawing-manager.d.ts +61 -0
- package/dist/chart/drawers/drawing-manager.js +6 -0
- package/dist/chart/drawers/ht-data-series.drawer.d.ts +22 -0
- package/dist/chart/drawers/ht-data-series.drawer.js +6 -0
- package/dist/chart/events/event-bus.d.ts +48 -0
- package/dist/chart/events/event-bus.js +6 -0
- package/dist/chart/events/events.d.ts +8 -0
- package/dist/chart/events/events.js +6 -0
- package/dist/chart/inputhandlers/candle-tap.handler.d.ts +27 -0
- package/dist/chart/inputhandlers/candle-tap.handler.js +6 -0
- package/dist/chart/inputhandlers/chart-resize.handler.d.ts +67 -0
- package/dist/chart/inputhandlers/chart-resize.handler.js +6 -0
- package/dist/chart/inputhandlers/cross-event-producer.component.d.ts +44 -0
- package/dist/chart/inputhandlers/cross-event-producer.component.js +6 -0
- package/dist/chart/inputhandlers/hover-producer.component.d.ts +140 -0
- package/dist/chart/inputhandlers/hover-producer.component.js +6 -0
- package/dist/chart/inputhandlers/main-canvas-touch.handler.d.ts +54 -0
- package/dist/chart/inputhandlers/main-canvas-touch.handler.js +6 -0
- package/dist/chart/inputlisteners/canvas-input-listener.component.d.ts +311 -0
- package/dist/chart/inputlisteners/canvas-input-listener.component.js +6 -0
- package/dist/chart/model/baseline.model.d.ts +54 -0
- package/dist/chart/model/baseline.model.js +6 -0
- package/dist/chart/model/bounds.model.d.ts +16 -0
- package/dist/chart/model/bounds.model.js +6 -0
- package/dist/chart/model/candle-hover.d.ts +35 -0
- package/dist/chart/model/candle-hover.js +6 -0
- package/dist/chart/model/candle-series-high-low.provider.d.ts +20 -0
- package/dist/chart/model/candle-series-high-low.provider.js +6 -0
- package/dist/chart/model/candle-series.model.d.ts +150 -0
- package/dist/chart/model/candle-series.model.js +6 -0
- package/dist/chart/model/candle.model.d.ts +46 -0
- package/dist/chart/model/candle.model.js +6 -0
- package/dist/chart/model/canvas.model.d.ts +131 -0
- package/dist/chart/model/canvas.model.js +6 -0
- package/dist/chart/model/chart-base-element.d.ts +103 -0
- package/dist/chart/model/chart-base-element.js +6 -0
- package/dist/chart/model/compare-series-hover.d.ts +22 -0
- package/dist/chart/model/compare-series-hover.js +6 -0
- package/dist/chart/model/data-series-view.d.ts +58 -0
- package/dist/chart/model/data-series-view.js +6 -0
- package/dist/chart/model/data-series.config.d.ts +31 -0
- package/dist/chart/model/data-series.config.js +6 -0
- package/dist/chart/model/data-series.model.d.ts +172 -0
- package/dist/chart/model/data-series.model.js +6 -0
- package/dist/chart/model/date-time.formatter.d.ts +23 -0
- package/dist/chart/model/date-time.formatter.js +6 -0
- package/dist/chart/model/hit-test-canvas.model.d.ts +128 -0
- package/dist/chart/model/hit-test-canvas.model.js +6 -0
- package/dist/chart/model/main-candle-series.model.d.ts +27 -0
- package/dist/chart/model/main-candle-series.model.js +6 -0
- package/dist/chart/model/scale.model.d.ts +180 -0
- package/dist/chart/model/scale.model.js +6 -0
- package/dist/chart/model/scaling/auto-scale.model.d.ts +79 -0
- package/dist/chart/model/scaling/auto-scale.model.js +6 -0
- package/dist/chart/model/scaling/constrait.functions.d.ts +43 -0
- package/dist/chart/model/scaling/constrait.functions.js +6 -0
- package/dist/chart/model/scaling/lock-ratio.model.d.ts +16 -0
- package/dist/chart/model/scaling/lock-ratio.model.js +6 -0
- package/dist/chart/model/scaling/move-chart.functions.d.ts +20 -0
- package/dist/chart/model/scaling/move-chart.functions.js +6 -0
- package/dist/chart/model/scaling/viewport.model.d.ts +223 -0
- package/dist/chart/model/scaling/viewport.model.js +6 -0
- package/dist/chart/model/scaling/x-zooming.functions.d.ts +26 -0
- package/dist/chart/model/scaling/x-zooming.functions.js +6 -0
- package/dist/chart/model/time-zone.model.d.ts +65 -0
- package/dist/chart/model/time-zone.model.js +6 -0
- package/dist/chart/model/visual-candle.d.ts +106 -0
- package/dist/chart/model/visual-candle.js +6 -0
- package/dist/chart/utils/__tests__/array.utils.test.d.ts +6 -0
- package/dist/chart/utils/__tests__/array.utils.test.js +6 -0
- package/dist/chart/utils/__tests__/object.utils.test.d.ts +6 -0
- package/dist/chart/utils/__tests__/object.utils.test.js +6 -0
- package/dist/chart/utils/__tests__/priceIncrementsUtils.test.d.ts +6 -0
- package/dist/chart/utils/__tests__/priceIncrementsUtils.test.js +6 -0
- package/dist/chart/utils/array.utils.d.ts +101 -0
- package/dist/chart/utils/array.utils.js +6 -0
- package/dist/chart/utils/auto-period-detector.utils.d.ts +16 -0
- package/dist/chart/utils/auto-period-detector.utils.js +6 -0
- package/dist/chart/utils/candles-generator-ts.utils.d.ts +41 -0
- package/dist/chart/utils/candles-generator-ts.utils.js +6 -0
- package/dist/chart/utils/candles-generator.utils.d.ts +13 -0
- package/dist/chart/utils/candles-generator.utils.js +6 -0
- package/dist/chart/utils/candles.utils.d.ts +8 -0
- package/dist/chart/utils/candles.utils.js +6 -0
- package/dist/chart/utils/canvas/canvas-drawing-functions.utils.d.ts +68 -0
- package/dist/chart/utils/canvas/canvas-drawing-functions.utils.js +6 -0
- package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.d.ts +20 -0
- package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.js +6 -0
- package/dist/chart/utils/canvas/canvas-text-functions.utils.d.ts +76 -0
- package/dist/chart/utils/canvas/canvas-text-functions.utils.js +6 -0
- package/dist/chart/utils/color.utils.d.ts +6 -0
- package/dist/chart/utils/color.utils.js +6 -0
- package/dist/chart/utils/device/browser.utils.d.ts +9 -0
- package/dist/chart/utils/device/browser.utils.js +6 -0
- package/dist/chart/utils/device/device-detector.utils.d.ts +12 -0
- package/dist/chart/utils/device/device-detector.utils.js +6 -0
- package/dist/chart/utils/device/device-pixel-ratio.utils.d.ts +16 -0
- package/dist/chart/utils/device/device-pixel-ratio.utils.js +6 -0
- package/dist/chart/utils/device/touchpad.utils.d.ts +30 -0
- package/dist/chart/utils/device/touchpad.utils.js +6 -0
- package/dist/chart/utils/dom.utils.d.ts +13 -0
- package/dist/chart/utils/dom.utils.js +6 -0
- package/dist/chart/utils/function.utils.d.ts +13 -0
- package/dist/chart/utils/function.utils.js +6 -0
- package/dist/chart/utils/math.utils.d.ts +40 -0
- package/dist/chart/utils/math.utils.js +6 -0
- package/dist/chart/utils/merge.utils.d.ts +27 -0
- package/dist/chart/utils/merge.utils.js +6 -0
- package/dist/chart/utils/object.utils.d.ts +46 -0
- package/dist/chart/utils/object.utils.js +6 -0
- package/dist/chart/utils/perfomance/animation-frame-cache.utils.d.ts +53 -0
- package/dist/chart/utils/perfomance/animation-frame-cache.utils.js +6 -0
- package/dist/chart/utils/perfomance/debounce.utils.d.ts +6 -0
- package/dist/chart/utils/perfomance/debounce.utils.js +6 -0
- package/dist/chart/utils/perfomance/memoize.utils.d.ts +21 -0
- package/dist/chart/utils/perfomance/memoize.utils.js +6 -0
- package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.d.ts +15 -0
- package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.js +6 -0
- package/dist/chart/utils/perfomance/throttle.utils.d.ts +15 -0
- package/dist/chart/utils/perfomance/throttle.utils.js +6 -0
- package/dist/chart/utils/price-increments.utils.d.ts +44 -0
- package/dist/chart/utils/price-increments.utils.js +6 -0
- package/dist/chart/utils/uuid.utils.d.ts +6 -0
- package/dist/chart/utils/uuid.utils.js +6 -0
- package/dist/dxchart.min.js +26 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +6 -0
- package/package.json +103 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{getFontFromConfig as x}from"../../chart.config";import{calculateSymbolHeight as f,calculateTextWidth as u}from"../../utils/canvas/canvas-font-measure-tool.utils";import{clipToBounds as y}from"../../drawers/data-series.drawer";export class YAxisDrawer{constructor(e,o,t,s,i,l=()=>!0,r){this.fullConfig=e,this.yAxisState=o,this.canvasModel=t,this.labelsProvider=s,this.axisBounds=i,this.drawPredicate=l,this.toY=r}draw(){if(this.drawPredicate()){const e=this.labelsProvider(),o=this.axisBounds(),t=this.canvasModel.ctx;t.fillStyle=this.getBackgroundColor(),t.fillRect(o.x,o.y,o.width,o.height);const s=x(this.yAxisState),i=f(s,t),l=this.getLabelTextColor();t.save(),y(t,o),this.drawLabels(t,e,o,i,s,l),t.restore()}}drawLabels(e,o,t,s,i,l){e.fillStyle=l,e.font=i;const r=e.measureText("00.0"),a=r.actualBoundingBoxAscent+r.actualBoundingBoxDescent,d=t.y+a,g=t.y+t.height-a;o.forEach(h=>{const c=this.toY(h.value);c>d&&c<g&&m(e,t,h.text,c,s,i,this.yAxisState.labelBoxMargin.end,this.yAxisState.align)})}getCanvasIds(){return[this.canvasModel.canvasId]}getBackgroundColor(){return this.fullConfig.colors.yAxis.backgroundColor}getLabelTextColor(){return this.fullConfig.colors.yAxis.labelTextColor}}const m=(n,e,o,t,s,i,l,r)=>{const a=r==="right"?e.x+e.width-u(o,n,i)-l:e.x+l;n.fillText(o,a,t+s/2-1)};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
|
|
7
|
+
import { FullChartConfig } from '../../chart.config';
|
|
8
|
+
import EventBus from '../../events/event-bus';
|
|
9
|
+
import { CanvasModel } from '../../model/canvas.model';
|
|
10
|
+
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
11
|
+
import { ScaleModel } from '../../model/scale.model';
|
|
12
|
+
import { ChartModel } from '../chart/chart.model';
|
|
13
|
+
import { PaneComponent } from '../pane/pane.component';
|
|
14
|
+
import { NumericYAxisLabelsGenerator } from './numeric-y-axis-labels.generator';
|
|
15
|
+
import { YAxisLabelsModel } from './price_labels/y-axis-labels.model';
|
|
16
|
+
import { YAxisBaseLabelsModel } from './y-axis-base-labels.model';
|
|
17
|
+
export declare class YAxisModel extends ChartBaseElement {
|
|
18
|
+
private config;
|
|
19
|
+
private canvasBoundsContainer;
|
|
20
|
+
private canvasModel;
|
|
21
|
+
private chartModel;
|
|
22
|
+
yAxisLabelsGenerator: NumericYAxisLabelsGenerator;
|
|
23
|
+
yAxisBaseLabelsModel: YAxisBaseLabelsModel;
|
|
24
|
+
yAxisLabelsModel: YAxisLabelsModel;
|
|
25
|
+
constructor(paneComponent: PaneComponent, eventBus: EventBus, config: FullChartConfig, canvasBoundsContainer: CanvasBoundsContainer, canvasModel: CanvasModel, chartModel: ChartModel, scaleModel: ScaleModel);
|
|
26
|
+
/**
|
|
27
|
+
* This method is used to activate the chart and auto-adjust the width of the Y axis depending on data.
|
|
28
|
+
* It subscribes to the candlesSetSubject and invalidates the labelsCache of yAxisLabelsGenerator, updates the labels of yAxisLabelsModel and yAxisBaseLabelsModel, and fires the draw event of canvasModel.
|
|
29
|
+
* @protected
|
|
30
|
+
* @returns {void}
|
|
31
|
+
*/
|
|
32
|
+
protected doActivate(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{merge as c}from"rxjs";import{ChartBaseElement as b}from"../../model/chart-base-element";import{NumericYAxisLabelsGenerator as x}from"./numeric-y-axis-labels.generator";import{YAxisLabelsModel as A}from"./price_labels/y-axis-labels.model";import{YAxisBaseLabelsModel as u}from"./y-axis-base-labels.model";export class YAxisModel extends b{constructor(t,l,i,d,a,o,n){super(),this.config=i,this.canvasBoundsContainer=d,this.canvasModel=a,this.chartModel=o;const h=t.valueFormatter;this.yAxisLabelsGenerator=new x(null,o,n,h,()=>this.config.components.yAxis.type,()=>this.chartModel.getBaseLine(),i.components.yAxis.labelHeight),this.yAxisBaseLabelsModel=new u(n,this.yAxisLabelsGenerator,this.canvasBoundsContainer),this.addChildEntity(this.yAxisBaseLabelsModel),this.yAxisLabelsModel=new A(l,this.chartModel,this.canvasBoundsContainer,this.config,a,()=>this.canvasBoundsContainer.updateYAxisWidths()),this.addChildEntity(this.yAxisLabelsModel),this.canvasBoundsContainer.yAxisBoundsContainer.registerYAxisWidthContributor({getLargestLabel:()=>{var s;return((s=this.yAxisLabelsGenerator.labelsCache.getLastCachedValue())!==null&&s!==void 0?s:[]).map(e=>e.text).concat(this.yAxisLabelsModel.orderedLabels.flatMap(e=>e.labels).map(e=>e.labelText)).reduce((e,r)=>r.length>e.length?r:e,"")},getYAxisIndex:()=>0,getYAxisAlign:()=>this.config.components.yAxis.align,getPaneUUID:()=>t.uuid})}doActivate(){super.doActivate(),this.addRxSubscription(c(this.chartModel.candlesSetSubject).subscribe(()=>{this.yAxisLabelsGenerator.labelsCache.invalidate(),this.yAxisLabelsModel.updateLabels(),this.yAxisBaseLabelsModel.updateLabels(),this.canvasModel.fireDraw()}))}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { Drawer } from './drawing-manager';
|
|
7
|
+
import { CanvasModel } from '../model/canvas.model';
|
|
8
|
+
import { FullChartConfig } from '../chart.config';
|
|
9
|
+
export declare class BackgroundDrawer implements Drawer {
|
|
10
|
+
private canvasModel;
|
|
11
|
+
private config;
|
|
12
|
+
constructor(canvasModel: CanvasModel, config: FullChartConfig);
|
|
13
|
+
private prevState;
|
|
14
|
+
private prevWidth;
|
|
15
|
+
private prevHeight;
|
|
16
|
+
draw(): void;
|
|
17
|
+
getCanvasIds(): Array<string>;
|
|
18
|
+
}
|
|
19
|
+
export declare const redrawBackgroundArea: (backgroundCtx: CanvasRenderingContext2D, ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, opacity?: number) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{getDPR as f}from"../utils/device/device-pixel-ratio.utils";import{deepEqual as p}from"../utils/object.utils";import{floor as s}from"../utils/math.utils";export class BackgroundDrawer{constructor(e,o){this.canvasModel=e,this.config=o,this.prevState={},this.prevWidth=0,this.prevHeight=0}draw(){if(p(this.config.colors.chartAreaTheme,this.prevState)&&this.prevHeight===this.canvasModel.height&&this.prevWidth===this.canvasModel.width)return;this.canvasModel.clear();const e=this.canvasModel.ctx;if(this.config.colors.chartAreaTheme.backgroundMode==="gradient"){const o=e.createLinearGradient(0,0,this.canvasModel.width,this.canvasModel.height);o.addColorStop(0,this.config.colors.chartAreaTheme.backgroundGradientTopColor),o.addColorStop(1,this.config.colors.chartAreaTheme.backgroundGradientBottomColor),e.fillStyle=o}else e.fillStyle=this.config.colors.chartAreaTheme.backgroundColor;e.fillRect(0,0,this.canvasModel.width,this.canvasModel.height),this.prevState=Object.assign({},this.config.colors.chartAreaTheme),this.prevWidth=this.canvasModel.width,this.prevHeight=this.canvasModel.height}getCanvasIds(){return[this.canvasModel.canvasId]}}export const redrawBackgroundArea=(c,e,o,l,g,v,i)=>{const r=f(),h=[o*r,l*r,g*r,v*r];let t=c.getImageData(...h);if(i!==void 0){const d=t.data[3]/255;if(d===1)for(let a=3;a<t.data.length;a+=4)t.data[a]=s(t.data[a]*i);else for(let a=0;a<t.data.length;a++){const n=t.data[a];t.data[a]=a%4===3?s(n*i):s(d*n)}t=new ImageData(t.data,t.width,t.height,{colorSpace:t.colorSpace})}e.putImageData(t,h[0],h[1])};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { ChartConfigComponentsChart } from '../../chart.config';
|
|
7
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
8
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
9
|
+
export declare class AreaDrawer implements SeriesDrawer {
|
|
10
|
+
private config;
|
|
11
|
+
constructor(config: ChartConfigComponentsChart);
|
|
12
|
+
draw(ctx: CanvasRenderingContext2D, points: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{CandleSeriesModel as d}from"../../model/candle-series.model";import{flat as S}from"../../utils/array.utils";import{floor as l}from"../../utils/math.utils";export class AreaDrawer{constructor(e){this.config=e}draw(e,C,o,r){if(o instanceof d){const i=S(C);if(i.length===0)return;r.singleColor?e.strokeStyle=r.singleColor:e.strokeStyle=o.colors.areaTheme.lineColor,o.hovered?e.lineWidth=this.config.selectedWidth:e.lineWidth=this.config.areaLineWidth;const a=o.extentComponent.getBounds(),p=i[0],T=o.view.toX(p.centerUnit);for(let t=0;t<i.length;t++){const g=i[t-1],v=i[t+1],c=i[t],s=o.view.toX(c.centerUnit),h=o.view.toY(c.close),f=a.y+a.height;if(g===void 0)e.beginPath(),e.lineTo(l(s),f),e.moveTo(l(s),h);else if(v===void 0){e.lineTo(l(s),h),e.stroke(),e.lineTo(l(s),f),e.lineTo(l(T),f),e.closePath();let n;r.singleColor?e.fillStyle=r.singleColor:e.fillStyle=o.colors.areaTheme.startColor&&o.colors.areaTheme.stopColor?(n=e.createLinearGradient(0,0,0,a.height),n.addColorStop(0,o.colors.areaTheme.startColor),n.addColorStop(1,o.colors.areaTheme.stopColor),n):"",e.fill()}else e.lineTo(l(s),h)}}}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { ChartConfigComponentsChart } from '../../chart.config';
|
|
7
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
8
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
9
|
+
export declare class BarDrawer implements SeriesDrawer {
|
|
10
|
+
private config;
|
|
11
|
+
constructor(config: ChartConfigComponentsChart);
|
|
12
|
+
private setFillStyle;
|
|
13
|
+
draw(ctx: CanvasRenderingContext2D, points: VisualSeriesPoint[][], candleSeries: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{CandleSeriesModel as b}from"../../model/candle-series.model";import{flat as p}from"../../utils/array.utils";import{avoidAntialiasing as Y}from"../../utils/canvas/canvas-drawing-functions.utils";import{floorToDPR as s}from"../../utils/device/device-pixel-ratio.utils";import{setLineWidth as d}from"../data-series.drawer";export class BarDrawer{constructor(o){this.config=o}setFillStyle(o,n,i,l){if(n.singleColor)o.strokeStyle=n.singleColor;else{const r=i.colors.barTheme;r&&(o.strokeStyle=r[`${l.name}Color`])}}draw(o,n,i,l){if(i instanceof b){const r=p(n);d(o,this.config.barLineWidth,i,l),Y(o,()=>{for(const t of r){this.setFillStyle(o,l,i,t),o.beginPath();const e=s(i.view.toX(t.centerUnit)),a=s(i.view.toX(t.startUnit)),[v,y,h,w]=t.yBodyKeyPoints(i.view),T=s(i.view.xPixels(t.width)/2),m=s(i.view.toY(t.close)),f=s(i.view.toY(t.open));this.config.showWicks?(o.moveTo(e,v),o.lineTo(e,w)):(o.moveTo(e,y),o.lineTo(e,h)),o.moveTo(e,m),o.lineTo(e+T,m),o.moveTo(a,f),o.lineTo(e,f),o.stroke()}})}}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
|
|
7
|
+
import { BaselineModel } from '../../model/baseline.model';
|
|
8
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
9
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
10
|
+
export declare class BaselineDrawer implements SeriesDrawer {
|
|
11
|
+
private baseLineModel;
|
|
12
|
+
private canvasBoundContainer;
|
|
13
|
+
constructor(baseLineModel: BaselineModel, canvasBoundContainer: CanvasBoundsContainer);
|
|
14
|
+
draw(ctx: CanvasRenderingContext2D, points: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig?: ChartDrawerConfig): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{CanvasElement as X}from"../../canvas/canvas-bounds-container";import{CandleSeriesModel as d}from"../../model/candle-series.model";import{flat as H}from"../../utils/array.utils";export class BaselineDrawer{constructor(e,s){this.baseLineModel=e,this.canvasBoundContainer=s}draw(e,s,o,h){if(h!==void 0&&o instanceof d){const a=H(s),p=this.baseLineModel.baselineYPercents,T=this.canvasBoundContainer.getBounds(X.CHART),n=T.y+T.height*(p/100),B=a[0];for(let c=0;c<a.length;c++){const f=a[c],i=a[c-1],S=a[c+1],v=o.view.toX(B.centerUnit),t=o.view.toX(f.centerUnit),l=o.view.toY(f.close),L=i?o.view.toY(i.close)<n:!1,b=l<n;if(i!==void 0&&L!==b){g(e,o,h,L);const P=o.view.toX(i.centerUnit),k=o.view.toY(i.close),u=t-P,y=l-k,Y=u/y,m=l-n,w=Y*m,C=P+(u-w);e.lineTo(C,n),e.stroke(),e.lineTo(v,n),e.closePath(),e.fill(),e.beginPath(),e.moveTo(C,n)}i===void 0?(e.beginPath(),e.moveTo(t,l)):S===void 0?(g(e,o,h,b),e.lineTo(t,l),e.stroke(),e.lineTo(t,n),e.lineTo(v,n),e.closePath(),e.fill(),e.beginPath(),e.moveTo(v,n),e.lineTo(t,n),e.strokeStyle=o.colors.baseLineTheme.baselineColor,e.stroke()):e.lineTo(t,l)}}}}const g=(r,e,s,o)=>{s.singleColor?(r.fillStyle=s.singleColor,r.strokeStyle=s.singleColor):(r.fillStyle=o?e.colors.baseLineTheme.upperSectionFillColor:e.colors.baseLineTheme.lowerSectionFillColor,r.strokeStyle=o?e.colors.baseLineTheme.upperSectionStrokeColor:e.colors.baseLineTheme.lowerSectionStrokeColor)};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { CandleSeriesModel } from '../../model/candle-series.model';
|
|
7
|
+
import { ChartConfigComponentsChart } from '../../chart.config';
|
|
8
|
+
import VisualCandle from '../../model/visual-candle';
|
|
9
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
10
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
11
|
+
export declare class CandleDrawer implements SeriesDrawer {
|
|
12
|
+
private config;
|
|
13
|
+
constructor(config: ChartConfigComponentsChart);
|
|
14
|
+
private pixelLength;
|
|
15
|
+
private lineWidthCU;
|
|
16
|
+
private halfLineWidthCU;
|
|
17
|
+
draw(ctx: CanvasRenderingContext2D,
|
|
18
|
+
/**
|
|
19
|
+
* You can pass two-dimension array to divide series into multiple parts
|
|
20
|
+
*/
|
|
21
|
+
points: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
22
|
+
drawCandle(ctx: CanvasRenderingContext2D, drawerConfig: ChartDrawerConfig, candleSeries: CandleSeriesModel, visualCandle: VisualCandle): void;
|
|
23
|
+
private drawCandlesWicks;
|
|
24
|
+
private drawCandleBorder;
|
|
25
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{CandleSeriesModel as $}from"../../model/candle-series.model";import{avoidAntialiasing as X}from"../../utils/canvas/canvas-drawing-functions.utils";import{dpr as P,floorToDPR as m}from"../../utils/device/device-pixel-ratio.utils";import{setLineWidth as A}from"../data-series.drawer";import{flat as E}from"../../utils/array.utils";export class CandleDrawer{constructor(i){this.config=i,this.pixelLength=1,this.lineWidthCU=1,this.halfLineWidthCU=1}draw(i,e,t,o){if(t instanceof $){const r=E(e);A(i,this.config.candleLineWidth,t,o,this.config.candleLineWidth),X(i,()=>{this.pixelLength=1/P,this.halfLineWidthCU=i.lineWidth/2,this.lineWidthCU=i.lineWidth;for(const f of r){const{candleTheme:h,activeCandleTheme:l}=t.colors;h&&l&&this.drawCandle(i,o,t,f)}})}}drawCandle(i,e,t,o){const{candleTheme:r,activeCandleTheme:f}=t.colors,h=o.name,l=o.isActive?f:r,d=o.isHollow;e.singleColor?i.fillStyle=e.singleColor:d?i.fillStyle=l[`${h}WickColor`]:i.fillStyle=l[`${h}Color`];const s=m(t.view.toX(o.startUnit)),a=m(t.view.xPixels(o.width)),w=o.bodyHeight(t.view),[W,n,y,T]=o.yBodyKeyPoints(t.view),c=n===y?n+1:y,g=W===T?W+1:T,p=l[`${h}Color`],B=h==="none"?p:l[`${h}WickColor`];i.fillStyle=p,e.singleColor?i.strokeStyle=e.singleColor:i.strokeStyle=B;const v=d||(o.hasBorder&&o.isActive?this.config.showActiveCandlesBorder:this.config.showCandlesBorder),k=this.config.showWicks;if(a<2)i.beginPath(),i.moveTo(s,k?W:n),i.lineTo(s,k?g:c),i.stroke();else if(a<3)i.beginPath(),i.moveTo(s,k?W:n),i.lineTo(s,k?g:c),i.moveTo(s+1,n),i.lineTo(s+1,c),i.stroke();else if(a===3){const C=a/P;this.drawCandlesWicks(i,s+C,W,g,n,c),d||(i.beginPath(),i.moveTo(s+C,n),i.lineTo(s+C,c),i.stroke()),this.drawCandleBorder(i,e,l,o,s+this.halfLineWidthCU,n+this.halfLineWidthCU,a-this.lineWidthCU,w-this.lineWidthCU)}else{const C=m(t.view.toX(o.centerUnit));this.drawCandlesWicks(i,C,W,g,n,c-1);const S=this.config.candlePaddingPercent,U=Math.max(m(a*S/2),this.pixelLength),L=s+U,b=a-U*2;d||(e.singleColor&&(i.fillStyle=e.singleColor),i.fillRect(L,n,b,w)),v&&this.drawCandleBorder(i,e,l,o,L+this.halfLineWidthCU,n+this.halfLineWidthCU,b-this.lineWidthCU,w-this.lineWidthCU)}}drawCandlesWicks(i,e,t,o,r,f){this.config.showWicks&&(i.beginPath(),i.moveTo(e,t),i.lineTo(e,r),i.moveTo(e,f),i.lineTo(e,o),i.stroke())}drawCandleBorder(i,e,t,o,r,f,h,l){if(e.singleColor)i.strokeStyle=e.singleColor;else{const d=o.name;i.strokeStyle=d==="none"?t[`${d}Color`]:t[`${d}WickColor`]}i.strokeRect(r,f,h,l)}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { ChartConfigComponentsHistogram } from '../../chart.config';
|
|
7
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
8
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
9
|
+
export declare class HistogramDrawer implements SeriesDrawer {
|
|
10
|
+
private config;
|
|
11
|
+
constructor(config: ChartConfigComponentsHistogram);
|
|
12
|
+
draw(ctx: CanvasRenderingContext2D, points: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{CandleSeriesModel as p}from"../../model/candle-series.model";import{floorToDPR as d}from"../../utils/device/device-pixel-ratio.utils";export class HistogramDrawer{constructor(o){this.config=o}draw(o,S,e,s){if(e instanceof p){const C=S.flat(),h=e.scaleModel.getBounds(),f=h.y+h.height;for(const t of C){o.beginPath();const c=t.name,i=this.config.barCapSize,n=e.colors.histogram;if(n===void 0)return;s.singleColor?o.fillStyle=s.singleColor:o.fillStyle=n[`${c}Bright`];const r=t.xStart(e.view),l=d(e.view.toY(t.close)),g=d(e.view.xPixels(t.width));o.fillRect(r,l,g,i);const a=o.createLinearGradient(0,l+i,0,f);s.singleColor?o.fillStyle=s.singleColor:(a.addColorStop(0,n[`${c}Cap`]),a.addColorStop(1,n[`${c}Bottom`]),o.fillStyle=a),g===0?(o.beginPath(),o.strokeStyle=a,o.moveTo(r,l+i),o.lineTo(r,f),o.stroke(),o.closePath()):o.fillRect(r,l+i,g,f-l-i)}}}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { ChartConfigComponentsChart } from '../../chart.config';
|
|
7
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
8
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
9
|
+
export declare class LineDrawer implements SeriesDrawer {
|
|
10
|
+
private config;
|
|
11
|
+
constructor(config: ChartConfigComponentsChart);
|
|
12
|
+
draw(ctx: CanvasRenderingContext2D, points: VisualSeriesPoint[][], candleSeries: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{CandleSeriesModel as g}from"../../model/candle-series.model";import{setLineWidth as C}from"../data-series.drawer";import{flat as T}from"../../utils/array.utils";export class LineDrawer{constructor(o){this.config=o}draw(o,r,t,e){if(t instanceof g){const n=T(r);C(o,this.config.lineWidth,t,e,this.config.selectedWidth);const c=t.colors.lineTheme;o.lineCap="round",e.singleColor&&(o.strokeStyle=e.singleColor);for(let i=1;i<n.length;i++){const l=n[i-1],s=n[i],h=s.name;e.singleColor||(o.strokeStyle=c[`${h}Color`]);const m=t.view.toX(l.centerUnit),v=t.view.toY(l.close),f=t.view.toX(s.centerUnit),p=t.view.toY(s.close);o.beginPath(),o.moveTo(m,v),o.lineTo(f,p),o.stroke()}}}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { ScatterPlotStyle } from '../../chart.config';
|
|
7
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
8
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
9
|
+
export declare class ScatterPlotDrawer implements SeriesDrawer {
|
|
10
|
+
private config;
|
|
11
|
+
constructor(config: ScatterPlotStyle);
|
|
12
|
+
draw(ctx: CanvasRenderingContext2D, points: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{flat as c}from"../../utils/array.utils";import{floorToDPR as i}from"../../utils/device/device-pixel-ratio.utils";const f=1.5;export class ScatterPlotDrawer{constructor(o){this.config=o}draw(o,n,r,e){var t;o.fillStyle=(t=e.singleColor)!==null&&t!==void 0?t:this.config.mainColor;for(const l of c(n)){o.beginPath();const a=i(r.view.toX(l.centerUnit)),s=i(r.view.toY(l.close));o.arc(a,s,f,0,Math.PI*2,!0),o.fill()}}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { Drawer } from './drawing-manager';
|
|
7
|
+
import { CanvasModel } from '../model/canvas.model';
|
|
8
|
+
/**
|
|
9
|
+
* Clears the canvas.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ClearCanvasDrawer implements Drawer {
|
|
12
|
+
private canvasModel;
|
|
13
|
+
constructor(canvasModel: CanvasModel);
|
|
14
|
+
draw(): void;
|
|
15
|
+
getCanvasIds(): Array<string>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export class ClearCanvasDrawer{constructor(a){this.canvasModel=a}draw(){this.canvasModel.clear()}getCanvasIds(){return[this.canvasModel.canvasId]}}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { Drawer } from './drawing-manager';
|
|
7
|
+
/**
|
|
8
|
+
* Container for grouping multiple drawers.
|
|
9
|
+
* Try to keep simple, not overkill with sorting.
|
|
10
|
+
*/
|
|
11
|
+
export declare class CompositeDrawer<D extends Drawer = Drawer> implements Drawer {
|
|
12
|
+
private readonly drawers;
|
|
13
|
+
constructor(drawers?: Map<string, D>);
|
|
14
|
+
draw(): void;
|
|
15
|
+
addDrawer(drawer: D, drawerName?: string): void;
|
|
16
|
+
drawLastBar(): void;
|
|
17
|
+
removeDrawer(drawer: D): void;
|
|
18
|
+
removeDrawerByName(drawerName: string): void;
|
|
19
|
+
getDrawer(drawerName: string): D | undefined;
|
|
20
|
+
moveTop(drawer: D): void;
|
|
21
|
+
moveTopByName(drawerName: string): void;
|
|
22
|
+
getSize(): number;
|
|
23
|
+
getAll(): Map<string, D>;
|
|
24
|
+
getCanvasIds(): Array<string>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{findKeyFromValue as t}from"../utils/object.utils";import{flat as a}from"../utils/array.utils";export class CompositeDrawer{constructor(r){this.drawers=r!=null?r:new Map}draw(){this.drawers.forEach(r=>r.draw())}addDrawer(r,e){const s=e!=null?e:"drawer"+this.drawers.size;this.drawers.set(s,r)}drawLastBar(){this.drawers.forEach(r=>r.drawLastBar&&r.drawLastBar())}removeDrawer(r){const e=t(this.drawers,r);e?this.drawers.delete(e):console.warn("Couldn't find drawer type")}removeDrawerByName(r){this.drawers.delete(r)}getDrawer(r){return this.drawers.get(r)}moveTop(r){const e=t(this.drawers,r);e?this.moveTopByName(e):console.warn("Couldn't find drawer type")}moveTopByName(r){if(this.drawers.size===1)return;const e=this.drawers.get(r);this.drawers.delete(r),e&&this.drawers.set(r,e)}getSize(){return this.drawers.size}getAll(){return this.drawers}getCanvasIds(){const r=a(Array.from(this.drawers).map(([,s])=>s.getCanvasIds())),e=new Set([...r]);return Array.from(e)}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { BarType, FullChartConfig } from '../../chart.config';
|
|
7
|
+
import { BoundsProvider } from '../../model/bounds.model';
|
|
8
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
9
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
10
|
+
export declare const candleTypesList: BarType[];
|
|
11
|
+
/**
|
|
12
|
+
* A decorator for drawers, that draw something depending on visual candles
|
|
13
|
+
*/
|
|
14
|
+
export declare class CandleSeriesWrapper implements SeriesDrawer {
|
|
15
|
+
private drawer;
|
|
16
|
+
private config;
|
|
17
|
+
private chartBounds;
|
|
18
|
+
constructor(drawer: SeriesDrawer, config: FullChartConfig, chartBounds: BoundsProvider);
|
|
19
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel, config: ChartDrawerConfig): void;
|
|
20
|
+
private beforeDraw;
|
|
21
|
+
private isChartTypeAllowed;
|
|
22
|
+
private afterDraw;
|
|
23
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{clipToBounds as a}from"../data-series.drawer";export const candleTypesList=["candle","bar","line","area","scatterPlot","hollow","histogram","baseline","trend"];export class CandleSeriesWrapper{constructor(e,r,s){this.drawer=e,this.config=r,this.chartBounds=s}draw(e,r,s,t){this.isChartTypeAllowed()&&(this.beforeDraw(e),this.drawer.draw(e,r,s,t),this.afterDraw(e,s))}beforeDraw(e){e.restore(),e.save(),a(e,this.chartBounds())}isChartTypeAllowed(){return candleTypesList.includes(this.config.components.chart.type)}afterDraw(e,r){e.restore(),e.save(),a(e,r.scaleModel.getBounds())}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { ChartModel } from '../../components/chart/chart.model';
|
|
7
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
8
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
9
|
+
/**
|
|
10
|
+
* Some series have candles which are highlighted.
|
|
11
|
+
* This drawer draws the candle box on top of original candles.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ColorCandleDrawer implements SeriesDrawer {
|
|
14
|
+
private chartModel;
|
|
15
|
+
constructor(chartModel: ChartModel);
|
|
16
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{unitToPixels as b}from"../../model/scaling/viewport.model";import{floorToDPR as l}from"../../utils/device/device-pixel-ratio.utils";import{round as v}from"../../utils/math.utils";export class ColorCandleDrawer{constructor(t){this.chartModel=t}draw(t,d,s,i){d.forEach((r,h)=>{var e;const f=s.getPaintConfig(h);t.fillStyle=(e=i.singleColor)!==null&&e!==void 0?e:f.color,r.forEach(n=>{const o=this.chartModel.getVisualCandle(v(n.centerUnit)),g=n.close;if(o&&g===1){const M=this.chartModel.scaleModel.zoomX,c=l(b(o.width,M)),m=l(o.bodyHeight(this.chartModel.scaleModel)),p=o.xCenter(this.chartModel.scaleModel)-c/2,u=o.yBodyStart(this.chartModel.scaleModel),C=this.chartModel.config.components.chart.candlePaddingPercent,a=l(c*C/2),y=p+a,P=c-a*2;t.fillRect(y,u,P,m)}})})}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { VisualSeriesPoint } from '../../model/data-series.model';
|
|
7
|
+
import { Viewable } from '../../model/scaling/viewport.model';
|
|
8
|
+
export declare const buildLinePath: (points: VisualSeriesPoint[], ctx: CanvasRenderingContext2D, view: Viewable) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export const buildLinePath=(o,e,t)=>{o.length!==0&&o.forEach((l,s)=>{const{centerUnit:i,close:f}=l,n=t.toX(i),c=t.toY(f);s===0?e.moveTo(n,c):e.lineTo(n,c)})};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
7
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
8
|
+
/**
|
|
9
|
+
* Point used to draw difference type indicator (clouds) (e.g. Ichimoku indicator)
|
|
10
|
+
*/
|
|
11
|
+
export interface DifferencePoint {
|
|
12
|
+
diffPoints: [VisualSeriesPoint, VisualSeriesPoint];
|
|
13
|
+
}
|
|
14
|
+
export declare class DifferenceCloudDrawer implements SeriesDrawer {
|
|
15
|
+
constructor();
|
|
16
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
17
|
+
private drawLine;
|
|
18
|
+
private drawDifference;
|
|
19
|
+
private fillCloud;
|
|
20
|
+
}
|
|
21
|
+
export declare const isDifferenceTool: (type: string) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{setLineWidth as C}from"../data-series.drawer";import{buildLinePath as y}from"./data-series-drawers.utils";import{firstOf as D,lastOf as b}from"../../utils/array.utils";import{toRGBA as m}from"../../utils/color.utils";export class DifferenceCloudDrawer{constructor(){}draw(o,r,e,a){e.config.visible&&(r.forEach((i,l)=>{var s;const n=e.getPaintConfig(l);C(o,n.lineWidth,e,a,n.hoveredLineWidth);const f=(s=a.singleColor)!==null&&s!==void 0?s:n.color;o.strokeStyle=f,this.drawLine(o,i,e.view)}),e.linkedDataSeriesModels.forEach((i,l)=>{if(isDifferenceTool(i.config.type)&&isDifferenceTool(e.config.type)&&i.config.visible){const s=[],n=e,f=n.getSeriesInViewport(n.scaleModel.xStart-1,n.scaleModel.xEnd+1),c=i.getSeriesInViewport(i.scaleModel.xStart-1,i.scaleModel.xEnd+1);f.forEach((h,t)=>{const u=Math.min(h.length,c[t].length);for(let g=0;g<u;g++){const p=[h[g].clone(),c[t][g].clone()];s.push({diffPoints:p})}const v=n.getPaintConfig(t).color,E=i.getPaintConfig(l).color;this.drawDifference(o,v,E,s,n,i,a)})}}))}drawLine(o,r,e){o.beginPath(),y(r,o,e),o.stroke()}drawDifference(o,r,e,a,i,l,s){const[n,f]=[[],[]];a.forEach(t=>{const[u,v]=t.diffPoints;n.push(u),f.push(v)});const c=d(n,i.view),h=d(f,l.view);this.fillCloud(o,e,c,h,s),this.fillCloud(o,r,h,c,s)}fillCloud(o,r,e,a,i){var l,s,n,f;o.save(),o.beginPath();const c=(s=(l=D(e))===null||l===void 0?void 0:l.x)!==null&&s!==void 0?s:0,h=(f=(n=b(e))===null||n===void 0?void 0:n.x)!==null&&f!==void 0?f:0;o.lineTo(c,0),e.forEach(t=>{o.lineTo(t.x,t.y)}),o.lineTo(h,0),o.closePath(),o.clip(),o.beginPath(),e.forEach((t,u)=>{u===0?o.moveTo(t.x,t.y):o.lineTo(t.x,t.y)}),a.slice().reverse().forEach(t=>{o.lineTo(t.x,t.y)}),o.closePath(),o.fillStyle=i.singleColor?i.singleColor:m(r||"#383838",.3),o.fill(),o.restore()}}const d=(P,o)=>P.map(r=>{const{centerUnit:e,close:a}=r,i=o.toX(e),l=o.toY(a);return{x:i,y:l}});export const isDifferenceTool=P=>P==="DIFFERENCE";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
7
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
8
|
+
export declare class HistogramDrawer implements SeriesDrawer {
|
|
9
|
+
constructor();
|
|
10
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{floor as a}from"../../utils/math.utils";import{setLineWidth as g}from"../data-series.drawer";export class HistogramDrawer{constructor(){}draw(o,c,r,e){const h=r.view.toY(0);c.forEach((l,v)=>{var t;const i=r.getPaintConfig(v);g(o,i.lineWidth,r,e,i.hoveredLineWidth),o.strokeStyle=(t=e.singleColor)!==null&&t!==void 0?t:i.color,o.beginPath(),l.forEach(n=>{const s=r.view.toX(n.centerUnit),f=r.view.toY(n.close);o.moveTo(s,a(h)),o.lineTo(s,a(f))}),o.stroke()})}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
7
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
8
|
+
export declare class LinearDrawer implements SeriesDrawer {
|
|
9
|
+
constructor();
|
|
10
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
11
|
+
private drawLinePath;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{setLineWidth as s}from"../data-series.drawer";import{buildLinePath as l}from"./data-series-drawers.utils";export class LinearDrawer{constructor(){}draw(i,e,r,n){e.forEach((a,h)=>{var o;const t=r.getPaintConfig(h);s(i,t.lineWidth,r,n,t.hoveredLineWidth),i.strokeStyle=(o=n.singleColor)!==null&&o!==void 0?o:t.color,this.drawLinePath(i,a,r.view)})}drawLinePath(i,e,r){i.beginPath(),l(e,i,r),i.stroke()}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
7
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
8
|
+
export declare class PointsDrawer implements SeriesDrawer {
|
|
9
|
+
constructor();
|
|
10
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export class PointsDrawer{constructor(){}draw(o,a,i,l){a.forEach((e,s)=>{var n;const t=i.getPaintConfig(s),c=t.lineWidth;o.fillStyle=(n=l.singleColor)!==null&&n!==void 0?n:t.color,o.lineWidth=1,e.forEach(r=>{o.beginPath();const f=i.view.toX(r.centerUnit),h=i.view.toY(r.close);o.arc(f,h,c,0,Math.PI*2),o.fill()})})}}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { SeriesDrawer } from '../data-series.drawer';
|
|
7
|
+
export declare class RectangularToolDrawer implements SeriesDrawer {
|
|
8
|
+
draw(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export class RectangularToolDrawer{draw(){}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { FullChartConfig } from '../../chart.config';
|
|
7
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
8
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
9
|
+
export declare class TextDrawer implements SeriesDrawer {
|
|
10
|
+
private config;
|
|
11
|
+
constructor(config: FullChartConfig);
|
|
12
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{calculateSymbolHeight as y,calculateTextWidth as u}from"../../utils/canvas/canvas-font-measure-tool.utils";export class TextDrawer{constructor(t){this.config=t}draw(t,r,o,l){t.save(),r.forEach((a,f)=>{var e;const s=o.getPaintConfig(f);t.fillStyle=(e=l.singleColor)!==null&&e!==void 0?e:s.color;const i=s.lineWidth+"px "+this.config.components.yAxis.fontFamily;t.font=i,a.forEach(n=>{const c=o.getTextForPoint(n),g=u(c,t,i),h=y(i,t),v=o.view.toX(n.centerUnit)-g/2,x=o.view.toY(n.close)+h;t.fillText(c,v,x)})}),t.restore()}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { VisualSeriesPoint, DataSeriesModel } from '../../model/data-series.model';
|
|
7
|
+
import { SeriesDrawer } from '../data-series.drawer';
|
|
8
|
+
export declare class TrendHistogramDrawer implements SeriesDrawer {
|
|
9
|
+
constructor();
|
|
10
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel): void;
|
|
11
|
+
private previousValue;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import{flat as v}from"../../utils/array.utils";import{floor as c}from"../../utils/math.utils";export class TrendHistogramDrawer{constructor(){}draw(o,e,s){const f=s.view.toY(0),h=v(e),i=[[],[]];h.forEach((n,r,t)=>{i[n.close<this.previousValue(t,r)?1:0].push(n)}),i.forEach((n,r)=>{const t=s.getPaintConfig(r);o.strokeStyle=r===0?t.color:t.aditionalColor||"#FF00FF",o.lineWidth=t.lineWidth,o.beginPath(),n.forEach(l=>{const a=s.view.toX(l.centerUnit),u=s.view.toY(l.close);o.moveTo(a,c(f)),o.lineTo(a,c(u))}),o.stroke()})}previousValue(o,e){do e--;while(e>=0&&!isFinite(o[e]&&o[e].close));return o[e]?o[e].close:Number.NaN}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
import { DataSeriesModel, VisualSeriesPoint } from '../../model/data-series.model';
|
|
7
|
+
import { ChartDrawerConfig, SeriesDrawer } from '../data-series.drawer';
|
|
8
|
+
export declare class TriangleDrawer implements SeriesDrawer {
|
|
9
|
+
constructor();
|
|
10
|
+
draw(ctx: CanvasRenderingContext2D, allPoints: VisualSeriesPoint[][], model: DataSeriesModel, drawerConfig: ChartDrawerConfig): void;
|
|
11
|
+
private drawCandleTriangle;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2002 - 2023 Devexperts LLC
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
|
+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
*/
|
|
6
|
+
export class TriangleDrawer{constructor(){}draw(o,e,n,l){e.forEach((s,c)=>{var i;const r=n.getPaintConfig(c);o.fillStyle=(i=l.singleColor)!==null&&i!==void 0?i:r.color,s.forEach(a=>{const t=n.view.toX(a.centerUnit),f=n.view.toY(a.close);this.drawCandleTriangle(o,t,f,r.lineWidth)})})}drawCandleTriangle(o,e,n,l){o.beginPath(),o.moveTo(e-l/2,n),o.lineTo(e,n-l),o.lineTo(e+l/2,n),o.fill()}}
|