@progress/kendo-charts 2.7.2-dev.202502101310 → 2.7.2-develop.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/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/barcode/barcode-validator.js +10 -12
- package/dist/es/barcode/barcode.js +84 -96
- package/dist/es/barcode/encodings/code11.js +41 -57
- package/dist/es/barcode/encodings/code128.js +222 -354
- package/dist/es/barcode/encodings/code39-extended.js +20 -34
- package/dist/es/barcode/encodings/code39.js +49 -75
- package/dist/es/barcode/encodings/code93-extended.js +12 -24
- package/dist/es/barcode/encodings/code93.js +52 -70
- package/dist/es/barcode/encodings/ean13.js +28 -42
- package/dist/es/barcode/encodings/ean8.js +8 -18
- package/dist/es/barcode/encodings/encoding.js +18 -24
- package/dist/es/barcode/encodings/main.js +13 -10
- package/dist/es/barcode/encodings/msi.js +56 -112
- package/dist/es/barcode/encodings/postnet.js +31 -45
- package/dist/es/barcode/surface-size.js +2 -2
- package/dist/es/chart/aggregates/aggregates.js +23 -23
- package/dist/es/chart/aggregates/default-aggregates.js +10 -18
- package/dist/es/chart/aggregates/series-aggregator.js +42 -54
- package/dist/es/chart/animations/bar-chart-animation.js +15 -26
- package/dist/es/chart/animations/bubble-animation.js +7 -17
- package/dist/es/chart/animations/clip-animation.js +13 -23
- package/dist/es/chart/animations/fade-in-animation.js +6 -16
- package/dist/es/chart/animations/pie-animation.js +6 -16
- package/dist/es/chart/api-elements/chart-axis.js +14 -22
- package/dist/es/chart/api-elements/chart-pane.js +10 -8
- package/dist/es/chart/api-elements/chart-plotarea.js +4 -10
- package/dist/es/chart/api-elements/find-axis-by-name.js +1 -1
- package/dist/es/chart/area-chart/area-chart.js +46 -60
- package/dist/es/chart/area-chart/area-segment.js +46 -52
- package/dist/es/chart/area-chart/spline-area-segment.js +12 -21
- package/dist/es/chart/area-chart/step-area-segment.js +6 -15
- package/dist/es/chart/axis-group-range-tracker.js +14 -20
- package/dist/es/chart/bar-chart/bar-chart.js +65 -80
- package/dist/es/chart/bar-chart/bar-label.js +25 -32
- package/dist/es/chart/bar-chart/bar.js +76 -91
- package/dist/es/chart/box-plot-chart/box-plot-chart.js +33 -48
- package/dist/es/chart/box-plot-chart/box-plot.js +55 -68
- package/dist/es/chart/box-plot-chart/vertical-box-plot.js +13 -23
- package/dist/es/chart/bubble-chart/bubble-chart.js +51 -64
- package/dist/es/chart/bubble-chart/bubble.js +21 -27
- package/dist/es/chart/bullet-chart/bullet-chart.js +45 -57
- package/dist/es/chart/bullet-chart/bullet.js +48 -57
- package/dist/es/chart/bullet-chart/target.js +1 -11
- package/dist/es/chart/candlestick-chart/candlestick-chart.js +41 -55
- package/dist/es/chart/candlestick-chart/candlestick.js +60 -69
- package/dist/es/chart/categorical-chart.js +178 -206
- package/dist/es/chart/chart-container.js +30 -39
- package/dist/es/chart/chart.js +641 -701
- package/dist/es/chart/constants.js +103 -103
- package/dist/es/chart/crosshair/crosshair-tooltip.js +22 -34
- package/dist/es/chart/crosshair/crosshair.js +39 -47
- package/dist/es/chart/donut-chart/donut-chart.js +36 -48
- package/dist/es/chart/donut-chart/donut-segment.js +12 -24
- package/dist/es/chart/error-bars/categorical-error-bar.js +5 -15
- package/dist/es/chart/error-bars/error-bar-base.js +37 -49
- package/dist/es/chart/error-bars/error-range-calculator.js +46 -56
- package/dist/es/chart/error-bars/scatter-error-bar.js +6 -16
- package/dist/es/chart/funnel-chart/funnel-chart.js +86 -103
- package/dist/es/chart/funnel-chart/funnel-segment.js +46 -54
- package/dist/es/chart/funnel-chart/pyramid-chart.js +5 -11
- package/dist/es/chart/heatmap-chart/color-scale.js +7 -9
- package/dist/es/chart/heatmap-chart/heatmap-chart.js +87 -110
- package/dist/es/chart/heatmap-chart/heatmap-point.js +72 -78
- package/dist/es/chart/highlight.js +26 -36
- package/dist/es/chart/layout/cluster-layout.js +16 -25
- package/dist/es/chart/layout/radar-cluster-layout.js +15 -24
- package/dist/es/chart/layout/radar-stack-layout.js +10 -22
- package/dist/es/chart/layout/stack-wrap.js +12 -24
- package/dist/es/chart/layout/utils.js +2 -2
- package/dist/es/chart/legend/legend-item-line-area.js +8 -19
- package/dist/es/chart/legend/legend-item-line.js +21 -31
- package/dist/es/chart/legend/legend-item-marker.js +18 -28
- package/dist/es/chart/legend/legend-item-square.js +8 -18
- package/dist/es/chart/legend/legend-item.js +91 -105
- package/dist/es/chart/legend/legend-layout.js +18 -25
- package/dist/es/chart/legend/legend.js +68 -92
- package/dist/es/chart/line-chart/line-chart.js +35 -48
- package/dist/es/chart/line-chart/line-point.js +90 -103
- package/dist/es/chart/line-chart/line-segment.js +23 -34
- package/dist/es/chart/line-chart/spline-segment.js +10 -20
- package/dist/es/chart/line-chart/step-line-mixin.js +14 -17
- package/dist/es/chart/line-chart/step-line-segment.js +4 -14
- package/dist/es/chart/mixins/accessibility-attributes-mixin.js +7 -7
- package/dist/es/chart/mixins/clip-animation-mixin.js +7 -7
- package/dist/es/chart/mixins/line-chart-mixin.js +27 -31
- package/dist/es/chart/mixins/note-mixin.js +3 -3
- package/dist/es/chart/mixins/pie-chart-mixin.js +9 -9
- package/dist/es/chart/mixins/plotarea-events-mixin.js +1 -1
- package/dist/es/chart/mixins/point-events-mixin.js +1 -1
- package/dist/es/chart/ohlc-chart/ohlc-chart.js +4 -14
- package/dist/es/chart/ohlc-chart/ohlc-point.js +15 -28
- package/dist/es/chart/pan-and-zoom/accept-key.js +3 -3
- package/dist/es/chart/pan-and-zoom/mousewheel-zoom.js +25 -33
- package/dist/es/chart/pan-and-zoom/pannable.js +29 -37
- package/dist/es/chart/pan-and-zoom/to-chart-axis-ranges.js +3 -3
- package/dist/es/chart/pan-and-zoom/zoom-selection.js +61 -70
- package/dist/es/chart/pane.js +71 -79
- package/dist/es/chart/pie-chart/pie-chart.js +153 -183
- package/dist/es/chart/pie-chart/pie-segment.js +82 -98
- package/dist/es/chart/plotarea/categorical-plotarea.js +285 -318
- package/dist/es/chart/plotarea/donut-plotarea.js +12 -22
- package/dist/es/chart/plotarea/funnel-plotarea.js +17 -27
- package/dist/es/chart/plotarea/heatmap-plotarea.js +139 -167
- package/dist/es/chart/plotarea/pie-plotarea.js +15 -25
- package/dist/es/chart/plotarea/plotarea-base.js +423 -462
- package/dist/es/chart/plotarea/plotarea-factory.js +15 -20
- package/dist/es/chart/plotarea/polar-plotarea-base.js +37 -51
- package/dist/es/chart/plotarea/polar-plotarea.js +39 -49
- package/dist/es/chart/plotarea/radar-plotarea.js +55 -65
- package/dist/es/chart/plotarea/xy-plotarea.js +111 -128
- package/dist/es/chart/polar-area-chart/polar-area-chart.js +22 -36
- package/dist/es/chart/polar-area-chart/polar-area-segment.js +7 -17
- package/dist/es/chart/polar-area-chart/spline-polar-area-segment.js +15 -25
- package/dist/es/chart/polar-line-chart/polar-line-chart.js +2 -11
- package/dist/es/chart/polar-scatter-chart/polar-scatter-chart.js +6 -16
- package/dist/es/chart/radar-area-chart/radar-area-chart.js +11 -21
- package/dist/es/chart/radar-area-chart/radar-area-segment.js +3 -13
- package/dist/es/chart/radar-area-chart/spline-radar-area-segment.js +3 -13
- package/dist/es/chart/radar-bar-chart/radar-bar-chart.js +19 -29
- package/dist/es/chart/radar-bar-chart/radar-segment.js +6 -12
- package/dist/es/chart/radar-line-chart/radar-line-chart.js +26 -35
- package/dist/es/chart/range-area-chart/range-area-chart.js +46 -58
- package/dist/es/chart/range-area-chart/range-area-point.js +55 -66
- package/dist/es/chart/range-area-chart/range-area-segment.js +19 -28
- package/dist/es/chart/range-area-chart/range-line-point.js +4 -14
- package/dist/es/chart/range-area-chart/spline-range-area-segment.js +11 -18
- package/dist/es/chart/range-area-chart/step-range-area-segment.js +7 -16
- package/dist/es/chart/range-bar-chart/range-bar-chart.js +18 -29
- package/dist/es/chart/range-bar-chart/range-bar.js +10 -23
- package/dist/es/chart/register-charts.js +20 -16
- package/dist/es/chart/scatter-charts/scatter-chart.js +100 -122
- package/dist/es/chart/scatter-charts/scatter-line-chart.js +15 -25
- package/dist/es/chart/selection.js +176 -201
- package/dist/es/chart/series-binder.js +55 -66
- package/dist/es/chart/theme/base-theme.js +75 -79
- package/dist/es/chart/theme/load-theme.js +52 -52
- package/dist/es/chart/tooltip/base-tooltip.js +17 -24
- package/dist/es/chart/tooltip/shared-tooltip.js +25 -31
- package/dist/es/chart/tooltip/tooltip.js +10 -20
- package/dist/es/chart/trendlines/calculate-moving-average.js +11 -13
- package/dist/es/chart/trendlines/calculate-polynomial.js +24 -26
- package/dist/es/chart/trendlines/calculate-slope.js +12 -14
- package/dist/es/chart/trendlines/check-all-positive.js +2 -5
- package/dist/es/chart/trendlines/exponential-trendline.js +15 -24
- package/dist/es/chart/trendlines/get-scatter-trendline-data.js +6 -7
- package/dist/es/chart/trendlines/get-trendline-data.js +6 -6
- package/dist/es/chart/trendlines/linear-trendline.js +12 -21
- package/dist/es/chart/trendlines/logarithmic-trendline.js +14 -23
- package/dist/es/chart/trendlines/moving-average.js +15 -26
- package/dist/es/chart/trendlines/polynomial-trendline.js +13 -21
- package/dist/es/chart/trendlines/power-trendline.js +15 -24
- package/dist/es/chart/trendlines/scatter-exponential-trendline.js +15 -24
- package/dist/es/chart/trendlines/scatter-linear-trendline.js +10 -16
- package/dist/es/chart/trendlines/scatter-logarithmic-trendline.js +17 -27
- package/dist/es/chart/trendlines/scatter-moving-average.js +7 -10
- package/dist/es/chart/trendlines/scatter-polynomial-trendline.js +11 -16
- package/dist/es/chart/trendlines/scatter-power-trendline.js +15 -22
- package/dist/es/chart/trendlines/scatter-trendline-registry.js +1 -1
- package/dist/es/chart/trendlines/scatter-value-getter.js +2 -5
- package/dist/es/chart/trendlines/trendline-factory.js +1 -1
- package/dist/es/chart/trendlines/trendline-registry.js +1 -1
- package/dist/es/chart/trendlines/x-value-limits.js +6 -8
- package/dist/es/chart/utils/any-has-z-index.js +1 -1
- package/dist/es/chart/utils/bind-segments.js +8 -8
- package/dist/es/chart/utils/categories-count.js +3 -3
- package/dist/es/chart/utils/count-numbers.js +4 -4
- package/dist/es/chart/utils/create-out-of-range-points.js +13 -22
- package/dist/es/chart/utils/eval-options.js +7 -10
- package/dist/es/chart/utils/filter-series-by-type.js +4 -4
- package/dist/es/chart/utils/get-field.js +1 -1
- package/dist/es/chart/utils/has-gradient-overlay.js +1 -1
- package/dist/es/chart/utils/is-date-axis.js +2 -2
- package/dist/es/chart/utils/parse-date-category.js +2 -2
- package/dist/es/chart/utils/segment-visible.js +2 -2
- package/dist/es/chart/waterfall-chart/waterfall-chart.js +41 -55
- package/dist/es/chart/waterfall-chart/waterfall-segment.js +16 -24
- package/dist/es/chart-wizard/get-wizard-data-from-data-rows.js +5 -6
- package/dist/es/chart-wizard/messages.js +1 -1
- package/dist/es/chart-wizard/state.js +145 -137
- package/dist/es/chart-wizard.js +12 -12
- package/dist/es/common/add-class.js +3 -3
- package/dist/es/common/align-path-to-pixel.js +2 -2
- package/dist/es/common/auto-text-color.js +1 -1
- package/dist/es/common/constants.js +53 -53
- package/dist/es/common/create-hash-set.js +59 -65
- package/dist/es/common/cycleDown.js +1 -1
- package/dist/es/common/deep-extend.js +10 -12
- package/dist/es/common/element-scale.js +9 -9
- package/dist/es/common/element-styles.js +8 -8
- package/dist/es/common/event-map.js +4 -4
- package/dist/es/common/event-utils.js +13 -13
- package/dist/es/common/find.js +2 -2
- package/dist/es/common/font-loader.js +42 -44
- package/dist/es/common/get-aria-template.js +2 -4
- package/dist/es/common/get-spacing.js +2 -4
- package/dist/es/common/get-supported-features.js +7 -7
- package/dist/es/common/get-template.js +2 -4
- package/dist/es/common/getter.js +5 -5
- package/dist/es/common/grep.js +3 -3
- package/dist/es/common/has-classes.js +2 -2
- package/dist/es/common/hash-map.js +11 -11
- package/dist/es/common/instance-observer.js +28 -33
- package/dist/es/common/keys.js +1 -1
- package/dist/es/common/map.js +4 -4
- package/dist/es/common/matrix.js +142 -150
- package/dist/es/common/mousewheel-delta.js +2 -2
- package/dist/es/common/observable.js +40 -52
- package/dist/es/common/remove-class.js +1 -1
- package/dist/es/common/render-icon.js +50 -60
- package/dist/es/common/set-default-options.js +1 -1
- package/dist/es/common/sparse-array-limits.js +4 -4
- package/dist/es/common/user-events.js +124 -150
- package/dist/es/core/axis-label.js +38 -43
- package/dist/es/core/axis.js +293 -345
- package/dist/es/core/box-element.js +36 -46
- package/dist/es/core/box.js +75 -83
- package/dist/es/core/category-axis.js +265 -314
- package/dist/es/core/chart-element.js +98 -109
- package/dist/es/core/constants.js +3 -3
- package/dist/es/core/curve-processor.js +86 -93
- package/dist/es/core/date-category-axis.js +381 -413
- package/dist/es/core/date-value-axis.js +108 -118
- package/dist/es/core/float-element.js +54 -78
- package/dist/es/core/gradients.js +3 -3
- package/dist/es/core/logarithmic-axis.js +134 -186
- package/dist/es/core/mixins/grid-lines-mixin.js +18 -20
- package/dist/es/core/mixins/radar-numeric-axis-mixin.js +46 -51
- package/dist/es/core/note.js +58 -73
- package/dist/es/core/numeric-axis.js +111 -133
- package/dist/es/core/pattern.js +4 -8
- package/dist/es/core/point.js +25 -34
- package/dist/es/core/polar-axis.js +73 -91
- package/dist/es/core/radar-category-axis.js +90 -114
- package/dist/es/core/radar-logarithmic-axis.js +10 -20
- package/dist/es/core/radar-numeric-axis.js +10 -20
- package/dist/es/core/ring.js +61 -68
- package/dist/es/core/root-element.js +40 -48
- package/dist/es/core/sector.js +11 -17
- package/dist/es/core/shape-builder.js +13 -23
- package/dist/es/core/shape-element.js +27 -37
- package/dist/es/core/text-box.js +50 -59
- package/dist/es/core/text.js +13 -24
- package/dist/es/core/title.js +19 -25
- package/dist/es/core/utils/auto-axis-max.js +3 -3
- package/dist/es/core/utils/auto-axis-min.js +3 -3
- package/dist/es/core/utils/auto-major-unit.js +4 -4
- package/dist/es/core/utils/box-diff.js +9 -9
- package/dist/es/core/utils/create-axis-grid-line.js +2 -4
- package/dist/es/core/utils/create-axis-tick.js +2 -4
- package/dist/es/core/utils/guid.js +3 -3
- package/dist/es/core/utils/rect-to-box.js +2 -2
- package/dist/es/date-utils/absolute-date-diff.js +2 -2
- package/dist/es/date-utils/add-duration.js +5 -5
- package/dist/es/date-utils/ceil-date.js +1 -1
- package/dist/es/date-utils/constants.js +17 -17
- package/dist/es/date-utils/date-index.js +3 -3
- package/dist/es/date-utils/duration.js +1 -1
- package/dist/es/date-utils/lte-date-index.js +4 -4
- package/dist/es/date-utils/parse-date.js +1 -1
- package/dist/es/date-utils/parse-dates.js +2 -2
- package/dist/es/date-utils/start-of-week.js +3 -5
- package/dist/es/date-utils/to-date.js +1 -1
- package/dist/es/date-utils/to-time.js +2 -2
- package/dist/es/drawing-utils.js +18 -17
- package/dist/es/gauges/arc/arc-gauge.js +29 -38
- package/dist/es/gauges/arc/arc-scale.js +16 -29
- package/dist/es/gauges/arc/range-pointer-animation.js +16 -25
- package/dist/es/gauges/arc/range-pointer.js +25 -46
- package/dist/es/gauges/circular/circular-gauge.js +7 -17
- package/dist/es/gauges/constants.js +14 -14
- package/dist/es/gauges/gauge.js +84 -96
- package/dist/es/gauges/linear/arrow-linear-pointer-animation.js +13 -25
- package/dist/es/gauges/linear/arrow-linear-pointer.js +23 -35
- package/dist/es/gauges/linear/bar-linear-pointer-animation.js +15 -24
- package/dist/es/gauges/linear/bar-linear-pointer.js +38 -51
- package/dist/es/gauges/linear/linear-gauge.js +61 -83
- package/dist/es/gauges/linear/linear-pointer.js +25 -39
- package/dist/es/gauges/linear/linear-scale.js +57 -74
- package/dist/es/gauges/pointer.js +11 -21
- package/dist/es/gauges/radial/radial-gauge.js +58 -81
- package/dist/es/gauges/radial/radial-pointer-animation.js +9 -15
- package/dist/es/gauges/radial/radial-pointer.js +33 -48
- package/dist/es/gauges/radial/radial-scale.js +154 -186
- package/dist/es/gauges/utils/build-label-element.js +10 -12
- package/dist/es/gauges/utils/get-range.js +2 -2
- package/dist/es/gauges/utils/pad.js +3 -3
- package/dist/es/gauges/utils/unpad.js +1 -1
- package/dist/es/map/attribution.js +42 -52
- package/dist/es/map/constants.js +5 -5
- package/dist/es/map/crs.js +68 -112
- package/dist/es/map/datums.js +3 -3
- package/dist/es/map/extent.js +40 -54
- package/dist/es/map/layers/bubble.js +52 -70
- package/dist/es/map/layers/layer.js +50 -56
- package/dist/es/map/layers/marker.js +109 -129
- package/dist/es/map/layers/shape.js +111 -133
- package/dist/es/map/layers/tile.js +144 -170
- package/dist/es/map/location.js +70 -78
- package/dist/es/map/map.js +261 -291
- package/dist/es/map/navigator.js +33 -39
- package/dist/es/map/scroller/draggable.js +98 -134
- package/dist/es/map/scroller/fx.js +39 -46
- package/dist/es/map/scroller/scroller.js +144 -174
- package/dist/es/map/tooltip/tooltip.js +15 -25
- package/dist/es/map/utils.js +25 -26
- package/dist/es/map/zoom.js +30 -36
- package/dist/es/qrcode/encodings/data-modes/alpha-numeric-data-mode.js +14 -26
- package/dist/es/qrcode/encodings/data-modes/byte-data-mode.js +15 -25
- package/dist/es/qrcode/encodings/data-modes/data-mode-instances.js +8 -7
- package/dist/es/qrcode/encodings/data-modes/numeric-data-mode.js +14 -24
- package/dist/es/qrcode/encodings/data-modes/qr-data-mode.js +15 -21
- package/dist/es/qrcode/encodings/encoders/iso-encoder.js +6 -16
- package/dist/es/qrcode/encodings/encoders/utf8-encoder.js +28 -36
- package/dist/es/qrcode/encodings/encoding-result.js +4 -10
- package/dist/es/qrcode/encodings/encoding.js +68 -192
- package/dist/es/qrcode/encodings/free-cell-visitor.js +16 -24
- package/dist/es/qrcode/encodings/utils/choose-mode.js +44 -0
- package/dist/es/qrcode/encodings/utils/get-data-codewords-count.js +13 -0
- package/dist/es/qrcode/encodings/utils/get-data-string.js +13 -0
- package/dist/es/qrcode/encodings/utils/get-modes.js +35 -0
- package/dist/es/qrcode/encodings/utils/get-version.js +23 -0
- package/dist/es/qrcode/encodings/utils/index.js +5 -0
- package/dist/es/qrcode/encodings/version-codewords.js +1 -1
- package/dist/es/qrcode/qrcode-validator.js +3 -5
- package/dist/es/qrcode/qrcode.js +104 -114
- package/dist/es/qrcode/utils.js +4 -4
- package/dist/es/sankey/calculation.js +286 -307
- package/dist/es/sankey/element.js +15 -23
- package/dist/es/sankey/label.js +29 -44
- package/dist/es/sankey/legend.js +15 -29
- package/dist/es/sankey/link.js +80 -98
- package/dist/es/sankey/node.js +26 -37
- package/dist/es/sankey/sankey.js +318 -385
- package/dist/es/sankey/title.js +9 -20
- package/dist/es/sankey/utils.js +18 -23
- package/dist/es/services/chart-service.js +24 -28
- package/dist/es/services/dom-events-builder.js +15 -15
- package/dist/es/services/format-service.js +30 -35
- package/dist/es/services/intl-service.js +14 -18
- package/dist/es/services/map-service.js +11 -11
- package/dist/es/services/template-service.js +9 -9
- package/dist/es/sparkline/shared-tooltip.js +11 -21
- package/dist/es/sparkline/sparkline.js +50 -60
- package/dist/es/stock/constants.js +3 -3
- package/dist/es/stock/fade-out-animation.js +12 -21
- package/dist/es/stock/navigator-hint.js +37 -49
- package/dist/es/stock/navigator.js +130 -161
- package/dist/es/stock/stock-chart.js +58 -67
- package/dist/es2015/chart/legend/legend-item.js +1 -1
- package/dist/es2015/qrcode/encodings/encoders/iso-encoder.js +1 -1
- package/dist/es2015/qrcode/encodings/encoders/utf8-encoder.js +1 -1
- package/dist/es2015/qrcode/encodings/encoding.js +3 -127
- package/dist/es2015/qrcode/encodings/utils/choose-mode.js +44 -0
- package/dist/es2015/qrcode/encodings/utils/get-data-codewords-count.js +13 -0
- package/dist/es2015/qrcode/encodings/utils/get-data-string.js +13 -0
- package/dist/es2015/qrcode/encodings/utils/get-modes.js +35 -0
- package/dist/es2015/qrcode/encodings/utils/get-version.js +23 -0
- package/dist/es2015/qrcode/encodings/utils/index.js +5 -0
- package/dist/npm/main.js +3222 -3589
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +19 -57
|
@@ -5,22 +5,15 @@ import { DEFAULT_WIDTH } from '../common/constants';
|
|
|
5
5
|
import { addClass, deepExtend, elementSize, grep, setDefaultOptions } from '../common';
|
|
6
6
|
import { NAVIGATOR_AXIS, NAVIGATOR_PANE } from './constants';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const AUTO_CATEGORY_WIDTH = 28;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
function StockChart () {
|
|
12
|
-
Chart.apply(this, arguments);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if ( Chart ) StockChart.__proto__ = Chart;
|
|
16
|
-
StockChart.prototype = Object.create( Chart && Chart.prototype );
|
|
17
|
-
StockChart.prototype.constructor = StockChart;
|
|
10
|
+
class StockChart extends Chart {
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
applyDefaults(options, themeOptions) {
|
|
13
|
+
const width = elementSize(this.element).width || DEFAULT_WIDTH;
|
|
14
|
+
let theme = themeOptions;
|
|
22
15
|
|
|
23
|
-
|
|
16
|
+
const stockDefaults = {
|
|
24
17
|
seriesDefaults: {
|
|
25
18
|
categoryField: options.dateField
|
|
26
19
|
},
|
|
@@ -47,52 +40,52 @@ var StockChart = (function (Chart) {
|
|
|
47
40
|
|
|
48
41
|
Navigator.setup(options, theme);
|
|
49
42
|
|
|
50
|
-
|
|
51
|
-
}
|
|
43
|
+
super.applyDefaults(options, theme);
|
|
44
|
+
}
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
_setElementClass(element) {
|
|
54
47
|
addClass(element, 'k-chart k-stockchart');
|
|
55
|
-
}
|
|
48
|
+
}
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
setOptions(options) {
|
|
58
51
|
this.destroyNavigator();
|
|
59
|
-
|
|
60
|
-
}
|
|
52
|
+
super.setOptions(options);
|
|
53
|
+
}
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
noTransitionsRedraw() {
|
|
56
|
+
const transitions = this.options.transitions;
|
|
64
57
|
|
|
65
58
|
this.options.transitions = false;
|
|
66
59
|
this._fullRedraw();
|
|
67
60
|
this.options.transitions = transitions;
|
|
68
|
-
}
|
|
61
|
+
}
|
|
69
62
|
|
|
70
|
-
|
|
63
|
+
_resize() {
|
|
71
64
|
this.noTransitionsRedraw();
|
|
72
|
-
}
|
|
65
|
+
}
|
|
73
66
|
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
_redraw() {
|
|
68
|
+
const navigator = this.navigator;
|
|
76
69
|
|
|
77
70
|
if (!this._dirty() && navigator && navigator.options.partialRedraw) {
|
|
78
71
|
navigator.redrawSlaves();
|
|
79
72
|
} else {
|
|
80
73
|
this._fullRedraw();
|
|
81
74
|
}
|
|
82
|
-
}
|
|
75
|
+
}
|
|
83
76
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
_dirty() {
|
|
78
|
+
const options = this.options;
|
|
79
|
+
const series = [].concat(options.series, options.navigator.series);
|
|
80
|
+
const seriesCount = grep(series, function(s) { return s && s.visible; }).length;
|
|
81
|
+
const dirty = this._seriesCount !== seriesCount;
|
|
89
82
|
this._seriesCount = seriesCount;
|
|
90
83
|
|
|
91
84
|
return dirty;
|
|
92
|
-
}
|
|
85
|
+
}
|
|
93
86
|
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
_fullRedraw() {
|
|
88
|
+
let navigator = this.navigator;
|
|
96
89
|
|
|
97
90
|
if (!navigator) {
|
|
98
91
|
navigator = this.navigator = new Navigator(this);
|
|
@@ -102,70 +95,68 @@ var StockChart = (function (Chart) {
|
|
|
102
95
|
navigator.clean();
|
|
103
96
|
navigator.setRange();
|
|
104
97
|
|
|
105
|
-
|
|
98
|
+
super._redraw();
|
|
106
99
|
|
|
107
100
|
navigator.initSelection();
|
|
108
|
-
}
|
|
101
|
+
}
|
|
109
102
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
_trackSharedTooltip(coords) {
|
|
104
|
+
const plotArea = this._plotArea;
|
|
105
|
+
const pane = plotArea.paneByPoint(coords);
|
|
113
106
|
|
|
114
107
|
if (pane && pane.options.name === NAVIGATOR_PANE) {
|
|
115
108
|
this._unsetActivePoint();
|
|
116
109
|
} else {
|
|
117
|
-
|
|
110
|
+
super._trackSharedTooltip(coords);
|
|
118
111
|
}
|
|
119
|
-
}
|
|
112
|
+
}
|
|
120
113
|
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
bindCategories() {
|
|
115
|
+
super.bindCategories();
|
|
123
116
|
this.copyNavigatorCategories();
|
|
124
|
-
}
|
|
117
|
+
}
|
|
125
118
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
copyNavigatorCategories() {
|
|
120
|
+
const definitions = [].concat(this.options.categoryAxis);
|
|
121
|
+
let categories;
|
|
129
122
|
|
|
130
|
-
for (
|
|
131
|
-
|
|
123
|
+
for (let axisIx = 0; axisIx < definitions.length; axisIx++) {
|
|
124
|
+
const axis = definitions[axisIx];
|
|
132
125
|
if (axis.name === NAVIGATOR_AXIS) {
|
|
133
126
|
categories = axis.categories;
|
|
134
127
|
} else if (categories && axis.pane === NAVIGATOR_PANE) {
|
|
135
128
|
axis.categories = categories;
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
|
-
}
|
|
131
|
+
}
|
|
139
132
|
|
|
140
|
-
|
|
133
|
+
destroyNavigator() {
|
|
141
134
|
if (this.navigator) {
|
|
142
135
|
this.navigator.destroy();
|
|
143
136
|
this.navigator = null;
|
|
144
137
|
}
|
|
145
|
-
}
|
|
138
|
+
}
|
|
146
139
|
|
|
147
|
-
|
|
140
|
+
destroy() {
|
|
148
141
|
this.destroyNavigator();
|
|
149
|
-
|
|
150
|
-
}
|
|
142
|
+
super.destroy();
|
|
143
|
+
}
|
|
151
144
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
_stopChartHandlers(e) {
|
|
146
|
+
const coords = this._eventCoordinates(e);
|
|
147
|
+
const pane = this._plotArea.paneByPoint(coords);
|
|
155
148
|
|
|
156
|
-
return
|
|
157
|
-
}
|
|
149
|
+
return super._stopChartHandlers(e) || (pane && pane.options.name === NAVIGATOR_PANE);
|
|
150
|
+
}
|
|
158
151
|
|
|
159
|
-
|
|
152
|
+
_toggleDragZoomEvents() {
|
|
160
153
|
if (!this._dragZoomEnabled) {
|
|
161
154
|
this.element.style.touchAction = "none";
|
|
162
155
|
|
|
163
156
|
this._dragZoomEnabled = true;
|
|
164
157
|
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return StockChart;
|
|
168
|
-
}(Chart));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
169
160
|
|
|
170
161
|
setDefaultOptions(StockChart, {
|
|
171
162
|
dateField: "date",
|
|
@@ -122,7 +122,7 @@ class LegendItem extends BoxElement {
|
|
|
122
122
|
if (typeof pattern === 'function') {
|
|
123
123
|
pattern = pattern(options.series);
|
|
124
124
|
}
|
|
125
|
-
pattern =
|
|
125
|
+
pattern = Object.assign({}, pattern);
|
|
126
126
|
this._reduceSize(pattern, 'gap');
|
|
127
127
|
this._reduceSize(pattern, 'width');
|
|
128
128
|
this._reduceSize(pattern, 'radius');
|
|
@@ -3,7 +3,7 @@ import { EncodingResult } from '../encoding-result';
|
|
|
3
3
|
import { DataModeInstances } from '../data-modes/data-mode-instances';
|
|
4
4
|
import { extend } from '../../utils';
|
|
5
5
|
import { toBitsString } from '../../utils';
|
|
6
|
-
import { getVersion } from '../
|
|
6
|
+
import { getVersion } from '../utils/index';
|
|
7
7
|
|
|
8
8
|
const BYTE = "byte";
|
|
9
9
|
|
|
@@ -6,12 +6,8 @@ import { FreeCellVisitor } from './free-cell-visitor';
|
|
|
6
6
|
import { IsoEncoder } from './encoders/iso-encoder';
|
|
7
7
|
import { Utf8Encoder } from './encoders/utf8-encoder';
|
|
8
8
|
import { VersionsCodewordsInformation } from './version-codewords';
|
|
9
|
-
import { DataModeInstances } from './data-modes/data-mode-instances';
|
|
10
9
|
|
|
11
10
|
let terminator = "0000",
|
|
12
|
-
NUMERIC = "numeric",
|
|
13
|
-
ALPHA_NUMERIC = "alphanumeric",
|
|
14
|
-
BYTE = "byte",
|
|
15
11
|
powersOfTwo = { "1": 0 },
|
|
16
12
|
powersOfTwoResult = { "0": 1 },
|
|
17
13
|
irregularAlignmentPatternsStartDistance = {
|
|
@@ -38,21 +34,9 @@ let terminator = "0000",
|
|
|
38
34
|
(row, column) => { return ((row * column) % 2) + ((row * column) % 3) === 0; },
|
|
39
35
|
(row, column) => { return (((row * column) % 2) + ((row * column) % 3)) % 2 === 0; },
|
|
40
36
|
(row, column) => { return (((row + column) % 2) + ((row * column) % 3)) % 2 === 0; }
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
numberRegex = /^\d+/,
|
|
45
|
-
alphaPattern = "A-Z0-9 $%*+./:-",
|
|
46
|
-
alphaExclusiveSet = "A-Z $%*+./:-",
|
|
47
|
-
alphaRegex = new RegExp("^[" + alphaExclusiveSet + "]+"),
|
|
48
|
-
alphaNumericRegex = new RegExp("^[" + alphaPattern + "]+"),
|
|
49
|
-
byteRegex = new RegExp("^[^" + alphaPattern + "]+"),
|
|
50
|
-
initMinNumericBeforeAlpha = 8,
|
|
51
|
-
initMinNumericBeforeByte = 5,
|
|
52
|
-
initMinAlphaBeforeByte = 8,
|
|
53
|
-
minNumericBeforeAlpha = 17,
|
|
54
|
-
minNumericBeforeByte = 9,
|
|
55
|
-
minAlphaBeforeByte = 16;
|
|
37
|
+
];
|
|
38
|
+
/* eslint-enable no-unused-vars */
|
|
39
|
+
/* eslint-enable arrow-body-style */
|
|
56
40
|
|
|
57
41
|
export const generatorPolynomials = [[1, 0], [1, 25, 0]];
|
|
58
42
|
|
|
@@ -252,114 +236,6 @@ export function getBlocks(dataStream, versionCodewordsInformation) {
|
|
|
252
236
|
return [dataBlocks, errorBlocks];
|
|
253
237
|
}
|
|
254
238
|
|
|
255
|
-
export function chooseMode(str, minNumericBeforeAlpha, minNumericBeforeByte, minAlphaBeforeByte, previousMode) {
|
|
256
|
-
let numeric = numberRegex.exec(str),
|
|
257
|
-
numericMatch = numeric ? numeric[0] : "",
|
|
258
|
-
alpha = alphaRegex.exec(str),
|
|
259
|
-
alphaMatch = alpha ? alpha[0] : "",
|
|
260
|
-
alphaNumeric = alphaNumericRegex.exec(str),
|
|
261
|
-
alphaNumericMatch = alphaNumeric ? alphaNumeric[0] : "",
|
|
262
|
-
mode,
|
|
263
|
-
modeString;
|
|
264
|
-
|
|
265
|
-
if (numericMatch &&
|
|
266
|
-
(numericMatch.length >= minNumericBeforeAlpha || str.length === numericMatch.length ||
|
|
267
|
-
(numericMatch.length >= minNumericBeforeByte && !alphaNumericRegex.test(str.charAt(numericMatch.length))))) {
|
|
268
|
-
mode = NUMERIC;
|
|
269
|
-
modeString = numericMatch;
|
|
270
|
-
} else if (alphaNumericMatch && (str.length === alphaNumericMatch.length ||
|
|
271
|
-
alphaNumericMatch.length >= minAlphaBeforeByte || previousMode === ALPHA_NUMERIC)) {
|
|
272
|
-
mode = ALPHA_NUMERIC;
|
|
273
|
-
modeString = numericMatch || alphaMatch;
|
|
274
|
-
} else {
|
|
275
|
-
mode = BYTE;
|
|
276
|
-
|
|
277
|
-
if (alphaNumericMatch) {
|
|
278
|
-
modeString = alphaNumericMatch + byteRegex.exec(str.substring(alphaNumericMatch.length))[0];
|
|
279
|
-
} else {
|
|
280
|
-
modeString = byteRegex.exec(str)[0];
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
return {
|
|
285
|
-
mode: mode,
|
|
286
|
-
modeString: modeString
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export function getModes(inputString) {
|
|
291
|
-
let modes = [],
|
|
292
|
-
previousMode,
|
|
293
|
-
idx = 0;
|
|
294
|
-
let str = inputString;
|
|
295
|
-
|
|
296
|
-
modes.push(chooseMode(str, initMinNumericBeforeAlpha, initMinNumericBeforeByte, initMinAlphaBeforeByte, previousMode));
|
|
297
|
-
previousMode = modes[0].mode;
|
|
298
|
-
str = str.substr(modes[0].modeString.length);
|
|
299
|
-
|
|
300
|
-
while (str.length > 0) {
|
|
301
|
-
let nextMode = chooseMode(str, minNumericBeforeAlpha, minNumericBeforeByte, minAlphaBeforeByte, previousMode);
|
|
302
|
-
|
|
303
|
-
if (nextMode.mode !== previousMode) {
|
|
304
|
-
previousMode = nextMode.mode;
|
|
305
|
-
modes.push(nextMode);
|
|
306
|
-
idx++;
|
|
307
|
-
} else {
|
|
308
|
-
modes[idx].modeString += nextMode.modeString;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
str = str.substr(nextMode.modeString.length);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return modes;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
export function getDataCodewordsCount(modes) {
|
|
318
|
-
let length = 0,
|
|
319
|
-
mode;
|
|
320
|
-
|
|
321
|
-
for (let i = 0; i < modes.length; i++) {
|
|
322
|
-
mode = DataModeInstances[modes[i].mode];
|
|
323
|
-
length += mode.getStringBitsLength(modes[i].modeString.length);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return Math.ceil(length / 8);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
export function getVersion(dataCodewordsCount, errorCorrectionLevel) {
|
|
330
|
-
let x = 0,
|
|
331
|
-
y = VersionsCodewordsInformation.length - 1,
|
|
332
|
-
version = Math.floor(VersionsCodewordsInformation.length / 2);
|
|
333
|
-
|
|
334
|
-
do {
|
|
335
|
-
if (dataCodewordsCount < VersionsCodewordsInformation[version][errorCorrectionLevel].totalDataCodewords) {
|
|
336
|
-
y = version;
|
|
337
|
-
} else {
|
|
338
|
-
x = version;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
version = x + Math.floor((y - x) / 2);
|
|
342
|
-
} while (y - x > 1);
|
|
343
|
-
|
|
344
|
-
if (dataCodewordsCount <= VersionsCodewordsInformation[x][errorCorrectionLevel].totalDataCodewords) {
|
|
345
|
-
return version + 1;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
return y + 1;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
export function getDataString(modes, version) {
|
|
352
|
-
let dataString = "",
|
|
353
|
-
mode;
|
|
354
|
-
|
|
355
|
-
for (let i = 0; i < modes.length; i++) {
|
|
356
|
-
mode = DataModeInstances[modes[i].mode];
|
|
357
|
-
dataString += mode.encode(modes[i].modeString, version);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
return dataString;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
239
|
//fix case all zeros
|
|
364
240
|
export function encodeFormatInformation(format) {
|
|
365
241
|
let formatNumber = toDecimal(format),
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const NUMERIC = "numeric";
|
|
2
|
+
const ALPHA_NUMERIC = "alphanumeric";
|
|
3
|
+
const BYTE = "byte";
|
|
4
|
+
const numberRegex = /^\d+/;
|
|
5
|
+
const alphaPattern = "A-Z0-9 $%*+./:-";
|
|
6
|
+
const alphaExclusiveSet = "A-Z $%*+./:-";
|
|
7
|
+
const alphaRegex = new RegExp("^[" + alphaExclusiveSet + "]+");
|
|
8
|
+
const alphaNumericRegex = new RegExp("^[" + alphaPattern + "]+");
|
|
9
|
+
const byteRegex = new RegExp("^[^" + alphaPattern + "]+");
|
|
10
|
+
|
|
11
|
+
export function chooseMode(str, minNumericBeforeAlpha, minNumericBeforeByte, minAlphaBeforeByte, previousMode) {
|
|
12
|
+
let numeric = numberRegex.exec(str),
|
|
13
|
+
numericMatch = numeric ? numeric[0] : "",
|
|
14
|
+
alpha = alphaRegex.exec(str),
|
|
15
|
+
alphaMatch = alpha ? alpha[0] : "",
|
|
16
|
+
alphaNumeric = alphaNumericRegex.exec(str),
|
|
17
|
+
alphaNumericMatch = alphaNumeric ? alphaNumeric[0] : "",
|
|
18
|
+
mode,
|
|
19
|
+
modeString;
|
|
20
|
+
|
|
21
|
+
if (numericMatch &&
|
|
22
|
+
(numericMatch.length >= minNumericBeforeAlpha || str.length === numericMatch.length ||
|
|
23
|
+
(numericMatch.length >= minNumericBeforeByte && !alphaNumericRegex.test(str.charAt(numericMatch.length))))) {
|
|
24
|
+
mode = NUMERIC;
|
|
25
|
+
modeString = numericMatch;
|
|
26
|
+
} else if (alphaNumericMatch && (str.length === alphaNumericMatch.length ||
|
|
27
|
+
alphaNumericMatch.length >= minAlphaBeforeByte || previousMode === ALPHA_NUMERIC)) {
|
|
28
|
+
mode = ALPHA_NUMERIC;
|
|
29
|
+
modeString = numericMatch || alphaMatch;
|
|
30
|
+
} else {
|
|
31
|
+
mode = BYTE;
|
|
32
|
+
|
|
33
|
+
if (alphaNumericMatch) {
|
|
34
|
+
modeString = alphaNumericMatch + byteRegex.exec(str.substring(alphaNumericMatch.length))[0];
|
|
35
|
+
} else {
|
|
36
|
+
modeString = byteRegex.exec(str)[0];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
mode: mode,
|
|
42
|
+
modeString: modeString
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataModeInstances } from '../data-modes/data-mode-instances';
|
|
2
|
+
|
|
3
|
+
export function getDataCodewordsCount(modes) {
|
|
4
|
+
let length = 0,
|
|
5
|
+
mode;
|
|
6
|
+
|
|
7
|
+
for (let i = 0; i < modes.length; i++) {
|
|
8
|
+
mode = DataModeInstances[modes[i].mode];
|
|
9
|
+
length += mode.getStringBitsLength(modes[i].modeString.length);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return Math.ceil(length / 8);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataModeInstances } from '../data-modes/data-mode-instances';
|
|
2
|
+
|
|
3
|
+
export function getDataString(modes, version) {
|
|
4
|
+
let dataString = "",
|
|
5
|
+
mode;
|
|
6
|
+
|
|
7
|
+
for (let i = 0; i < modes.length; i++) {
|
|
8
|
+
mode = DataModeInstances[modes[i].mode];
|
|
9
|
+
dataString += mode.encode(modes[i].modeString, version);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return dataString;
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { chooseMode } from './choose-mode';
|
|
2
|
+
|
|
3
|
+
const initMinNumericBeforeAlpha = 8;
|
|
4
|
+
const initMinNumericBeforeByte = 5;
|
|
5
|
+
const initMinAlphaBeforeByte = 8;
|
|
6
|
+
const minNumericBeforeAlpha = 17;
|
|
7
|
+
const minNumericBeforeByte = 9;
|
|
8
|
+
const minAlphaBeforeByte = 16;
|
|
9
|
+
|
|
10
|
+
export function getModes(inputString) {
|
|
11
|
+
let modes = [],
|
|
12
|
+
previousMode,
|
|
13
|
+
idx = 0;
|
|
14
|
+
let str = inputString;
|
|
15
|
+
|
|
16
|
+
modes.push(chooseMode(str, initMinNumericBeforeAlpha, initMinNumericBeforeByte, initMinAlphaBeforeByte, previousMode));
|
|
17
|
+
previousMode = modes[0].mode;
|
|
18
|
+
str = str.substr(modes[0].modeString.length);
|
|
19
|
+
|
|
20
|
+
while (str.length > 0) {
|
|
21
|
+
let nextMode = chooseMode(str, minNumericBeforeAlpha, minNumericBeforeByte, minAlphaBeforeByte, previousMode);
|
|
22
|
+
|
|
23
|
+
if (nextMode.mode !== previousMode) {
|
|
24
|
+
previousMode = nextMode.mode;
|
|
25
|
+
modes.push(nextMode);
|
|
26
|
+
idx++;
|
|
27
|
+
} else {
|
|
28
|
+
modes[idx].modeString += nextMode.modeString;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
str = str.substr(nextMode.modeString.length);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return modes;
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VersionsCodewordsInformation } from '../version-codewords';
|
|
2
|
+
|
|
3
|
+
export function getVersion(dataCodewordsCount, errorCorrectionLevel) {
|
|
4
|
+
let x = 0,
|
|
5
|
+
y = VersionsCodewordsInformation.length - 1,
|
|
6
|
+
version = Math.floor(VersionsCodewordsInformation.length / 2);
|
|
7
|
+
|
|
8
|
+
do {
|
|
9
|
+
if (dataCodewordsCount < VersionsCodewordsInformation[version][errorCorrectionLevel].totalDataCodewords) {
|
|
10
|
+
y = version;
|
|
11
|
+
} else {
|
|
12
|
+
x = version;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
version = x + Math.floor((y - x) / 2);
|
|
16
|
+
} while (y - x > 1);
|
|
17
|
+
|
|
18
|
+
if (dataCodewordsCount <= VersionsCodewordsInformation[x][errorCorrectionLevel].totalDataCodewords) {
|
|
19
|
+
return version + 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return y + 1;
|
|
23
|
+
}
|