@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,150 @@
|
|
|
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 { Observable, Subject } from 'rxjs';
|
|
7
|
+
import { BarType, FullChartColors } from '../chart.config';
|
|
8
|
+
import { ChartInstrument } from '../components/chart/chart.component';
|
|
9
|
+
import { CandleWidthCalculator, VisualCandleCalculator } from '../components/chart/chart.model';
|
|
10
|
+
import { YExtentComponent } from '../components/pane/extent/y-extent-component';
|
|
11
|
+
import EventBus from '../events/event-bus';
|
|
12
|
+
import { DeepPartial } from '../utils/object.utils';
|
|
13
|
+
import { Candle } from './candle.model';
|
|
14
|
+
import { DataSeriesType } from './data-series.config';
|
|
15
|
+
import { DataSeriesModel } from './data-series.model';
|
|
16
|
+
import { HighLowWithIndex, ScaleModel } from './scale.model';
|
|
17
|
+
import { Unit } from './scaling/viewport.model';
|
|
18
|
+
import VisualCandle from './visual-candle';
|
|
19
|
+
export type PriceMovement = 'up' | 'down' | 'none';
|
|
20
|
+
export declare class CandleSeriesModel extends DataSeriesModel<Candle, VisualCandle> {
|
|
21
|
+
private eventBus;
|
|
22
|
+
private readonly candlesTransformersByChartType;
|
|
23
|
+
private readonly candleWidthByChartType;
|
|
24
|
+
colors: CandleSeriesColors;
|
|
25
|
+
zippedHighLow: HighLowWithIndex;
|
|
26
|
+
activeCandle?: Candle;
|
|
27
|
+
currentPrice: number | undefined;
|
|
28
|
+
previousPrice: number | undefined;
|
|
29
|
+
lastPriceMovement: PriceMovement;
|
|
30
|
+
lastVisualCandleChangedSubject: Subject<void>;
|
|
31
|
+
get dataPoints(): Candle[];
|
|
32
|
+
set dataPoints(points: Candle[] | Candle[][]);
|
|
33
|
+
private _instrument;
|
|
34
|
+
get instrument(): ChartInstrument;
|
|
35
|
+
set instrument(instrument: ChartInstrument);
|
|
36
|
+
meanCandleWidth: Unit;
|
|
37
|
+
constructor(extentComponent: YExtentComponent, id: number, eventBus: EventBus, scaleModel: ScaleModel, instrument: ChartInstrument, candlesTransformersByChartType: Partial<Record<DataSeriesType, VisualCandleCalculator>>, candleWidthByChartType: Partial<Record<DataSeriesType, CandleWidthCalculator>>, colors?: CandleSeriesColors);
|
|
38
|
+
/**
|
|
39
|
+
* Recalculates data viewport indexes based on xStart and xEnd parameters or values from scaleModel.
|
|
40
|
+
* Calls superclass method for calculation, recalculates zipped high/low data points, and fires draw event.
|
|
41
|
+
*
|
|
42
|
+
* @param {number} [xStart=this.scaleModel.xStart] - Start index of visible data range.
|
|
43
|
+
* @param {number} [xEnd=this.scaleModel.xEnd] - End index of visible data range.
|
|
44
|
+
* @returns {void}
|
|
45
|
+
*/
|
|
46
|
+
recalculateDataViewportIndexes(xStart?: number, xEnd?: number): void;
|
|
47
|
+
/**
|
|
48
|
+
* Calculates the price movement of the last candle by comparing the open and close prices.
|
|
49
|
+
* Sets the lastPriceMovement property of the instance with the name of the direction of the price movement.
|
|
50
|
+
*
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
53
|
+
private applyPriceMovement;
|
|
54
|
+
/**
|
|
55
|
+
* Should be called 1 time when candles are set / updated to chart.
|
|
56
|
+
*/
|
|
57
|
+
recalculateVisualPoints(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Used for optimization when we have to update only the last candle
|
|
60
|
+
* @doc-tags tricky
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* Recalculates and returns the zipped high-low values for the visible data range.
|
|
64
|
+
* Uses the visualPoints, dataIdxStart, and dataIdxEnd properties of the instance to calculate high-low values.
|
|
65
|
+
*
|
|
66
|
+
* @returns {HighLowWithIndex} - An object containing the high-low values along with their corresponding indexes.
|
|
67
|
+
*/
|
|
68
|
+
recalculateZippedHighLow(): HighLowWithIndex;
|
|
69
|
+
/**
|
|
70
|
+
* Updates the current price and the last price movement.
|
|
71
|
+
* Compares the current price with the previous price, and sets the lastPriceMovement property accordingly.
|
|
72
|
+
*
|
|
73
|
+
* @param {number} currentPrice - The current price of the asset.
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
updateCurrentPrice(currentPrice: number): void;
|
|
77
|
+
/**
|
|
78
|
+
* Updates the colors used to render the candlestick series and recalculates the visual points.
|
|
79
|
+
* Merges the newConfig object with the existing colors object of the instance.
|
|
80
|
+
* Calls the recalculateVisualPoints method of the instance to update the visual points using the new color configuration.
|
|
81
|
+
*
|
|
82
|
+
* @param {PartialCandleSeriesColors} newConfig - The new color configuration to be merged with the existing colors object.
|
|
83
|
+
* @returns {void}
|
|
84
|
+
*/
|
|
85
|
+
updateCandleSeriesColors(newConfig: PartialCandleSeriesColors): void;
|
|
86
|
+
/**
|
|
87
|
+
* Returns an observable that emits an event when the last visual candle changes.
|
|
88
|
+
* Returns the observable associated with the lastVisualCandleChangedSubject of the instance.
|
|
89
|
+
*
|
|
90
|
+
* @returns {Observable<void>} - An observable that emits an event when the last visual candle changes.
|
|
91
|
+
*/
|
|
92
|
+
observeLastVisualCandleChanged(): Observable<void>;
|
|
93
|
+
doDeactivate(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Transforms candles list into visual candles.
|
|
96
|
+
* NOTE: should be used only on FULL candles array, no single transformations, since candle coordinates depend on each other.
|
|
97
|
+
* OR provide startX :)
|
|
98
|
+
* @param candles
|
|
99
|
+
* @param startX
|
|
100
|
+
*/
|
|
101
|
+
toVisualPoints(candles: Array<Candle>, startX?: number): Array<VisualCandle>;
|
|
102
|
+
/**
|
|
103
|
+
* Recalculates the mean candle width using the given array of visual candles.
|
|
104
|
+
* Calculates the sum of widths of all visual candles and divides it by the total number of candles to get the mean candle width.
|
|
105
|
+
* Sets the meanCandleWidth property of the instance with the calculated value.
|
|
106
|
+
*
|
|
107
|
+
* @param {VisualCandle[]} visualCandles - An array of visual candles to be used for mean candle width calculation.
|
|
108
|
+
* @returns {void}
|
|
109
|
+
*/
|
|
110
|
+
recalculateMeanCandleWidth(visualCandles: VisualCandle[]): void;
|
|
111
|
+
/**
|
|
112
|
+
* Sets the active candle for the chart and recalculates the visual points.
|
|
113
|
+
* Sets the activeCandle property of the instance with the provided candle parameter.
|
|
114
|
+
* Calls the recalculateVisualPoints method of the instance to recalculate the visual points using the new active candle.
|
|
115
|
+
*
|
|
116
|
+
* @param {Candle} candle - The candle to be set as active candle.
|
|
117
|
+
* @returns {void}
|
|
118
|
+
*/
|
|
119
|
+
setActiveCandle(candle: Candle): void;
|
|
120
|
+
/**
|
|
121
|
+
* Clears all the data and visual elements from the chart.
|
|
122
|
+
* Sets the dataPoints property of the instance to an empty array.
|
|
123
|
+
* Calls the clearVisualCandles and clearPrices methods of the instance to clear the visual elements from the chart.
|
|
124
|
+
*
|
|
125
|
+
* @returns {void}
|
|
126
|
+
*/
|
|
127
|
+
clearData(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Clears the price-related properties of the instance.
|
|
130
|
+
* Sets the previousPrice, currentPrice and lastPriceMovement properties of the instance to undefined, undefined, and 'none' respectively.
|
|
131
|
+
*
|
|
132
|
+
* @returns {void}
|
|
133
|
+
*/
|
|
134
|
+
clearPrices(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Clears the visualPoints property of the instance.
|
|
137
|
+
* Sets the visualPoints property of the instance to an empty array.
|
|
138
|
+
*
|
|
139
|
+
* @returns {void}
|
|
140
|
+
*/
|
|
141
|
+
clearVisualCandles(): void;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Checks if the provided chart type is linked.
|
|
145
|
+
* @param {BarType} chartType - The type of chart to check.
|
|
146
|
+
* @returns {boolean} - Returns true if the chart type is linked, false otherwise.
|
|
147
|
+
*/
|
|
148
|
+
export declare function isLinked(chartType: BarType): boolean;
|
|
149
|
+
export type CandleSeriesColors = FullChartColors;
|
|
150
|
+
export type PartialCandleSeriesColors = DeepPartial<CandleSeriesColors>;
|
|
@@ -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{Subject as C}from"rxjs";import{getDefaultConfig as f}from"../chart.config";import{defaultCandleTransformer as v}from"../components/chart/candle-transformer.functions";import{calculateCandleWidth as g}from"../components/chart/candle-width-calculator.functions";import{lastOf as w}from"../utils/array.utils";import{merge as D}from"../utils/merge.utils";import{PriceIncrementsUtils as y}from"../utils/price-increments.utils";import{calculateCandlesHighLow as L,createCandleSeriesHighLowProvider as M}from"./candle-series-high-low.provider";import{BASIC_CANDLE_WIDTH as u,nameDirection as S}from"./candle.model";import{DataSeriesModel as V}from"./data-series.model";import{getDefaultHighLowWithIndex as x}from"./scale.model";const I=f().colors;export class CandleSeriesModel extends V{get dataPoints(){return super.dataPoints}set dataPoints(e){super.dataPoints=e,this.applyPriceMovement()}get instrument(){return this._instrument}set instrument(e){var t;this._instrument=e,this.pricePrecisions=y.computePrecisions((t=e.priceIncrements)!==null&&t!==void 0?t:[.01])}constructor(e,t,i,a,s,r,n,o=I){super(e,t),this.eventBus=i,this.candlesTransformersByChartType=r,this.candleWidthByChartType=n,this.colors=o,this.zippedHighLow=x(),this.lastPriceMovement="none",this.lastVisualCandleChangedSubject=new C,this.meanCandleWidth=u,this._instrument=s,this.instrument=s,this.highLowProvider=M(this),this.scaleModel=a,this.name=s.symbol}recalculateDataViewportIndexes(e=this.scaleModel.xStart,t=this.scaleModel.xEnd){super.recalculateDataViewportIndexes(e,t),this.recalculateZippedHighLow(),this.eventBus.fireDraw()}applyPriceMovement(){const e=w(this.dataPoints);e&&(this.lastPriceMovement=S(e.open,e.close))}recalculateVisualPoints(){super.recalculateVisualPoints(),this.recalculateMeanCandleWidth(this.visualPoints)}recalculateZippedHighLow(){return this.zippedHighLow=L(this.visualPoints.slice(this.dataIdxStart,this.dataIdxEnd))}updateCurrentPrice(e){this.previousPrice=this.currentPrice||e,this.currentPrice=e,this.currentPrice!==this.previousPrice&&(this.lastPriceMovement=this.currentPrice>this.previousPrice?"up":"down")}updateCandleSeriesColors(e){this.colors=D(e,this.colors),this.recalculateVisualPoints()}observeLastVisualCandleChanged(){return this.lastVisualCandleChangedSubject.asObservable()}doDeactivate(){super.doDeactivate()}toVisualPoints(e,t=0){var i,a;if(e.length===0)return[];const s=this.config.type,r=[];let n=t;const o=(i=this.candleWidthByChartType[s])!==null&&i!==void 0?i:g;for(let l=0;l<e.length;l++){const d=e[l],p=e[l-1],c=o(d),m=n+c/2,P=(a=this.candlesTransformersByChartType[s])!==null&&a!==void 0?a:v;r.push(P(d,{x:m,width:c,prevCandle:p,activeCandle:this.activeCandle})),n+=c}return r}recalculateMeanCandleWidth(e){e.length!==0?this.meanCandleWidth=e.reduce((t,i)=>t+i.width,0)/e.length:this.meanCandleWidth=u}setActiveCandle(e){this.activeCandle=e,this.recalculateVisualPoints()}clearData(){this.dataPoints=[],this.clearVisualCandles(),this.clearPrices()}clearPrices(){this.previousPrice=void 0,this.currentPrice=void 0,this.lastPriceMovement="none"}clearVisualCandles(){this.visualPoints=[]}}export function isLinked(h){switch(h){case"line":case"area":return!0;default:return!1}}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { Unit } from './scaling/viewport.model';
|
|
7
|
+
import { PriceMovement } from './candle-series.model';
|
|
8
|
+
export declare const BASIC_CANDLE_WIDTH: Unit;
|
|
9
|
+
/**
|
|
10
|
+
* @doc-tags model
|
|
11
|
+
* @doc-tags-name Candle
|
|
12
|
+
*/
|
|
13
|
+
export interface Candle {
|
|
14
|
+
readonly hi: number;
|
|
15
|
+
readonly lo: number;
|
|
16
|
+
readonly open: number;
|
|
17
|
+
readonly close: number;
|
|
18
|
+
readonly timestamp: number;
|
|
19
|
+
volume: number;
|
|
20
|
+
readonly expansion?: boolean;
|
|
21
|
+
idx?: number;
|
|
22
|
+
readonly impVolatility?: number;
|
|
23
|
+
readonly vwap?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Provides the name of candle difference
|
|
27
|
+
* @param {Number} open
|
|
28
|
+
* @param {Number} close
|
|
29
|
+
* @returns {String}
|
|
30
|
+
*/
|
|
31
|
+
export declare function nameDirection(open: number, close: number): PriceMovement;
|
|
32
|
+
/**
|
|
33
|
+
* Provides the name of candle difference for hollow chart type
|
|
34
|
+
* @param {Number} open
|
|
35
|
+
* @param {Number} close
|
|
36
|
+
* @returns {String}
|
|
37
|
+
*/
|
|
38
|
+
export declare function hollowDirection(open: number, close: number): PriceMovement;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new Candle object based on the provided base object, with the option to modify the prices.
|
|
41
|
+
* @param {Candle} base - The base object to copy.
|
|
42
|
+
* @param {number} idx - The index of the new Candle object.
|
|
43
|
+
* @param {boolean} pricesAsClose - If true, the high, low, and open prices will be set to the close price.
|
|
44
|
+
* @returns {Candle} A new Candle object with the same properties as the base object, with the option to modify the prices.
|
|
45
|
+
*/
|
|
46
|
+
export declare function copyCandle(base: Candle, idx: number, pricesAsClose?: boolean): Candle;
|
|
@@ -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 BASIC_CANDLE_WIDTH=1;export function nameDirection(e,n){return n===e?"none":n>e?"up":"down"}export function hollowDirection(e,n){return n>e?"up":"down"}export function copyCandle(e,n,u=!1){const{expansion:p,impVolatility:c,vwap:f,volume:d,timestamp:x}=e;let o=e.hi,i=e.lo,r=e.open;const t=e.close;u&&(o=t,i=t,r=t);let l=e.idx;return n!==void 0&&(l=n),{hi:o,lo:i,open:r,close:t,timestamp:x,volume:d,expansion:p,idx:l,impVolatility:c,vwap:f}}
|
|
@@ -0,0 +1,131 @@
|
|
|
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 EventBus from '../events/event-bus';
|
|
8
|
+
import { PickedDOMRect } from '../inputhandlers/chart-resize.handler';
|
|
9
|
+
import { DrawingManager } from '../drawers/drawing-manager';
|
|
10
|
+
/**
|
|
11
|
+
* The minimum supported canvas size in chart-core (in pixels).
|
|
12
|
+
* Any size of <canvas> element below these dimensions will not be rendered (is NOT INTENDED to be rendered).
|
|
13
|
+
* @doc-tags chart-core,canvas
|
|
14
|
+
*/
|
|
15
|
+
export declare const MIN_SUPPORTED_CANVAS_SIZE: {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
export declare class CanvasModel {
|
|
20
|
+
private eventBus;
|
|
21
|
+
canvas: HTMLCanvasElement;
|
|
22
|
+
drawingManager: DrawingManager;
|
|
23
|
+
private resizer?;
|
|
24
|
+
private readonly context;
|
|
25
|
+
parent: HTMLElement;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
prevHeight: number;
|
|
29
|
+
prevWidth: number;
|
|
30
|
+
private readonly _canvasId;
|
|
31
|
+
type: CanvasBarType;
|
|
32
|
+
constructor(eventBus: EventBus, canvas: HTMLCanvasElement, drawingManager: DrawingManager, canvasModels: CanvasModel[], resizer?: HTMLElement | undefined, options?: CanvasRenderingContext2DSettings);
|
|
33
|
+
/**
|
|
34
|
+
* About rendering for non-integer dpi
|
|
35
|
+
* https://stackoverflow.com/questions/17553557/draw-crisp-lines-on-html5-canvas-with-browser-zoom
|
|
36
|
+
* @param bcr
|
|
37
|
+
*/
|
|
38
|
+
updateDPR(bcr: PickedDOMRect | ClientRect): void;
|
|
39
|
+
get canvasId(): string;
|
|
40
|
+
get ctx(): CanvasRenderingContext2D;
|
|
41
|
+
/**
|
|
42
|
+
* Clears the canvas by using the clearRect method of the canvas context.
|
|
43
|
+
* @function
|
|
44
|
+
* @name clear
|
|
45
|
+
* @memberof Canvas
|
|
46
|
+
* @returns {void}
|
|
47
|
+
*/
|
|
48
|
+
clear(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Checks if the type is linked.
|
|
51
|
+
*
|
|
52
|
+
* @returns {boolean} Returns true if the type is linked, false otherwise.
|
|
53
|
+
*/
|
|
54
|
+
isLinked(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Triggers the 'fireDraw' event on the event bus with the canvas ID as the parameter.
|
|
57
|
+
*/
|
|
58
|
+
fireDraw(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Updates the width and height of the canvas element based on the client width and height of the canvas element and the height of the chart resizer element.
|
|
61
|
+
* @param {HTMLCanvasElement} canvas - The canvas element to update.
|
|
62
|
+
* @param {ClientRect | DOMRect} [bcr=this.getChartResizerElement().getBoundingClientRect()] - The bounding client rectangle of the chart resizer element.
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
|
+
private updateCanvasWidthHeight;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the chart resizer element. If the resizer is not defined, it returns the parent element.
|
|
68
|
+
*
|
|
69
|
+
* @returns {HTMLElement} The chart resizer element.
|
|
70
|
+
*/
|
|
71
|
+
getChartResizerElement(): HTMLElement;
|
|
72
|
+
/**
|
|
73
|
+
* Checks if the canvas is ready to be used by verifying if its width and height are greater than the minimum supported canvas size.
|
|
74
|
+
*
|
|
75
|
+
* @returns {boolean} - Returns true if the canvas is ready to be used, false otherwise.
|
|
76
|
+
*/
|
|
77
|
+
isReady(): boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface CanvasBarType {
|
|
80
|
+
name: string;
|
|
81
|
+
linked?: boolean;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Creates a new canvas model for the main chart canvas.
|
|
85
|
+
*
|
|
86
|
+
* @param {EventBus} eventBus - The event bus used to communicate between components.
|
|
87
|
+
* @param {HTMLCanvasElement} canvas - The canvas element to create the model for.
|
|
88
|
+
* @param {HTMLElement} resizer - The element used to resize the canvas.
|
|
89
|
+
* @param {BarType} barType - The type of bar to use for the chart.
|
|
90
|
+
* @param {FullChartConfig} config - The configuration object for the chart.
|
|
91
|
+
* @param {DrawingManager} drawingManager - The drawing manager used to draw on the canvas.
|
|
92
|
+
* @param {CanvasModel[]} canvasModels - An array of canvas models to add the new model to.
|
|
93
|
+
*
|
|
94
|
+
* @returns {CanvasModel} The newly created canvas model.
|
|
95
|
+
|
|
96
|
+
export function createMainCanvasModel(
|
|
97
|
+
eventBus,
|
|
98
|
+
canvas,
|
|
99
|
+
resizer,
|
|
100
|
+
barType,
|
|
101
|
+
config,
|
|
102
|
+
drawingManager,
|
|
103
|
+
canvasModels,
|
|
104
|
+
) {
|
|
105
|
+
const canvasModel = createCanvasModel(eventBus, canvas, config, drawingManager, canvasModels, resizer);
|
|
106
|
+
// @ts-ignore
|
|
107
|
+
canvasModel.type = TYPES[barType] ?? CANDLE_TYPE;
|
|
108
|
+
return canvasModel;
|
|
109
|
+
}*/
|
|
110
|
+
export declare function createMainCanvasModel(eventBus: EventBus, canvas: HTMLCanvasElement, resizer: HTMLElement, barType: BarType, config: FullChartConfig, drawingManager: DrawingManager, canvasModels: CanvasModel[]): CanvasModel;
|
|
111
|
+
/**
|
|
112
|
+
* Creates a new CanvasModel instance.
|
|
113
|
+
*
|
|
114
|
+
* @param {EventBus} eventBus - The event bus to use.
|
|
115
|
+
* @param {HTMLCanvasElement} canvas - The canvas element to use.
|
|
116
|
+
* @param {FullChartConfig} config - The configuration object for the chart.
|
|
117
|
+
* @param {DrawingManager} drawingManager - The drawing manager to use.
|
|
118
|
+
* @param {CanvasModel[]} canvasModels - An array of existing canvas models.
|
|
119
|
+
* @param {HTMLElement} [resizer] - The element to use for resizing the canvas.
|
|
120
|
+
*
|
|
121
|
+
* @returns {CanvasModel} A new instance of the CanvasModel class.
|
|
122
|
+
*/
|
|
123
|
+
export declare function createCanvasModel(eventBus: EventBus, canvas: HTMLCanvasElement, config: FullChartConfig, drawingManager: DrawingManager, canvasModels: CanvasModel[], resizer?: HTMLElement, options?: CanvasRenderingContext2DSettings): CanvasModel;
|
|
124
|
+
/**
|
|
125
|
+
* Initializes a canvas with a given configuration.
|
|
126
|
+
* @param {CanvasModel} canvasModel - The canvas model to be initialized.
|
|
127
|
+
* @param {FullChartConfig} config - The configuration object for the canvas.
|
|
128
|
+
* @returns {void}
|
|
129
|
+
|
|
130
|
+
*/
|
|
131
|
+
export declare function initCanvasWithConfig(canvasModel: CanvasModel, config: FullChartConfig): 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 MIN_SUPPORTED_CANVAS_SIZE={width:20,height:20};export class CanvasModel{constructor(t,e,i,n,r,a={}){var s;this.eventBus=t,this.canvas=e,this.drawingManager=i,this.resizer=r,this.width=0,this.height=0,this.prevHeight=0,this.prevWidth=0,this.type=l,n.push(this),this.parent=p(e);const d=e.getContext("2d",a);if(d===null)throw new Error("Couldn't get 2d context????");this.context=d,this._canvasId=(s=e.getAttribute("data-element"))!==null&&s!==void 0?s:"",this.updateCanvasWidthHeight(e,this.getChartResizerElement().getBoundingClientRect())}updateDPR(t){const{width:e,height:i}=t,n=window.devicePixelRatio;this.canvas.style.height=i+"px",this.canvas.style.width=e+"px",this.canvas.width=e*n,this.canvas.height=i*n,this.width=e,this.height=i,this.ctx.scale(n,n)}get canvasId(){return this._canvasId}get ctx(){return this.context}clear(){this.context.clearRect(0,0,this.width,this.height)}isLinked(){var t,e;return(e=(t=this.type)===null||t===void 0?void 0:t.linked)!==null&&e!==void 0?e:!1}fireDraw(){this.eventBus.fireDraw([this.canvasId])}updateCanvasWidthHeight(t,e=this.getChartResizerElement().getBoundingClientRect()){t.clientWidth!==this.width&&(t.width=t.clientWidth,this.width=t.clientWidth);const i=e.height;i!==this.height&&(t.style.height=i+"px",this.height=i,t.height=i,this.prevHeight=i)}getChartResizerElement(){var t;return(t=this.resizer)!==null&&t!==void 0?t:this.parent}isReady(){return this.width>MIN_SUPPORTED_CANVAS_SIZE.width&&this.height>MIN_SUPPORTED_CANVAS_SIZE.height}}const l={name:"candle"},o={name:"candle"},c={name:"line",linked:!0},g={name:"area",linked:!0},u={candle:l,bar:o,line:c,area:g};export function createMainCanvasModel(h,t,e,i,n,r,a){var s;const d=createCanvasModel(h,t,n,r,a,e);return d.type=(s=u[i])!==null&&s!==void 0?s:l,d}export function createCanvasModel(h,t,e,i,n,r,a){const s=new CanvasModel(h,t,i,n,r,a);return initCanvasWithConfig(s,e),s}export function initCanvasWithConfig(h,t){const e=h.canvas;t.fixedSize&&(e.width=t.fixedSize.width,e.height=t.fixedSize.height,e.style.width=t.fixedSize.width+"px",e.style.height=t.fixedSize.height+"px",h.width=t.fixedSize.width,h.height=t.fixedSize.height),e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.direction="ltr"}function p(h){let t=h;for(;t;){if(t.nodeType===1&&t.hasAttribute("data-chart-container"))return t;if(t.parentElement!==null)t=t.parentElement;else break}return t}
|
|
@@ -0,0 +1,103 @@
|
|
|
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 { Subscription } from 'rxjs/internal/Subscription';
|
|
7
|
+
import { Unsubscriber } from '../utils/function.utils';
|
|
8
|
+
export type ChartEntityState = 'initial' | 'active' | 'deactivated' | 'disabled';
|
|
9
|
+
/**
|
|
10
|
+
* Chart entity has the following lifecycle: initial -> active <=> deactivated -> disposed.
|
|
11
|
+
* Methods of chart entity allows to transit entity between its states.
|
|
12
|
+
*/
|
|
13
|
+
export interface ChartEntity {
|
|
14
|
+
/** Make entity active. Next allowed stated: deactivated,disposed */
|
|
15
|
+
activate(): void;
|
|
16
|
+
/** Make entity inactive. Next allowed states: active,disposed. */
|
|
17
|
+
deactivate(): void;
|
|
18
|
+
/** Make entity disabled & inactive, cannot activate it */
|
|
19
|
+
disable(): void;
|
|
20
|
+
/** Make entity enabled & active */
|
|
21
|
+
enable(): void;
|
|
22
|
+
/** Get current state of chart entity */
|
|
23
|
+
getState(): ChartEntityState;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Base class for chart elements. Contains lifecycle support, utility methods.
|
|
27
|
+
*
|
|
28
|
+
* Chart entity state transition: INITIAL -> ACTIVE <-> DEACTIVATED -> DISPOSED
|
|
29
|
+
*/
|
|
30
|
+
export declare abstract class ChartBaseElement implements ChartEntity {
|
|
31
|
+
private subscriptions;
|
|
32
|
+
private _state;
|
|
33
|
+
private entities;
|
|
34
|
+
/**
|
|
35
|
+
* This method is used to activate a protected feature.
|
|
36
|
+
* It does not take any arguments and does not return anything.
|
|
37
|
+
*/
|
|
38
|
+
protected doActivate(): void;
|
|
39
|
+
/**
|
|
40
|
+
* This method is used to unsubscribe from all events.
|
|
41
|
+
* It clears the subscriptions array.
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
protected doDeactivate(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Enables the functionality of an object.
|
|
47
|
+
* If the object is not currently active, it sets the state to 'deactivated' and activates it.
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
enable(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Disables the current object if it is not already disabled.
|
|
53
|
+
* If the object is not disabled, it will be deactivated and its state will be set to 'disabled'.
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
56
|
+
disable(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Activates the entity and all its child entities.
|
|
59
|
+
* If the entity is already active, it does nothing.
|
|
60
|
+
* If the entity is disabled, it does nothing.
|
|
61
|
+
* @returns {void}
|
|
62
|
+
*/
|
|
63
|
+
activate(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Deactivates the entity and all its child entities.
|
|
66
|
+
* If the entity is already disabled, it does nothing.
|
|
67
|
+
* If the entity is not yet deactivated, it calls the doDeactivate method and sets the state to 'deactivated'.
|
|
68
|
+
* Finally, it deactivates all child entities.
|
|
69
|
+
* @returns {void}
|
|
70
|
+
*/
|
|
71
|
+
deactivate(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the current state of the ChartEnitity instance.
|
|
74
|
+
* @returns {ChartEntityState} The current state of the ChartEnitity instance.
|
|
75
|
+
*/
|
|
76
|
+
getState(): ChartEntityState;
|
|
77
|
+
/**
|
|
78
|
+
* Adds default subscription
|
|
79
|
+
* @param fn - an unsubscriber function
|
|
80
|
+
* @protected
|
|
81
|
+
*/
|
|
82
|
+
addSubscription(fn: Unsubscriber): void;
|
|
83
|
+
/**
|
|
84
|
+
* Adds rxjs subscription
|
|
85
|
+
* @param subscription
|
|
86
|
+
* @protected
|
|
87
|
+
*/
|
|
88
|
+
protected addRxSubscription(subscription?: Subscription): void;
|
|
89
|
+
/**
|
|
90
|
+
* Adds a new entity to the entities array and activates it if the parent entity is active.
|
|
91
|
+
*
|
|
92
|
+
* @param {Entity} entity - The entity to be added to the entities array.
|
|
93
|
+
* @returns {void}
|
|
94
|
+
*/
|
|
95
|
+
addChildEntity(entity: ChartEntity): void;
|
|
96
|
+
/**
|
|
97
|
+
* Removes a entity from the entities array.
|
|
98
|
+
*
|
|
99
|
+
* @param {ChartEntity} entity - The entity to be removed.
|
|
100
|
+
* @returns {void}
|
|
101
|
+
*/
|
|
102
|
+
removeChildEntity(entity: ChartEntity): void;
|
|
103
|
+
}
|
|
@@ -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 ChartBaseElement{constructor(){this.subscriptions=[],this._state="initial",this.entities=[]}doActivate(){}doDeactivate(){this.subscriptions.forEach(t=>t()),this.subscriptions=[]}enable(){this._state!=="active"&&(this._state="deactivated",this.activate())}disable(){this._state!=="disabled"&&(this.deactivate(),this._state="disabled")}activate(){this._state!=="disabled"&&(this._state!=="active"&&(this.doActivate(),this._state="active"),this.entities.forEach(t=>t.activate()))}deactivate(){this._state!=="disabled"&&(this._state!=="deactivated"&&(this.doDeactivate(),this._state="deactivated"),this.entities.forEach(t=>t.deactivate()))}getState(){return this._state}addSubscription(t){this.subscriptions.push(t)}addRxSubscription(t){t&&this.subscriptions.push(t.unsubscribe.bind(t))}addChildEntity(t){this.entities.push(t),this._state==="active"&&t.activate()}removeChildEntity(t){this.entities=this.entities.filter(i=>i!==t)}}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { BaseHover, HoverProducerPart } from '../inputhandlers/hover-producer.component';
|
|
8
|
+
export interface CompareSeriesHover {
|
|
9
|
+
instrument: string;
|
|
10
|
+
price: string;
|
|
11
|
+
id: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class CompareSeriesHoverProducerPart implements HoverProducerPart<CompareSeriesHover[]> {
|
|
14
|
+
private chartModel;
|
|
15
|
+
constructor(chartModel: ChartModel);
|
|
16
|
+
/**
|
|
17
|
+
* Returns an array of objects containing information about the series of candles at a specific x-coordinate.
|
|
18
|
+
* @param {BaseHover} hover - The hover object containing the x-coordinate.
|
|
19
|
+
* @returns {CompareSeriesHover[]} An array of objects containing the instrument symbol, price and id of each series of candles.
|
|
20
|
+
*/
|
|
21
|
+
getData(hover: BaseHover): CompareSeriesHover[];
|
|
22
|
+
}
|
|
@@ -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 CompareSeriesHoverProducerPart{constructor(e){this.chartModel=e}getData(e){const{x:t}=e,c=this.chartModel.candleFromX(t).idx||0;return this.chartModel.candleSeries.map(r=>{const o=r.dataPoints[c],a=this.chartModel.pane.regularFormatter(o==null?void 0:o.close);return{instrument:r.instrument.symbol,price:a,id:r.id}})}}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { PriceAxisType } from '../components/labels_generator/numeric-axis-labels.generator';
|
|
7
|
+
import { DataSeriesModel } from './data-series.model';
|
|
8
|
+
import { ScaleModel } from './scale.model';
|
|
9
|
+
import { Index, Pixel, Price, Unit, Viewable } from './scaling/viewport.model';
|
|
10
|
+
/**
|
|
11
|
+
* A class representing a view for a data series chart.
|
|
12
|
+
* It contains methods to convert between price values and pixel coordinates using the selected scale model,
|
|
13
|
+
* as well as between price values and units based on the selected price type and axis type.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DataSeriesView implements Viewable {
|
|
16
|
+
private dataSeries;
|
|
17
|
+
private scaleModel;
|
|
18
|
+
private getAxisType;
|
|
19
|
+
private getBaseLine;
|
|
20
|
+
private percentAnimationHandler;
|
|
21
|
+
constructor(dataSeries: DataSeriesModel, scaleModel: ScaleModel, getAxisType: () => PriceAxisType, getBaseLine: (idx?: Index) => Unit);
|
|
22
|
+
/**
|
|
23
|
+
* Convert the input value to its corresponding y-pixel coordinate based on the selected price type and scale model.
|
|
24
|
+
* @param value - The value to be converted to y-pixel coordinate.
|
|
25
|
+
* @returns - The converted value in y-pixel coordinate.
|
|
26
|
+
*/
|
|
27
|
+
toY: (value: Price) => Pixel;
|
|
28
|
+
/**
|
|
29
|
+
* Convert the input value to the corresponding unit based on the current axis type.
|
|
30
|
+
* @param value - The value to be converted to unit.
|
|
31
|
+
* @param getBaseLine - A function that returns the baseline for percent.
|
|
32
|
+
* @returns - The converted value in the corresponding unit.
|
|
33
|
+
*/
|
|
34
|
+
toAxisUnits(value: Price, getBaseLine?: (idx?: number | undefined) => number): Unit;
|
|
35
|
+
/**
|
|
36
|
+
* Convert the input unit to its corresponding x-pixel coordinate based on the scale model.
|
|
37
|
+
* @param unit - The unit to be converted to x-pixel coordinate.
|
|
38
|
+
* @returns - The converted value in x-pixel coordinate.
|
|
39
|
+
*/
|
|
40
|
+
toX: (unit: Unit) => Pixel;
|
|
41
|
+
xPixels: (unit: Unit) => Pixel;
|
|
42
|
+
/**
|
|
43
|
+
* Pay attention! This method doesn't convert price to pixels, it converts only current axis UNITs!
|
|
44
|
+
* @param unit
|
|
45
|
+
*/
|
|
46
|
+
yPixels: (unit: Unit) => Pixel;
|
|
47
|
+
/**
|
|
48
|
+
* Converts "y" in pixels to price
|
|
49
|
+
* @param y - source value in pixels
|
|
50
|
+
*/
|
|
51
|
+
priceFromY(y: Pixel): Price;
|
|
52
|
+
/**
|
|
53
|
+
* Convert the input unit to its corresponding price value based on the selected axis type.
|
|
54
|
+
* @param {number} unit - The unit to be converted to price value.
|
|
55
|
+
* @returns {number} - The converted value in price.
|
|
56
|
+
*/
|
|
57
|
+
fromAxisUnits(unit: Unit): Price;
|
|
58
|
+
}
|
|
@@ -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{binarySearch as a}from"../utils/array.utils";import{calcLogValue as o,logValueToUnit as l,percentToUnit as c,unitToPercent as h}from"./scaling/viewport.model";class d{constructor(e,i){this.scaleModel=e,this.dataSeries=i,this.prevAnimationId=""}getBaselineForPercent(e){const i=this.scaleModel.currentAnimation;let s;if(i!=null&&i.animationInProgress){i.id!==this.prevAnimationId&&(this.initialBaseline=void 0,this.targetBaseline=void 0,this.prevAnimationId=i.id);const n=i.easingFn(i.getProgress());this.initialBaseline===void 0&&(this.initialBaseline=e(a(this.dataSeries.visualPoints,i.xStart,t=>t.centerUnit).index)),this.targetBaseline===void 0&&(this.targetBaseline=e(a(this.dataSeries.visualPoints,i.animationConfig.targetXStart,t=>t.centerUnit).index)),s=this.initialBaseline+(this.targetBaseline-this.initialBaseline)*n}else s=e();return s}}export class DataSeriesView{constructor(e,i,s,n){this.dataSeries=e,this.scaleModel=i,this.getAxisType=s,this.getBaseLine=n,this.toY=t=>this.scaleModel.toY(this.toAxisUnits(t)),this.toX=t=>this.scaleModel.toX(t),this.xPixels=t=>this.scaleModel.xPixels(t),this.yPixels=t=>this.scaleModel.yPixels(t),this.percentAnimationHandler=new d(this.scaleModel,this.dataSeries)}toAxisUnits(e,i=this.getBaseLine){switch(this.getAxisType()){case"percent":const s=this.percentAnimationHandler.getBaselineForPercent(i);return h(e,s);case"logarithmic":return o(e);case"regular":return e}}priceFromY(e){const i=this.scaleModel.fromY(e);return this.fromAxisUnits(i)}fromAxisUnits(e){switch(this.getAxisType()){case"percent":return c(e,this.getBaseLine());case"logarithmic":return l(e);case"regular":return e}}}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { BarTypes, YAxisLabelAppearanceType, YAxisLabelMode } from '../chart.config';
|
|
7
|
+
export type DataSeriesType = 'POINTS' | 'LINEAR' | 'HISTOGRAM' | 'TREND_HISTOGRAM' | 'DIFFERENCE' | 'TEXT' | 'ABOVE_CANDLE_TEXT' | 'BELOW_CANDLE_TEXT' | 'ABOVE_CANDLE_TRIANGLE' | 'TRIANGLE' | 'COLOR_CANDLE' | 'RECTANGULAR' | keyof BarTypes | string;
|
|
8
|
+
export interface DataSeriesConfig {
|
|
9
|
+
paintConfig: Array<DataSeriesPaintConfig>;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
highLowActive: boolean;
|
|
12
|
+
type: DataSeriesType;
|
|
13
|
+
/**
|
|
14
|
+
* 'viewport' data-series label will show last visible on the screen series value.
|
|
15
|
+
* 'series' data-series label will show last overall series value (even if not visible).
|
|
16
|
+
*/
|
|
17
|
+
labelLastValue: 'series' | 'viewport';
|
|
18
|
+
labelMode: YAxisLabelMode;
|
|
19
|
+
labelAppearanceType: YAxisLabelAppearanceType;
|
|
20
|
+
labelPaddingBottom?: number;
|
|
21
|
+
labelPaddingTop?: number;
|
|
22
|
+
labelPaddingEnd?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface DataSeriesPaintConfig {
|
|
25
|
+
color: string;
|
|
26
|
+
lineWidth: number;
|
|
27
|
+
hoveredLineWidth: number;
|
|
28
|
+
aditionalColor?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const DEFAULT_DATA_SERIES_PAINT_CONFIG: DataSeriesPaintConfig;
|
|
31
|
+
export declare const DEFAULT_DATA_SERIES_CONFIG: DataSeriesConfig;
|
|
@@ -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 DEFAULT_DATA_SERIES_PAINT_CONFIG={color:"#FF00FF",lineWidth:1,hoveredLineWidth:2},DEFAULT_DATA_SERIES_CONFIG={paintConfig:[DEFAULT_DATA_SERIES_PAINT_CONFIG],type:"LINEAR",highLowActive:!0,visible:!0,labelLastValue:"viewport",labelMode:"label",labelAppearanceType:"badge"};
|