@carbon/charts 0.41.20 → 0.41.24
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/CHANGELOG.md +28 -46
- package/axis-chart.d.ts +4 -4
- package/axis-chart.js +46 -46
- package/axis-chart.js.map +1 -1
- package/build/demo/create-codesandbox.d.ts +42 -42
- package/build/demo/data/bar.d.ts +2 -2
- package/build/demo/data/index.d.ts +13 -13
- package/build/demo/data/line.d.ts +4 -4
- package/build/demo/data/meter.d.ts +1 -1
- package/build/src/axis-chart.d.ts +4 -4
- package/build/src/chart.d.ts +3 -3
- package/build/src/charts/area-stacked.d.ts +2 -2
- package/build/src/charts/area.d.ts +2 -2
- package/build/src/charts/bar-grouped.d.ts +2 -2
- package/build/src/charts/bar-simple.d.ts +2 -2
- package/build/src/charts/bar-stacked.d.ts +2 -2
- package/build/src/charts/bubble.d.ts +2 -2
- package/build/src/charts/combo.d.ts +2 -2
- package/build/src/charts/donut.d.ts +2 -2
- package/build/src/charts/gauge.d.ts +3 -3
- package/build/src/charts/index.d.ts +16 -16
- package/build/src/charts/line.d.ts +2 -2
- package/build/src/charts/lollipop.d.ts +2 -2
- package/build/src/charts/meter.d.ts +3 -3
- package/build/src/charts/pie.d.ts +3 -3
- package/build/src/charts/radar.d.ts +2 -2
- package/build/src/charts/scatter.d.ts +2 -2
- package/build/src/charts/treemap.d.ts +2 -2
- package/build/src/components/axes/axis.d.ts +3 -3
- package/build/src/components/axes/chart-clip.d.ts +2 -2
- package/build/src/components/axes/grid-brush.d.ts +1 -1
- package/build/src/components/axes/grid.d.ts +1 -1
- package/build/src/components/axes/ruler-stacked.d.ts +1 -1
- package/build/src/components/axes/ruler.d.ts +2 -2
- package/build/src/components/axes/toolbar.d.ts +2 -2
- package/build/src/components/axes/two-dimensional-axes.d.ts +2 -2
- package/build/src/components/axes/zero-line.d.ts +1 -1
- package/build/src/components/axes/zoom-bar.d.ts +2 -2
- package/build/src/components/component.d.ts +1 -1
- package/build/src/components/essentials/legend.d.ts +1 -1
- package/build/src/components/essentials/threshold.d.ts +3 -3
- package/build/src/components/essentials/title-meter.d.ts +1 -1
- package/build/src/components/essentials/title.d.ts +1 -1
- package/build/src/components/essentials/tooltip-axis.d.ts +1 -1
- package/build/src/components/essentials/tooltip.d.ts +3 -3
- package/build/src/components/graphs/area-stacked.d.ts +1 -1
- package/build/src/components/graphs/area.d.ts +1 -1
- package/build/src/components/graphs/bar-grouped.d.ts +2 -2
- package/build/src/components/graphs/bar-simple.d.ts +1 -1
- package/build/src/components/graphs/bar-stacked.d.ts +1 -1
- package/build/src/components/graphs/bar.d.ts +1 -1
- package/build/src/components/graphs/bubble.d.ts +2 -2
- package/build/src/components/graphs/donut.d.ts +1 -1
- package/build/src/components/graphs/gauge.d.ts +1 -1
- package/build/src/components/graphs/line.d.ts +1 -1
- package/build/src/components/graphs/lollipop.d.ts +1 -1
- package/build/src/components/graphs/meter.d.ts +1 -1
- package/build/src/components/graphs/pie.d.ts +1 -1
- package/build/src/components/graphs/radar.d.ts +1 -1
- package/build/src/components/graphs/scatter-stacked.d.ts +1 -1
- package/build/src/components/graphs/scatter.d.ts +2 -2
- package/build/src/components/graphs/skeleton-lines.d.ts +1 -1
- package/build/src/components/graphs/skeleton.d.ts +1 -1
- package/build/src/components/graphs/treemap.d.ts +1 -1
- package/build/src/components/index.d.ts +36 -36
- package/build/src/components/layout/layout.d.ts +3 -3
- package/build/src/components/layout/spacer.d.ts +1 -1
- package/build/src/configuration-non-customizable.d.ts +7 -7
- package/build/src/configuration.d.ts +2 -2
- package/build/src/interfaces/axis-scales.d.ts +7 -7
- package/build/src/interfaces/charts.d.ts +11 -4
- package/build/src/interfaces/components.d.ts +3 -3
- package/build/src/interfaces/enums.d.ts +1 -1
- package/build/src/interfaces/index.d.ts +7 -7
- package/build/src/interfaces/layout.d.ts +1 -1
- package/build/src/interfaces/model.d.ts +1 -1
- package/build/src/model-cartesian-charts.d.ts +1 -1
- package/build/src/model-gauge.d.ts +1 -1
- package/build/src/model-meter.d.ts +1 -1
- package/build/src/model-pie.d.ts +1 -1
- package/build/src/model.d.ts +1 -9
- package/build/src/services/angle-utils.d.ts +1 -1
- package/build/src/services/curves.d.ts +2 -2
- package/build/src/services/essentials/dom-utils.d.ts +2 -2
- package/build/src/services/essentials/events.d.ts +1 -1
- package/build/src/services/essentials/gradient-utils.d.ts +1 -1
- package/build/src/services/essentials/transitions.d.ts +2 -2
- package/build/src/services/index.d.ts +7 -7
- package/build/src/services/scales-cartesian.d.ts +2 -2
- package/build/src/services/service.d.ts +1 -1
- package/build/src/services/time-series.d.ts +1 -1
- package/build/src/services/zoom.d.ts +2 -2
- package/build/src/tools.d.ts +2 -2
- package/build/stories/all.stories.d.ts +1 -1
- package/build/stories/tutorials/index.d.ts +11 -11
- package/build/stories/tutorials.stories.d.ts +1 -1
- package/bundle.js +1 -1
- package/chart.d.ts +3 -3
- package/chart.js +35 -35
- package/chart.js.map +1 -1
- package/charts/area-stacked.d.ts +2 -2
- package/charts/area-stacked.js +8 -8
- package/charts/area-stacked.js.map +1 -1
- package/charts/area.d.ts +2 -2
- package/charts/area.js +8 -8
- package/charts/area.js.map +1 -1
- package/charts/bar-grouped.d.ts +2 -2
- package/charts/bar-grouped.js +7 -7
- package/charts/bar-grouped.js.map +1 -1
- package/charts/bar-simple.d.ts +2 -2
- package/charts/bar-simple.js +7 -7
- package/charts/bar-simple.js.map +1 -1
- package/charts/bar-stacked.d.ts +2 -2
- package/charts/bar-stacked.js +7 -7
- package/charts/bar-stacked.js.map +1 -1
- package/charts/bubble.d.ts +2 -2
- package/charts/bubble.js +7 -7
- package/charts/bubble.js.map +1 -1
- package/charts/combo.d.ts +2 -2
- package/charts/combo.js +12 -12
- package/charts/combo.js.map +1 -1
- package/charts/donut.d.ts +2 -2
- package/charts/donut.js +7 -7
- package/charts/donut.js.map +1 -1
- package/charts/gauge.d.ts +3 -3
- package/charts/gauge.js +5 -5
- package/charts/gauge.js.map +1 -1
- package/charts/index.d.ts +16 -16
- package/charts/index.js +16 -16
- package/charts/index.js.map +1 -1
- package/charts/line.d.ts +2 -2
- package/charts/line.js +5 -5
- package/charts/line.js.map +1 -1
- package/charts/lollipop.d.ts +2 -2
- package/charts/lollipop.js +7 -7
- package/charts/lollipop.js.map +1 -1
- package/charts/meter.d.ts +3 -3
- package/charts/meter.js +18 -18
- package/charts/meter.js.map +1 -1
- package/charts/pie.d.ts +3 -3
- package/charts/pie.js +8 -8
- package/charts/pie.js.map +1 -1
- package/charts/radar.d.ts +2 -2
- package/charts/radar.js +5 -5
- package/charts/radar.js.map +1 -1
- package/charts/scatter.d.ts +2 -2
- package/charts/scatter.js +7 -7
- package/charts/scatter.js.map +1 -1
- package/charts/treemap.d.ts +2 -2
- package/charts/treemap.js +4 -4
- package/charts/treemap.js.map +1 -1
- package/components/axes/axis.d.ts +3 -3
- package/components/axes/axis.js +98 -98
- package/components/axes/axis.js.map +1 -1
- package/components/axes/chart-clip.d.ts +2 -2
- package/components/axes/chart-clip.js +9 -9
- package/components/axes/chart-clip.js.map +1 -1
- package/components/axes/grid-brush.d.ts +1 -1
- package/components/axes/grid-brush.js +32 -32
- package/components/axes/grid-brush.js.map +1 -1
- package/components/axes/grid.d.ts +1 -1
- package/components/axes/grid.js +34 -34
- package/components/axes/grid.js.map +1 -1
- package/components/axes/ruler-stacked.d.ts +1 -1
- package/components/axes/ruler-stacked.js +5 -5
- package/components/axes/ruler-stacked.js.map +1 -1
- package/components/axes/ruler.d.ts +2 -2
- package/components/axes/ruler.js +36 -36
- package/components/axes/ruler.js.map +1 -1
- package/components/axes/toolbar.d.ts +2 -2
- package/components/axes/toolbar.js +85 -85
- package/components/axes/toolbar.js.map +1 -1
- package/components/axes/two-dimensional-axes.d.ts +2 -2
- package/components/axes/two-dimensional-axes.js +13 -13
- package/components/axes/two-dimensional-axes.js.map +1 -1
- package/components/axes/zero-line.d.ts +1 -1
- package/components/axes/zero-line.js +12 -12
- package/components/axes/zero-line.js.map +1 -1
- package/components/axes/zoom-bar.d.ts +2 -2
- package/components/axes/zoom-bar.js +114 -114
- package/components/axes/zoom-bar.js.map +1 -1
- package/components/component.d.ts +1 -1
- package/components/component.js +13 -13
- package/components/component.js.map +1 -1
- package/components/essentials/legend.d.ts +1 -1
- package/components/essentials/legend.js +95 -92
- package/components/essentials/legend.js.map +1 -1
- package/components/essentials/threshold.d.ts +3 -3
- package/components/essentials/threshold.js +39 -39
- package/components/essentials/threshold.js.map +1 -1
- package/components/essentials/title-meter.d.ts +1 -1
- package/components/essentials/title-meter.js +42 -42
- package/components/essentials/title-meter.js.map +1 -1
- package/components/essentials/title.d.ts +1 -1
- package/components/essentials/title.js +19 -19
- package/components/essentials/title.js.map +1 -1
- package/components/essentials/tooltip-axis.d.ts +1 -1
- package/components/essentials/tooltip-axis.js +23 -23
- package/components/essentials/tooltip-axis.js.map +1 -1
- package/components/essentials/tooltip.d.ts +3 -3
- package/components/essentials/tooltip.js +31 -31
- package/components/essentials/tooltip.js.map +1 -1
- package/components/graphs/area-stacked.d.ts +1 -1
- package/components/graphs/area-stacked.js +28 -29
- package/components/graphs/area-stacked.js.map +1 -1
- package/components/graphs/area.d.ts +1 -1
- package/components/graphs/area.js +62 -57
- package/components/graphs/area.js.map +1 -1
- package/components/graphs/bar-grouped.d.ts +2 -2
- package/components/graphs/bar-grouped.js +56 -56
- package/components/graphs/bar-grouped.js.map +1 -1
- package/components/graphs/bar-simple.d.ts +1 -1
- package/components/graphs/bar-simple.js +45 -45
- package/components/graphs/bar-simple.js.map +1 -1
- package/components/graphs/bar-stacked.d.ts +1 -1
- package/components/graphs/bar-stacked.js +50 -51
- package/components/graphs/bar-stacked.js.map +1 -1
- package/components/graphs/bar.d.ts +1 -1
- package/components/graphs/bar.js +4 -4
- package/components/graphs/bar.js.map +1 -1
- package/components/graphs/bubble.d.ts +2 -2
- package/components/graphs/bubble.js +19 -19
- package/components/graphs/bubble.js.map +1 -1
- package/components/graphs/donut.d.ts +1 -1
- package/components/graphs/donut.js +20 -20
- package/components/graphs/donut.js.map +1 -1
- package/components/graphs/gauge.d.ts +1 -1
- package/components/graphs/gauge.js +89 -87
- package/components/graphs/gauge.js.map +1 -1
- package/components/graphs/line.d.ts +1 -1
- package/components/graphs/line.js +33 -33
- package/components/graphs/line.js.map +1 -1
- package/components/graphs/lollipop.d.ts +1 -1
- package/components/graphs/lollipop.js +32 -32
- package/components/graphs/lollipop.js.map +1 -1
- package/components/graphs/meter.d.ts +1 -1
- package/components/graphs/meter.js +39 -39
- package/components/graphs/meter.js.map +1 -1
- package/components/graphs/pie.d.ts +1 -1
- package/components/graphs/pie.js +102 -100
- package/components/graphs/pie.js.map +1 -1
- package/components/graphs/radar.d.ts +1 -1
- package/components/graphs/radar.js +180 -180
- package/components/graphs/radar.js.map +1 -1
- package/components/graphs/scatter-stacked.d.ts +1 -1
- package/components/graphs/scatter-stacked.js +22 -22
- package/components/graphs/scatter-stacked.js.map +1 -1
- package/components/graphs/scatter.d.ts +2 -2
- package/components/graphs/scatter.js +67 -66
- package/components/graphs/scatter.js.map +1 -1
- package/components/graphs/skeleton-lines.d.ts +1 -1
- package/components/graphs/skeleton-lines.js +27 -27
- package/components/graphs/skeleton-lines.js.map +1 -1
- package/components/graphs/skeleton.d.ts +1 -1
- package/components/graphs/skeleton.js +85 -85
- package/components/graphs/skeleton.js.map +1 -1
- package/components/graphs/treemap.d.ts +1 -1
- package/components/graphs/treemap.js +82 -82
- package/components/graphs/treemap.js.map +1 -1
- package/components/index.d.ts +36 -36
- package/components/index.js +36 -36
- package/components/index.js.map +1 -1
- package/components/layout/layout.d.ts +3 -3
- package/components/layout/layout.js +28 -28
- package/components/layout/layout.js.map +1 -1
- package/components/layout/spacer.d.ts +1 -1
- package/components/layout/spacer.js +10 -10
- package/components/layout/spacer.js.map +1 -1
- package/configuration-non-customizable.d.ts +7 -7
- package/configuration-non-customizable.js +37 -37
- package/configuration-non-customizable.js.map +1 -1
- package/configuration.d.ts +2 -2
- package/configuration.js +81 -78
- package/configuration.js.map +1 -1
- package/demo/create-codesandbox.d.ts +42 -42
- package/demo/create-codesandbox.js +100 -100
- package/demo/create-codesandbox.js.map +1 -1
- package/demo/data/area.js +220 -190
- package/demo/data/area.js.map +1 -1
- package/demo/data/bar.d.ts +2 -2
- package/demo/data/bar.js +302 -302
- package/demo/data/bar.js.map +1 -1
- package/demo/data/bubble.js +108 -108
- package/demo/data/bubble.js.map +1 -1
- package/demo/data/combo.js +323 -323
- package/demo/data/combo.js.map +1 -1
- package/demo/data/donut.js +19 -19
- package/demo/data/donut.js.map +1 -1
- package/demo/data/gauge.js +20 -20
- package/demo/data/gauge.js.map +1 -1
- package/demo/data/high-scale.js +3 -3
- package/demo/data/high-scale.js.map +1 -1
- package/demo/data/index.d.ts +13 -13
- package/demo/data/index.js +299 -299
- package/demo/data/index.js.map +1 -1
- package/demo/data/line.d.ts +4 -4
- package/demo/data/line.js +332 -332
- package/demo/data/line.js.map +1 -1
- package/demo/data/lollipop.js +19 -19
- package/demo/data/lollipop.js.map +1 -1
- package/demo/data/meter.d.ts +1 -1
- package/demo/data/meter.js +22 -22
- package/demo/data/meter.js.map +1 -1
- package/demo/data/pie.js +17 -17
- package/demo/data/pie.js.map +1 -1
- package/demo/data/radar.js +84 -84
- package/demo/data/radar.js.map +1 -1
- package/demo/data/scatter.js +125 -125
- package/demo/data/scatter.js.map +1 -1
- package/demo/data/step.js +11 -11
- package/demo/data/step.js.map +1 -1
- package/demo/data/time-series-axis.js +164 -164
- package/demo/data/time-series-axis.js.map +1 -1
- package/demo/data/toolbar.js +15 -15
- package/demo/data/toolbar.js.map +1 -1
- package/demo/data/treemap.js +63 -63
- package/demo/data/treemap.js.map +1 -1
- package/demo/data/zoom-bar.js +65 -65
- package/demo/data/zoom-bar.js.map +1 -1
- package/demo/styles.css +1 -1
- package/demo/styles.min.css +1 -1
- package/demo/tsconfig.tsbuildinfo +45 -45
- package/index.d.ts +3 -3
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/interfaces/a11y.js.map +1 -1
- package/interfaces/axis-scales.d.ts +7 -7
- package/interfaces/axis-scales.js.map +1 -1
- package/interfaces/charts.d.ts +11 -4
- package/interfaces/charts.js.map +1 -1
- package/interfaces/components.d.ts +3 -3
- package/interfaces/components.js.map +1 -1
- package/interfaces/enums.d.ts +1 -1
- package/interfaces/enums.js +1 -1
- package/interfaces/enums.js.map +1 -1
- package/interfaces/events.js.map +1 -1
- package/interfaces/index.d.ts +7 -7
- package/interfaces/index.js +2 -2
- package/interfaces/index.js.map +1 -1
- package/interfaces/layout.d.ts +1 -1
- package/interfaces/layout.js.map +1 -1
- package/interfaces/model.d.ts +1 -1
- package/interfaces/model.js.map +1 -1
- package/model-cartesian-charts.d.ts +1 -1
- package/model-cartesian-charts.js +7 -7
- package/model-cartesian-charts.js.map +1 -1
- package/model-gauge.d.ts +1 -1
- package/model-gauge.js +2 -2
- package/model-gauge.js.map +1 -1
- package/model-meter.d.ts +1 -1
- package/model-meter.js +7 -7
- package/model-meter.js.map +1 -1
- package/model-pie.d.ts +1 -1
- package/model-pie.js +1 -1
- package/model-pie.js.map +1 -1
- package/model.d.ts +1 -9
- package/model.js +31 -42
- package/model.js.map +1 -1
- package/package.json +2 -3
- package/polyfills.js +9 -9
- package/polyfills.js.map +1 -1
- package/services/angle-utils.d.ts +1 -1
- package/services/angle-utils.js +9 -9
- package/services/angle-utils.js.map +1 -1
- package/services/curves.d.ts +2 -2
- package/services/curves.js +6 -6
- package/services/curves.js.map +1 -1
- package/services/essentials/dom-utils.d.ts +2 -2
- package/services/essentials/dom-utils.js +37 -37
- package/services/essentials/dom-utils.js.map +1 -1
- package/services/essentials/events.d.ts +1 -1
- package/services/essentials/events.js +3 -3
- package/services/essentials/events.js.map +1 -1
- package/services/essentials/gradient-utils.d.ts +1 -1
- package/services/essentials/gradient-utils.js +25 -25
- package/services/essentials/gradient-utils.js.map +1 -1
- package/services/essentials/transitions.d.ts +2 -2
- package/services/essentials/transitions.js +8 -8
- package/services/essentials/transitions.js.map +1 -1
- package/services/index.d.ts +7 -7
- package/services/index.js +7 -7
- package/services/index.js.map +1 -1
- package/services/scales-cartesian.d.ts +2 -2
- package/services/scales-cartesian.js +57 -60
- package/services/scales-cartesian.js.map +1 -1
- package/services/service.d.ts +1 -1
- package/services/service.js.map +1 -1
- package/services/time-series.d.ts +1 -1
- package/services/time-series.js +27 -27
- package/services/time-series.js.map +1 -1
- package/services/zoom.d.ts +2 -2
- package/services/zoom.js +20 -20
- package/services/zoom.js.map +1 -1
- package/styles/_type.scss +7 -7
- package/styles/color-palatte.scss +218 -218
- package/styles/colors.scss +3 -3
- package/styles/components/_axis.scss +5 -5
- package/styles/components/_ruler.scss +2 -2
- package/styles/components/_threshold.scss +1 -1
- package/styles/components/_title.scss +3 -3
- package/styles/components/_toolbar.scss +1 -1
- package/styles/components/_tooltip.scss +6 -6
- package/styles/components/index.scss +16 -16
- package/styles/graphs/_bubble.scss +1 -1
- package/styles/graphs/_radar.scss +2 -2
- package/styles/graphs/_scatter.scss +1 -1
- package/styles/graphs/_treemap.scss +1 -1
- package/styles/graphs/index.scss +9 -9
- package/styles/styles-g10.scss +2 -2
- package/styles/styles-g100.scss +2 -2
- package/styles/styles-g90.scss +2 -2
- package/styles/styles-white.scss +2 -2
- package/styles/styles.scss +10 -10
- package/tools.d.ts +2 -2
- package/tools.js +26 -26
- package/tools.js.map +1 -1
- package/tsconfig.tsbuildinfo +173 -173
|
@@ -12,7 +12,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
14
|
// Internal Imports
|
|
15
|
-
import { Service } from
|
|
15
|
+
import { Service } from '../service';
|
|
16
16
|
var GradientUtils = /** @class */ (function (_super) {
|
|
17
17
|
__extends(GradientUtils, _super);
|
|
18
18
|
function GradientUtils() {
|
|
@@ -22,58 +22,58 @@ var GradientUtils = /** @class */ (function (_super) {
|
|
|
22
22
|
var lg = configs.svg.select("defs linearGradient#" + configs.id);
|
|
23
23
|
if (lg.empty()) {
|
|
24
24
|
lg = configs.svg
|
|
25
|
-
.append(
|
|
26
|
-
.append(
|
|
27
|
-
.attr(
|
|
28
|
-
.attr(
|
|
29
|
-
.attr(
|
|
30
|
-
.attr(
|
|
31
|
-
.attr(
|
|
25
|
+
.append('defs')
|
|
26
|
+
.append('linearGradient')
|
|
27
|
+
.attr('id', configs.id)
|
|
28
|
+
.attr('x1', configs.x1)
|
|
29
|
+
.attr('x2', configs.x2)
|
|
30
|
+
.attr('y1', configs.y1)
|
|
31
|
+
.attr('y2', configs.y2);
|
|
32
32
|
}
|
|
33
|
-
lg.selectAll(
|
|
33
|
+
lg.selectAll('stop')
|
|
34
34
|
.data(configs.stops)
|
|
35
35
|
.enter()
|
|
36
|
-
.append(
|
|
37
|
-
.attr(
|
|
38
|
-
.style(
|
|
39
|
-
.style(
|
|
36
|
+
.append('stop')
|
|
37
|
+
.attr('offset', function (d) { return d.offset; })
|
|
38
|
+
.style('stop-color', function (d) { return d.color; })
|
|
39
|
+
.style('stop-opacity', function (d) { return d.opacity; });
|
|
40
40
|
};
|
|
41
41
|
GradientUtils.getOffsetRatio = function (domain) {
|
|
42
42
|
var offsetRatio = ((Math.abs(domain[1]) * 100) /
|
|
43
|
-
Math.abs(domain[0] - domain[1])).toFixed(2) +
|
|
43
|
+
Math.abs(domain[0] - domain[1])).toFixed(2) + '%';
|
|
44
44
|
return offsetRatio;
|
|
45
45
|
};
|
|
46
46
|
GradientUtils.getStops = function (domain, color) {
|
|
47
47
|
var need3Stops = domain[0] < 0 && domain[1] > 0;
|
|
48
48
|
var stops = [
|
|
49
49
|
{
|
|
50
|
-
offset:
|
|
50
|
+
offset: '0%',
|
|
51
51
|
color: color,
|
|
52
|
-
opacity:
|
|
52
|
+
opacity: '0.6',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
offset:
|
|
55
|
+
offset: '80%',
|
|
56
56
|
color: color,
|
|
57
|
-
opacity:
|
|
58
|
-
}
|
|
57
|
+
opacity: '0',
|
|
58
|
+
},
|
|
59
59
|
];
|
|
60
60
|
if (need3Stops) {
|
|
61
61
|
stops = [
|
|
62
62
|
{
|
|
63
|
-
offset:
|
|
63
|
+
offset: '0%',
|
|
64
64
|
color: color,
|
|
65
|
-
opacity:
|
|
65
|
+
opacity: '0.6',
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
offset: GradientUtils.getOffsetRatio(domain),
|
|
69
69
|
color: color,
|
|
70
|
-
opacity:
|
|
70
|
+
opacity: '0',
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
offset:
|
|
73
|
+
offset: '100%',
|
|
74
74
|
color: color,
|
|
75
|
-
opacity:
|
|
76
|
-
}
|
|
75
|
+
opacity: '0.6',
|
|
76
|
+
},
|
|
77
77
|
];
|
|
78
78
|
}
|
|
79
79
|
return stops;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradient-utils.js","sourceRoot":"","sources":["gradient-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC;IAAmC,iCAAO;IAA1C;;IAoEA,CAAC;IAnEO,0CAA4B,GAAnC,UAAoC,OAAO;QAC1C,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,yBAAuB,OAAO,CAAC,EAAI,CAAC,CAAC;QACjE,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;YACf,EAAE,GAAG,OAAO,CAAC,GAAG;iBACd,MAAM,CAAC,MAAM,CAAC;iBACd,MAAM,CAAC,gBAAgB,CAAC;iBACxB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;SACzB;QAED,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;aAClB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;aACnB,KAAK,EAAE;aACP,MAAM,CAAC,MAAM,CAAC;aACd,IAAI,CAAC,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,MAAM,EAAR,CAAQ,CAAC;aAC/B,KAAK,CAAC,YAAY,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,KAAK,EAAP,CAAO,CAAC;aACnC,KAAK,CAAC,cAAc,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,OAAO,EAAT,CAAS,CAAC,CAAC;IAC3C,CAAC;IAEM,4BAAc,GAArB,UAAsB,MAAM;QAC3B,IAAM,WAAW,GAChB,CACC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;YAC3B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAC/B,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QACpB,OAAO,WAAW,CAAC;IACpB,CAAC;IAEM,sBAAQ,GAAf,UAAgB,MAAM,EAAE,KAAK;QAC5B,IAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,KAAK,GAAa;YACrB;gBACC,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE,KAAK;aACd;YACD;gBACC,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE,GAAG;aACZ;SACD,CAAC;QAEF,IAAI,UAAU,EAAE;YACf,KAAK,GAAG;gBACP;oBACC,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,KAAK;oBACZ,OAAO,EAAE,KAAK;iBACd;gBACD;oBACC,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC;oBAC5C,KAAK,EAAE,KAAK;oBACZ,OAAO,EAAE,GAAG;iBACZ;gBACD;oBACC,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,KAAK;oBACZ,OAAO,EAAE,KAAK;iBACd;aACD,CAAC;SACF;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IACF,oBAAC;AAAD,CAAC,AApED,CAAmC,OAAO,GAoEzC","sourcesContent":["// Internal Imports\nimport { Service } from
|
|
1
|
+
{"version":3,"file":"gradient-utils.js","sourceRoot":"","sources":["gradient-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC;IAAmC,iCAAO;IAA1C;;IAoEA,CAAC;IAnEO,0CAA4B,GAAnC,UAAoC,OAAO;QAC1C,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,yBAAuB,OAAO,CAAC,EAAI,CAAC,CAAC;QACjE,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;YACf,EAAE,GAAG,OAAO,CAAC,GAAG;iBACd,MAAM,CAAC,MAAM,CAAC;iBACd,MAAM,CAAC,gBAAgB,CAAC;iBACxB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;SACzB;QAED,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;aAClB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;aACnB,KAAK,EAAE;aACP,MAAM,CAAC,MAAM,CAAC;aACd,IAAI,CAAC,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,MAAM,EAAR,CAAQ,CAAC;aAC/B,KAAK,CAAC,YAAY,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,KAAK,EAAP,CAAO,CAAC;aACnC,KAAK,CAAC,cAAc,EAAE,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,OAAO,EAAT,CAAS,CAAC,CAAC;IAC3C,CAAC;IAEM,4BAAc,GAArB,UAAsB,MAAM;QAC3B,IAAM,WAAW,GAChB,CACC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;YAC3B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAC/B,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QACpB,OAAO,WAAW,CAAC;IACpB,CAAC;IAEM,sBAAQ,GAAf,UAAgB,MAAM,EAAE,KAAK;QAC5B,IAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,KAAK,GAAa;YACrB;gBACC,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE,KAAK;aACd;YACD;gBACC,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE,GAAG;aACZ;SACD,CAAC;QAEF,IAAI,UAAU,EAAE;YACf,KAAK,GAAG;gBACP;oBACC,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,KAAK;oBACZ,OAAO,EAAE,KAAK;iBACd;gBACD;oBACC,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC;oBAC5C,KAAK,EAAE,KAAK;oBACZ,OAAO,EAAE,GAAG;iBACZ;gBACD;oBACC,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,KAAK;oBACZ,OAAO,EAAE,KAAK;iBACd;aACD,CAAC;SACF;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IACF,oBAAC;AAAD,CAAC,AApED,CAAmC,OAAO,GAoEzC","sourcesContent":["// Internal Imports\nimport { Service } from '../service';\nimport { DOMUtils } from '../';\n\nexport class GradientUtils extends Service {\n\tstatic appendOrUpdateLinearGradient(configs) {\n\t\tlet lg = configs.svg.select(`defs linearGradient#${configs.id}`);\n\t\tif (lg.empty()) {\n\t\t\tlg = configs.svg\n\t\t\t\t.append('defs')\n\t\t\t\t.append('linearGradient')\n\t\t\t\t.attr('id', configs.id)\n\t\t\t\t.attr('x1', configs.x1)\n\t\t\t\t.attr('x2', configs.x2)\n\t\t\t\t.attr('y1', configs.y1)\n\t\t\t\t.attr('y2', configs.y2);\n\t\t}\n\n\t\tlg.selectAll('stop')\n\t\t\t.data(configs.stops)\n\t\t\t.enter()\n\t\t\t.append('stop')\n\t\t\t.attr('offset', (d) => d.offset)\n\t\t\t.style('stop-color', (d) => d.color)\n\t\t\t.style('stop-opacity', (d) => d.opacity);\n\t}\n\n\tstatic getOffsetRatio(domain) {\n\t\tconst offsetRatio =\n\t\t\t(\n\t\t\t\t(Math.abs(domain[1]) * 100) /\n\t\t\t\tMath.abs(domain[0] - domain[1])\n\t\t\t).toFixed(2) + '%';\n\t\treturn offsetRatio;\n\t}\n\n\tstatic getStops(domain, color) {\n\t\tconst need3Stops = domain[0] < 0 && domain[1] > 0;\n\t\tlet stops: object[] = [\n\t\t\t{\n\t\t\t\toffset: '0%',\n\t\t\t\tcolor: color,\n\t\t\t\topacity: '0.6',\n\t\t\t},\n\t\t\t{\n\t\t\t\toffset: '80%',\n\t\t\t\tcolor: color,\n\t\t\t\topacity: '0',\n\t\t\t},\n\t\t];\n\n\t\tif (need3Stops) {\n\t\t\tstops = [\n\t\t\t\t{\n\t\t\t\t\toffset: '0%',\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0.6',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\toffset: GradientUtils.getOffsetRatio(domain),\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\toffset: '100%',\n\t\t\t\t\tcolor: color,\n\t\t\t\t\topacity: '0.6',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\treturn stops;\n\t}\n}\n"]}
|
|
@@ -12,12 +12,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
14
|
// Internal Imports
|
|
15
|
-
import { Service } from
|
|
16
|
-
import * as Configuration from
|
|
17
|
-
import { Events } from
|
|
18
|
-
import { Tools } from
|
|
15
|
+
import { Service } from '../service';
|
|
16
|
+
import * as Configuration from '../../configuration';
|
|
17
|
+
import { Events } from './../../interfaces';
|
|
18
|
+
import { Tools } from '../../tools';
|
|
19
19
|
// D3 Imports
|
|
20
|
-
import { transition } from
|
|
20
|
+
import { transition } from 'd3-transition';
|
|
21
21
|
var Transitions = /** @class */ (function (_super) {
|
|
22
22
|
__extends(Transitions, _super);
|
|
23
23
|
function Transitions() {
|
|
@@ -37,10 +37,10 @@ var Transitions = /** @class */ (function (_super) {
|
|
|
37
37
|
if (this.model.getOptions().animations === false || animate === false) {
|
|
38
38
|
return this.getInstantTransition(name);
|
|
39
39
|
}
|
|
40
|
-
var t = transition(name).duration(Tools.getProperty(Configuration.transitions, name,
|
|
40
|
+
var t = transition(name).duration(Tools.getProperty(Configuration.transitions, name, 'duration') ||
|
|
41
41
|
Configuration.transitions.default.duration);
|
|
42
42
|
this.pendingTransitions[t._id] = t;
|
|
43
|
-
t.on(
|
|
43
|
+
t.on('end interrupt cancel', function () {
|
|
44
44
|
delete _this.pendingTransitions[t._id];
|
|
45
45
|
});
|
|
46
46
|
return t;
|
|
@@ -49,7 +49,7 @@ var Transitions = /** @class */ (function (_super) {
|
|
|
49
49
|
var _this = this;
|
|
50
50
|
var t = transition(name).duration(0);
|
|
51
51
|
this.pendingTransitions[t._id] = t;
|
|
52
|
-
t.on(
|
|
52
|
+
t.on('end interrupt cancel', function () {
|
|
53
53
|
delete _this.pendingTransitions[t._id];
|
|
54
54
|
});
|
|
55
55
|
return t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transitions.js","sourceRoot":"","sources":["transitions.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,aAAa;AACb,OAAO,EAAc,UAAU,EAAE,MAAM,eAAe,CAAC;AAEvD;IAAiC,+BAAO;IAAxC;QAAA,qEA6CC;QA5CA,wBAAkB,GAAG,EAAE,CAAC;;IA4CzB,CAAC;IA3CA,iDAAiD;IAEjD,0BAAI,GAAJ;QAAA,iBAIC;QAHA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE;YAC1D,KAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,mCAAa,GAAb,UACC,IAAa,EACb,OAAiB;QAFlB,iBAmBC;QAfA,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,UAAU,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,EAAE;YACtE,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;SACvC;QAED,IAAM,CAAC,GAAQ,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CACvC,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,UAAU,CAAC;YAC7D,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAC3C,CAAC;QAEF,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC,EAAE,CAAC,sBAAsB,EAAE;YAC5B,OAAO,KAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC;IACV,CAAC;IAED,0CAAoB,GAApB,UAAqB,IAAa;QAAlC,iBASC;QARA,IAAM,CAAC,GAAQ,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE5C,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC,EAAE,CAAC,sBAAsB,EAAE;YAC5B,OAAO,KAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC;IACV,CAAC;IAED,2CAAqB,GAArB;QACC,OAAO,IAAI,CAAC,kBAAkB,CAAC;IAChC,CAAC;IACF,kBAAC;AAAD,CAAC,AA7CD,CAAiC,OAAO,GA6CvC","sourcesContent":["// Internal Imports\nimport { Service } from
|
|
1
|
+
{"version":3,"file":"transitions.js","sourceRoot":"","sources":["transitions.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,aAAa;AACb,OAAO,EAAc,UAAU,EAAE,MAAM,eAAe,CAAC;AAEvD;IAAiC,+BAAO;IAAxC;QAAA,qEA6CC;QA5CA,wBAAkB,GAAG,EAAE,CAAC;;IA4CzB,CAAC;IA3CA,iDAAiD;IAEjD,0BAAI,GAAJ;QAAA,iBAIC;QAHA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE;YAC1D,KAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,mCAAa,GAAb,UACC,IAAa,EACb,OAAiB;QAFlB,iBAmBC;QAfA,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,UAAU,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,EAAE;YACtE,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;SACvC;QAED,IAAM,CAAC,GAAQ,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CACvC,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,UAAU,CAAC;YAC7D,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAC3C,CAAC;QAEF,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC,EAAE,CAAC,sBAAsB,EAAE;YAC5B,OAAO,KAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC;IACV,CAAC;IAED,0CAAoB,GAApB,UAAqB,IAAa;QAAlC,iBASC;QARA,IAAM,CAAC,GAAQ,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE5C,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC,EAAE,CAAC,sBAAsB,EAAE;YAC5B,OAAO,KAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC;IACV,CAAC;IAED,2CAAqB,GAArB;QACC,OAAO,IAAI,CAAC,kBAAkB,CAAC;IAChC,CAAC;IACF,kBAAC;AAAD,CAAC,AA7CD,CAAiC,OAAO,GA6CvC","sourcesContent":["// Internal Imports\nimport { Service } from '../service';\nimport * as Configuration from '../../configuration';\nimport { Events } from './../../interfaces';\nimport { Tools } from '../../tools';\n\n// D3 Imports\nimport { Transition, transition } from 'd3-transition';\n\nexport class Transitions extends Service {\n\tpendingTransitions = {};\n\t// transitions: Transition<any, any, any, any>[];\n\n\tinit() {\n\t\tthis.services.events.addEventListener(Events.Model.UPDATE, () => {\n\t\t\tthis.pendingTransitions = {};\n\t\t});\n\t}\n\n\tgetTransition(\n\t\tname?: string,\n\t\tanimate?: boolean\n\t): Transition<any, any, any, any> {\n\t\tif (this.model.getOptions().animations === false || animate === false) {\n\t\t\treturn this.getInstantTransition(name);\n\t\t}\n\n\t\tconst t: any = transition(name).duration(\n\t\t\tTools.getProperty(Configuration.transitions, name, 'duration') ||\n\t\t\t\tConfiguration.transitions.default.duration\n\t\t);\n\n\t\tthis.pendingTransitions[t._id] = t;\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id];\n\t\t});\n\n\t\treturn t;\n\t}\n\n\tgetInstantTransition(name?: string): Transition<any, any, any, any> {\n\t\tconst t: any = transition(name).duration(0);\n\n\t\tthis.pendingTransitions[t._id] = t;\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id];\n\t\t});\n\n\t\treturn t;\n\t}\n\n\tgetPendingTransitions() {\n\t\treturn this.pendingTransitions;\n\t}\n}\n"]}
|
package/services/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from './essentials/dom-utils';
|
|
2
|
+
export * from './essentials/events';
|
|
3
|
+
export * from './essentials/transitions';
|
|
4
|
+
export * from './essentials/gradient-utils';
|
|
5
|
+
export * from './scales-cartesian';
|
|
6
|
+
export * from './curves';
|
|
7
|
+
export * from './zoom';
|
package/services/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Essentials
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
2
|
+
export * from './essentials/dom-utils';
|
|
3
|
+
export * from './essentials/events';
|
|
4
|
+
export * from './essentials/transitions';
|
|
5
|
+
export * from './essentials/gradient-utils';
|
|
6
6
|
// MISC
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
7
|
+
export * from './scales-cartesian';
|
|
8
|
+
export * from './curves';
|
|
9
|
+
export * from './zoom';
|
|
10
10
|
//# sourceMappingURL=../../src/services/index.js.map
|
package/services/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAE5C,OAAO;AACP,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC","sourcesContent":["// Essentials\nexport * from
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAE5C,OAAO;AACP,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC","sourcesContent":["// Essentials\nexport * from './essentials/dom-utils';\nexport * from './essentials/events';\nexport * from './essentials/transitions';\nexport * from './essentials/gradient-utils';\n\n// MISC\nexport * from './scales-cartesian';\nexport * from './curves';\nexport * from './zoom';\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Service } from
|
|
2
|
-
import { AxisPositions, CartesianOrientations, ScaleTypes, ThresholdOptions } from
|
|
1
|
+
import { Service } from './service';
|
|
2
|
+
import { AxisPositions, CartesianOrientations, ScaleTypes, ThresholdOptions } from '../interfaces';
|
|
3
3
|
export declare class CartesianScales extends Service {
|
|
4
4
|
protected scaleTypes: {
|
|
5
5
|
top: any;
|
|
@@ -30,16 +30,16 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
|
30
30
|
return r;
|
|
31
31
|
};
|
|
32
32
|
// Internal Imports
|
|
33
|
-
import * as Configuration from
|
|
34
|
-
import { Service } from
|
|
35
|
-
import { AxisPositions, CartesianOrientations, ScaleTypes } from
|
|
36
|
-
import { Tools } from
|
|
33
|
+
import * as Configuration from '../configuration';
|
|
34
|
+
import { Service } from './service';
|
|
35
|
+
import { AxisPositions, CartesianOrientations, ScaleTypes, } from '../interfaces';
|
|
36
|
+
import { Tools } from '../tools';
|
|
37
37
|
// D3 Imports
|
|
38
|
-
import { scaleBand, scaleLinear, scaleTime, scaleLog } from
|
|
39
|
-
import { extent, sum } from
|
|
40
|
-
import { map, values } from
|
|
38
|
+
import { scaleBand, scaleLinear, scaleTime, scaleLog } from 'd3-scale';
|
|
39
|
+
import { extent, sum } from 'd3-array';
|
|
40
|
+
import { map, values } from 'd3-collection';
|
|
41
41
|
// Misc
|
|
42
|
-
import { differenceInYears, addYears, subYears, differenceInMonths, addMonths, subMonths, differenceInDays, addDays, subDays, differenceInHours, addHours, subHours, differenceInMinutes, addMinutes, subMinutes, differenceInSeconds, subSeconds, addSeconds } from
|
|
42
|
+
import { differenceInYears, addYears, subYears, differenceInMonths, addMonths, subMonths, differenceInDays, addDays, subDays, differenceInHours, addHours, subHours, differenceInMinutes, addMinutes, subMinutes, differenceInSeconds, subSeconds, addSeconds, } from 'date-fns';
|
|
43
43
|
var CartesianScales = /** @class */ (function (_super) {
|
|
44
44
|
__extends(CartesianScales, _super);
|
|
45
45
|
function CartesianScales() {
|
|
@@ -48,13 +48,13 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
48
48
|
top: null,
|
|
49
49
|
right: null,
|
|
50
50
|
bottom: null,
|
|
51
|
-
left: null
|
|
51
|
+
left: null,
|
|
52
52
|
};
|
|
53
53
|
_this.scales = {
|
|
54
54
|
top: null,
|
|
55
55
|
right: null,
|
|
56
56
|
bottom: null,
|
|
57
|
-
left: null
|
|
57
|
+
left: null,
|
|
58
58
|
};
|
|
59
59
|
return _this;
|
|
60
60
|
}
|
|
@@ -64,7 +64,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
64
64
|
if (this.dualAxes && datum) {
|
|
65
65
|
var options = this.model.getOptions();
|
|
66
66
|
var groupMapsTo = options.data.groupMapsTo;
|
|
67
|
-
var axesOptions = Tools.getProperty(options,
|
|
67
|
+
var axesOptions = Tools.getProperty(options, 'axes', this.secondaryDomainAxisPosition);
|
|
68
68
|
var dataset = datum[groupMapsTo];
|
|
69
69
|
if (((_c = axesOptions) === null || _c === void 0 ? void 0 : _c.correspondingDatasets) &&
|
|
70
70
|
axesOptions.correspondingDatasets.includes(dataset)) {
|
|
@@ -79,7 +79,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
79
79
|
if (this.dualAxes) {
|
|
80
80
|
var options = this.model.getOptions();
|
|
81
81
|
var groupMapsTo = options.data.groupMapsTo;
|
|
82
|
-
var axisOptions = Tools.getProperty(options,
|
|
82
|
+
var axisOptions = Tools.getProperty(options, 'axes', this.secondaryRangeAxisPosition);
|
|
83
83
|
var dataset = void 0;
|
|
84
84
|
if (datum !== null) {
|
|
85
85
|
dataset = datum[groupMapsTo];
|
|
@@ -95,7 +95,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
95
95
|
return this.rangeAxisPosition;
|
|
96
96
|
};
|
|
97
97
|
CartesianScales.prototype.getAxisOptions = function (position) {
|
|
98
|
-
return Tools.getProperty(this.model.getOptions(),
|
|
98
|
+
return Tools.getProperty(this.model.getOptions(), 'axes', position);
|
|
99
99
|
};
|
|
100
100
|
CartesianScales.prototype.getDomainAxisOptions = function () {
|
|
101
101
|
var domainAxisPosition = this.getDomainAxisPosition();
|
|
@@ -152,7 +152,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
152
152
|
CartesianScales.prototype.determineAxisDuality = function () {
|
|
153
153
|
var _a, _b, _c, _d;
|
|
154
154
|
var options = this.model.getOptions();
|
|
155
|
-
var axesOptions = Tools.getProperty(options,
|
|
155
|
+
var axesOptions = Tools.getProperty(options, 'axes');
|
|
156
156
|
if ((((_a = axesOptions[AxisPositions.LEFT]) === null || _a === void 0 ? void 0 : _a.correspondingDatasets) &&
|
|
157
157
|
axesOptions[AxisPositions.RIGHT]) ||
|
|
158
158
|
(((_b = axesOptions[AxisPositions.RIGHT]) === null || _b === void 0 ? void 0 : _b.correspondingDatasets) &&
|
|
@@ -191,7 +191,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
191
191
|
CartesianScales.prototype.getMainXAxisPosition = function () {
|
|
192
192
|
var possibleXAxisPositions = [
|
|
193
193
|
AxisPositions.BOTTOM,
|
|
194
|
-
AxisPositions.TOP
|
|
194
|
+
AxisPositions.TOP,
|
|
195
195
|
];
|
|
196
196
|
return [this.domainAxisPosition, this.rangeAxisPosition].find(function (position) { return possibleXAxisPositions.indexOf(position) > -1; });
|
|
197
197
|
};
|
|
@@ -199,7 +199,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
199
199
|
CartesianScales.prototype.getMainYAxisPosition = function () {
|
|
200
200
|
var possibleYAxisPositions = [
|
|
201
201
|
AxisPositions.LEFT,
|
|
202
|
-
AxisPositions.RIGHT
|
|
202
|
+
AxisPositions.RIGHT,
|
|
203
203
|
];
|
|
204
204
|
return [this.domainAxisPosition, this.rangeAxisPosition].find(function (position) { return possibleYAxisPositions.indexOf(position) > -1; });
|
|
205
205
|
};
|
|
@@ -211,7 +211,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
211
211
|
};
|
|
212
212
|
CartesianScales.prototype.getValueFromScale = function (scale, scaleType, axisPosition, datum, index) {
|
|
213
213
|
var options = this.model.getOptions();
|
|
214
|
-
var axesOptions = Tools.getProperty(options,
|
|
214
|
+
var axesOptions = Tools.getProperty(options, 'axes');
|
|
215
215
|
var axisOptions = axesOptions[axisPosition];
|
|
216
216
|
var mapsTo = axisOptions.mapsTo;
|
|
217
217
|
var value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum;
|
|
@@ -232,7 +232,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
232
232
|
var bounds = this.model.getOptions().bounds;
|
|
233
233
|
var scale = this.scales[this.rangeAxisPosition];
|
|
234
234
|
var options = this.model.getOptions();
|
|
235
|
-
var axesOptions = Tools.getProperty(options,
|
|
235
|
+
var axesOptions = Tools.getProperty(options, 'axes');
|
|
236
236
|
var axisOptions = axesOptions[this.rangeAxisPosition];
|
|
237
237
|
var mapsTo = axisOptions.mapsTo;
|
|
238
238
|
var value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum;
|
|
@@ -242,7 +242,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
242
242
|
: value),
|
|
243
243
|
scale(datum[bounds.lowerBoundMapsTo]
|
|
244
244
|
? datum[bounds.lowerBoundMapsTo]
|
|
245
|
-
: value)
|
|
245
|
+
: value),
|
|
246
246
|
];
|
|
247
247
|
return boundedValues;
|
|
248
248
|
};
|
|
@@ -267,17 +267,17 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
267
267
|
};
|
|
268
268
|
CartesianScales.prototype.getDomainIdentifier = function (datum) {
|
|
269
269
|
var options = this.model.getOptions();
|
|
270
|
-
return Tools.getProperty(options,
|
|
270
|
+
return Tools.getProperty(options, 'axes', this.getDomainAxisPosition({ datum: datum }), 'mapsTo');
|
|
271
271
|
};
|
|
272
272
|
CartesianScales.prototype.getRangeIdentifier = function (datum) {
|
|
273
273
|
var options = this.model.getOptions();
|
|
274
|
-
return Tools.getProperty(options,
|
|
274
|
+
return Tools.getProperty(options, 'axes', this.getRangeAxisPosition({ datum: datum }), 'mapsTo');
|
|
275
275
|
};
|
|
276
276
|
CartesianScales.prototype.extendsDomain = function (axisPosition, domain) {
|
|
277
277
|
var options = this.model.getOptions();
|
|
278
|
-
var axisOptions = Tools.getProperty(options,
|
|
278
|
+
var axisOptions = Tools.getProperty(options, 'axes', axisPosition);
|
|
279
279
|
if (axisOptions.scaleType === ScaleTypes.TIME) {
|
|
280
|
-
var spaceToAddToEdges = Tools.getProperty(options,
|
|
280
|
+
var spaceToAddToEdges = Tools.getProperty(options, 'timeScale', 'addSpaceOnEdges');
|
|
281
281
|
return addSpacingToTimeDomain(domain, spaceToAddToEdges);
|
|
282
282
|
}
|
|
283
283
|
else {
|
|
@@ -286,51 +286,51 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
286
286
|
};
|
|
287
287
|
CartesianScales.prototype.findVerticalAxesPositions = function () {
|
|
288
288
|
var options = this.model.getOptions();
|
|
289
|
-
var axesOptions = Tools.getProperty(options,
|
|
289
|
+
var axesOptions = Tools.getProperty(options, 'axes');
|
|
290
290
|
var dualAxes = this.isDualAxes();
|
|
291
291
|
// If right axis has been specified as `main`
|
|
292
292
|
if ((Tools.getProperty(axesOptions, AxisPositions.LEFT) === null &&
|
|
293
293
|
Tools.getProperty(axesOptions, AxisPositions.RIGHT) !== null) ||
|
|
294
|
-
Tools.getProperty(axesOptions, AxisPositions.RIGHT,
|
|
294
|
+
Tools.getProperty(axesOptions, AxisPositions.RIGHT, 'main') ===
|
|
295
295
|
true ||
|
|
296
296
|
(dualAxes &&
|
|
297
|
-
Tools.getProperty(axesOptions, AxisPositions.LEFT,
|
|
297
|
+
Tools.getProperty(axesOptions, AxisPositions.LEFT, 'correspondingDatasets'))) {
|
|
298
298
|
return {
|
|
299
299
|
primary: AxisPositions.RIGHT,
|
|
300
|
-
secondary: AxisPositions.LEFT
|
|
300
|
+
secondary: AxisPositions.LEFT,
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
303
|
return { primary: AxisPositions.LEFT, secondary: AxisPositions.RIGHT };
|
|
304
304
|
};
|
|
305
305
|
CartesianScales.prototype.findHorizontalAxesPositions = function () {
|
|
306
306
|
var options = this.model.getOptions();
|
|
307
|
-
var axesOptions = Tools.getProperty(options,
|
|
307
|
+
var axesOptions = Tools.getProperty(options, 'axes');
|
|
308
308
|
var dualAxes = this.isDualAxes();
|
|
309
309
|
// If top axis has been specified as `main`
|
|
310
310
|
if ((Tools.getProperty(axesOptions, AxisPositions.BOTTOM) === null &&
|
|
311
311
|
Tools.getProperty(axesOptions, AxisPositions.TOP) !== null) ||
|
|
312
|
-
Tools.getProperty(axesOptions, AxisPositions.TOP,
|
|
312
|
+
Tools.getProperty(axesOptions, AxisPositions.TOP, 'main') ===
|
|
313
313
|
true ||
|
|
314
314
|
(dualAxes &&
|
|
315
|
-
Tools.getProperty(axesOptions, AxisPositions.BOTTOM,
|
|
315
|
+
Tools.getProperty(axesOptions, AxisPositions.BOTTOM, 'correspondingDatasets'))) {
|
|
316
316
|
return {
|
|
317
317
|
primary: AxisPositions.TOP,
|
|
318
|
-
secondary: AxisPositions.BOTTOM
|
|
318
|
+
secondary: AxisPositions.BOTTOM,
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
321
|
return { primary: AxisPositions.BOTTOM, secondary: AxisPositions.TOP };
|
|
322
322
|
};
|
|
323
323
|
CartesianScales.prototype.findDomainAndRangeAxesPositions = function (verticalAxesPositions, horizontalAxesPositions) {
|
|
324
324
|
var options = this.model.getOptions();
|
|
325
|
-
var mainVerticalAxisOptions = Tools.getProperty(options,
|
|
326
|
-
var mainHorizontalAxisOptions = Tools.getProperty(options,
|
|
325
|
+
var mainVerticalAxisOptions = Tools.getProperty(options, 'axes', verticalAxesPositions.primary);
|
|
326
|
+
var mainHorizontalAxisOptions = Tools.getProperty(options, 'axes', horizontalAxesPositions.primary);
|
|
327
327
|
var mainVerticalScaleType = mainVerticalAxisOptions.scaleType || ScaleTypes.LINEAR;
|
|
328
328
|
var mainHorizontalScaleType = mainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR;
|
|
329
329
|
var result = {
|
|
330
330
|
primaryDomainAxisPosition: null,
|
|
331
331
|
secondaryDomainAxisPosition: null,
|
|
332
332
|
primaryRangeAxisPosition: null,
|
|
333
|
-
secondaryRangeAxisPosition: null
|
|
333
|
+
secondaryRangeAxisPosition: null,
|
|
334
334
|
};
|
|
335
335
|
// assign to to be a vertical chart by default
|
|
336
336
|
result.primaryDomainAxisPosition = horizontalAxesPositions.primary;
|
|
@@ -356,10 +356,10 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
356
356
|
};
|
|
357
357
|
CartesianScales.prototype.getScaleDomain = function (axisPosition) {
|
|
358
358
|
var options = this.model.getOptions();
|
|
359
|
-
var axisOptions = Tools.getProperty(options,
|
|
360
|
-
var bounds = Tools.getProperty(options,
|
|
359
|
+
var axisOptions = Tools.getProperty(options, 'axes', axisPosition);
|
|
360
|
+
var bounds = Tools.getProperty(options, 'bounds');
|
|
361
361
|
var includeZero = axisOptions.includeZero;
|
|
362
|
-
var scaleType = Tools.getProperty(axisOptions,
|
|
362
|
+
var scaleType = Tools.getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR;
|
|
363
363
|
if (this.model.isDataEmpty()) {
|
|
364
364
|
return [];
|
|
365
365
|
}
|
|
@@ -389,14 +389,10 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
389
389
|
// Get the extent of the domain
|
|
390
390
|
var domain;
|
|
391
391
|
var allDataValues;
|
|
392
|
-
var
|
|
392
|
+
var dataGroupNames = this.model.getDataGroupNames();
|
|
393
393
|
if (scaleType === ScaleTypes.TIME) {
|
|
394
394
|
allDataValues = displayData.map(function (datum) { return +new Date(datum[mapsTo]); });
|
|
395
395
|
}
|
|
396
|
-
else if (scaleType === ScaleTypes.TIME) {
|
|
397
|
-
allDataValues = displayData.map(function (datum) { return datum[mapsTo]; });
|
|
398
|
-
// If the scale has bounded area
|
|
399
|
-
}
|
|
400
396
|
else if (bounds && options.axes) {
|
|
401
397
|
allDataValues = [];
|
|
402
398
|
displayData.forEach(function (datum) {
|
|
@@ -409,11 +405,12 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
409
405
|
}
|
|
410
406
|
});
|
|
411
407
|
}
|
|
412
|
-
else if (
|
|
408
|
+
else if (axisOptions.stacked === true &&
|
|
409
|
+
dataGroupNames &&
|
|
413
410
|
axisPosition === this.getRangeAxisPosition()) {
|
|
414
411
|
var groupMapsTo_1 = options.data.groupMapsTo;
|
|
415
|
-
var dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys(
|
|
416
|
-
var nonStackedGroupsData = displayData.filter(function (datum) { return !
|
|
412
|
+
var dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys(dataGroupNames);
|
|
413
|
+
var nonStackedGroupsData = displayData.filter(function (datum) { return !dataGroupNames.includes(datum[groupMapsTo_1]); });
|
|
417
414
|
var stackedValues = dataValuesGroupedByKeys.map(function (dataValues) {
|
|
418
415
|
var sharedStackKey = dataValues.sharedStackKey, numericalValues = __rest(dataValues, ["sharedStackKey"]);
|
|
419
416
|
return sum(values(numericalValues));
|
|
@@ -432,11 +429,11 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
432
429
|
};
|
|
433
430
|
CartesianScales.prototype.createScale = function (axisPosition) {
|
|
434
431
|
var options = this.model.getOptions();
|
|
435
|
-
var axisOptions = Tools.getProperty(options,
|
|
432
|
+
var axisOptions = Tools.getProperty(options, 'axes', axisPosition);
|
|
436
433
|
if (!axisOptions) {
|
|
437
434
|
return null;
|
|
438
435
|
}
|
|
439
|
-
var scaleType = Tools.getProperty(axisOptions,
|
|
436
|
+
var scaleType = Tools.getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR;
|
|
440
437
|
this.scaleTypes[axisPosition] = scaleType;
|
|
441
438
|
var scale;
|
|
442
439
|
if (scaleType === ScaleTypes.TIME) {
|
|
@@ -455,7 +452,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
455
452
|
return scale;
|
|
456
453
|
};
|
|
457
454
|
CartesianScales.prototype.getHighestDomainThreshold = function () {
|
|
458
|
-
var axesOptions = Tools.getProperty(this.model.getOptions(),
|
|
455
|
+
var axesOptions = Tools.getProperty(this.model.getOptions(), 'axes');
|
|
459
456
|
var domainAxisPosition = this.getDomainAxisPosition();
|
|
460
457
|
var thresholds = axesOptions[domainAxisPosition].thresholds;
|
|
461
458
|
if (!thresholds) {
|
|
@@ -466,17 +463,17 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
466
463
|
var highestThreshold = thresholds.sort(function (a, b) { return b.value - a.value; })[0];
|
|
467
464
|
var scaleType = this.getScaleTypeByPosition(domainAxisPosition);
|
|
468
465
|
if (scaleType === ScaleTypes.TIME &&
|
|
469
|
-
(typeof highestThreshold.value ===
|
|
466
|
+
(typeof highestThreshold.value === 'string' ||
|
|
470
467
|
highestThreshold.value.getTime === undefined)) {
|
|
471
468
|
highestThreshold.value = new Date(highestThreshold.value);
|
|
472
469
|
}
|
|
473
470
|
return {
|
|
474
471
|
threshold: highestThreshold,
|
|
475
|
-
scaleValue: domainScale(highestThreshold.value)
|
|
472
|
+
scaleValue: domainScale(highestThreshold.value),
|
|
476
473
|
};
|
|
477
474
|
};
|
|
478
475
|
CartesianScales.prototype.getHighestRangeThreshold = function () {
|
|
479
|
-
var axesOptions = Tools.getProperty(this.model.getOptions(),
|
|
476
|
+
var axesOptions = Tools.getProperty(this.model.getOptions(), 'axes');
|
|
480
477
|
var rangeAxisPosition = this.getRangeAxisPosition();
|
|
481
478
|
var thresholds = axesOptions[rangeAxisPosition].thresholds;
|
|
482
479
|
if (!thresholds) {
|
|
@@ -487,7 +484,7 @@ var CartesianScales = /** @class */ (function (_super) {
|
|
|
487
484
|
var highestThreshold = thresholds.sort(function (a, b) { return b.value - a.value; })[0];
|
|
488
485
|
return {
|
|
489
486
|
threshold: highestThreshold,
|
|
490
|
-
scaleValue: rangeScale(highestThreshold.value)
|
|
487
|
+
scaleValue: rangeScale(highestThreshold.value),
|
|
491
488
|
};
|
|
492
489
|
};
|
|
493
490
|
return CartesianScales;
|
|
@@ -499,49 +496,49 @@ function addSpacingToTimeDomain(domain, spaceToAddToEdges) {
|
|
|
499
496
|
if (differenceInYears(endDate, startDate) > 1) {
|
|
500
497
|
return [
|
|
501
498
|
subYears(startDate, spaceToAddToEdges),
|
|
502
|
-
addYears(endDate, spaceToAddToEdges)
|
|
499
|
+
addYears(endDate, spaceToAddToEdges),
|
|
503
500
|
];
|
|
504
501
|
}
|
|
505
502
|
if (differenceInMonths(endDate, startDate) > 1) {
|
|
506
503
|
return [
|
|
507
504
|
subMonths(startDate, spaceToAddToEdges),
|
|
508
|
-
addMonths(endDate, spaceToAddToEdges)
|
|
505
|
+
addMonths(endDate, spaceToAddToEdges),
|
|
509
506
|
];
|
|
510
507
|
}
|
|
511
508
|
if (differenceInDays(endDate, startDate) > 1) {
|
|
512
509
|
return [
|
|
513
510
|
subDays(startDate, spaceToAddToEdges),
|
|
514
|
-
addDays(endDate, spaceToAddToEdges)
|
|
511
|
+
addDays(endDate, spaceToAddToEdges),
|
|
515
512
|
];
|
|
516
513
|
}
|
|
517
514
|
if (differenceInHours(endDate, startDate) > 1) {
|
|
518
515
|
return [
|
|
519
516
|
subHours(startDate, spaceToAddToEdges),
|
|
520
|
-
addHours(endDate, spaceToAddToEdges)
|
|
517
|
+
addHours(endDate, spaceToAddToEdges),
|
|
521
518
|
];
|
|
522
519
|
}
|
|
523
520
|
if (differenceInMinutes(endDate, startDate) > 30) {
|
|
524
521
|
return [
|
|
525
522
|
subMinutes(startDate, spaceToAddToEdges * 30),
|
|
526
|
-
addMinutes(endDate, spaceToAddToEdges * 30)
|
|
523
|
+
addMinutes(endDate, spaceToAddToEdges * 30),
|
|
527
524
|
];
|
|
528
525
|
}
|
|
529
526
|
if (differenceInMinutes(endDate, startDate) > 1) {
|
|
530
527
|
return [
|
|
531
528
|
subMinutes(startDate, spaceToAddToEdges),
|
|
532
|
-
addMinutes(endDate, spaceToAddToEdges)
|
|
529
|
+
addMinutes(endDate, spaceToAddToEdges),
|
|
533
530
|
];
|
|
534
531
|
}
|
|
535
532
|
if (differenceInSeconds(endDate, startDate) > 15) {
|
|
536
533
|
return [
|
|
537
534
|
subSeconds(startDate, spaceToAddToEdges * 15),
|
|
538
|
-
addSeconds(endDate, spaceToAddToEdges * 15)
|
|
535
|
+
addSeconds(endDate, spaceToAddToEdges * 15),
|
|
539
536
|
];
|
|
540
537
|
}
|
|
541
538
|
if (differenceInSeconds(endDate, startDate) > 1) {
|
|
542
539
|
return [
|
|
543
540
|
subSeconds(startDate, spaceToAddToEdges),
|
|
544
|
-
addSeconds(endDate, spaceToAddToEdges)
|
|
541
|
+
addSeconds(endDate, spaceToAddToEdges),
|
|
545
542
|
];
|
|
546
543
|
}
|
|
547
544
|
return [startDate, endDate];
|