@amcharts/amcharts5 5.11.3 → 5.12.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/.internal/charts/stock/toolbar/DrawingControl.d.ts.map +1 -1
- package/.internal/charts/stock/toolbar/DrawingControl.js +5 -2
- package/.internal/charts/stock/toolbar/DrawingControl.js.map +1 -1
- package/.internal/charts/timeline/AxisRendererCurveX.d.ts +132 -0
- package/.internal/charts/timeline/AxisRendererCurveX.d.ts.map +1 -0
- package/.internal/charts/timeline/AxisRendererCurveX.js +537 -0
- package/.internal/charts/timeline/AxisRendererCurveX.js.map +1 -0
- package/.internal/charts/timeline/AxisRendererCurveY.d.ts +132 -0
- package/.internal/charts/timeline/AxisRendererCurveY.d.ts.map +1 -0
- package/.internal/charts/timeline/AxisRendererCurveY.js +308 -0
- package/.internal/charts/timeline/AxisRendererCurveY.js.map +1 -0
- package/.internal/charts/timeline/CurveChart.d.ts +63 -0
- package/.internal/charts/timeline/CurveChart.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveChart.js +126 -0
- package/.internal/charts/timeline/CurveChart.js.map +1 -0
- package/.internal/charts/timeline/CurveColumnSeries.d.ts +66 -0
- package/.internal/charts/timeline/CurveColumnSeries.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveColumnSeries.js +163 -0
- package/.internal/charts/timeline/CurveColumnSeries.js.map +1 -0
- package/.internal/charts/timeline/CurveCursor.d.ts +61 -0
- package/.internal/charts/timeline/CurveCursor.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveCursor.js +134 -0
- package/.internal/charts/timeline/CurveCursor.js.map +1 -0
- package/.internal/charts/timeline/CurveDefaultTheme.d.ts +8 -0
- package/.internal/charts/timeline/CurveDefaultTheme.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveDefaultTheme.js +72 -0
- package/.internal/charts/timeline/CurveDefaultTheme.js.map +1 -0
- package/.internal/charts/timeline/CurveLineSeries.d.ts +40 -0
- package/.internal/charts/timeline/CurveLineSeries.d.ts.map +1 -0
- package/.internal/charts/timeline/CurveLineSeries.js +101 -0
- package/.internal/charts/timeline/CurveLineSeries.js.map +1 -0
- package/.internal/charts/timeline/SerpentineChart.d.ts +60 -0
- package/.internal/charts/timeline/SerpentineChart.d.ts.map +1 -0
- package/.internal/charts/timeline/SerpentineChart.js +146 -0
- package/.internal/charts/timeline/SerpentineChart.js.map +1 -0
- package/.internal/charts/timeline/SpiralChart.d.ts +60 -0
- package/.internal/charts/timeline/SpiralChart.d.ts.map +1 -0
- package/.internal/charts/timeline/SpiralChart.js +58 -0
- package/.internal/charts/timeline/SpiralChart.js.map +1 -0
- package/.internal/core/Classes.d.ts +16 -0
- package/.internal/core/Classes.d.ts.map +1 -1
- package/.internal/core/Classes.js.map +1 -1
- package/.internal/core/Registry.js +1 -1
- package/.internal/core/Registry.js.map +1 -1
- package/.internal/core/render/SerialChart.d.ts.map +1 -1
- package/.internal/core/render/SerialChart.js +12 -0
- package/.internal/core/render/SerialChart.js.map +1 -1
- package/.internal/core/util/List.d.ts +12 -0
- package/.internal/core/util/List.d.ts.map +1 -1
- package/.internal/core/util/List.js +23 -2
- package/.internal/core/util/List.js.map +1 -1
- package/.internal/core/util/Math.d.ts.map +1 -1
- package/.internal/core/util/Math.js +12 -5
- package/.internal/core/util/Math.js.map +1 -1
- package/.internal/plugins/json/Classes-script.d.ts +16 -0
- package/.internal/plugins/json/Classes-script.d.ts.map +1 -1
- package/.internal/plugins/json/Classes-script.js +8 -0
- package/.internal/plugins/json/Classes-script.js.map +1 -1
- package/.internal/plugins/json/Classes.d.ts +16 -0
- package/.internal/plugins/json/Classes.d.ts.map +1 -1
- package/.internal/plugins/json/Classes.js +8 -0
- package/.internal/plugins/json/Classes.js.map +1 -1
- package/CHANGELOG.md +20 -0
- package/examples/javascript/flow-arc-horizontal/package.json +1 -1
- package/examples/javascript/flow-arc-vertical/package.json +1 -1
- package/examples/javascript/flow-chord/package.json +1 -1
- package/examples/javascript/flow-chord-directed/package.json +1 -1
- package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/javascript/flow-sankey/package.json +1 -1
- package/examples/javascript/gauge/package.json +1 -1
- package/examples/javascript/gauge-bands/package.json +1 -1
- package/examples/javascript/hierarchy-force-directed/package.json +1 -1
- package/examples/javascript/hierarchy-pack/package.json +1 -1
- package/examples/javascript/hierarchy-partition/package.json +1 -1
- package/examples/javascript/hierarchy-sunburst/package.json +1 -1
- package/examples/javascript/hierarchy-tree/package.json +1 -1
- package/examples/javascript/hierarchy-treemap/package.json +1 -1
- package/examples/javascript/hierarchy-voronoi-treemap/package.json +1 -1
- package/examples/javascript/jest/package.json +1 -1
- package/examples/javascript/json-pie/package.json +1 -1
- package/examples/javascript/json-xy/package.json +1 -1
- package/examples/javascript/map-animating-along-lines/package.json +1 -1
- package/examples/javascript/map-clustered-points/package.json +1 -1
- package/examples/javascript/map-day-and-night/package.json +1 -1
- package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/javascript/map-with-bubbles/package.json +1 -1
- package/examples/javascript/map-zoom-to-country/package.json +1 -1
- package/examples/javascript/misc-40-charts/package.json +1 -1
- package/examples/javascript/misc-microchart-grid/package.json +1 -1
- package/examples/javascript/pie-chart/package.json +1 -1
- package/examples/javascript/pie-donut-chart/package.json +1 -1
- package/examples/javascript/pie-variable-radius/package.json +1 -1
- package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
- package/examples/javascript/radar-heat-map/package.json +1 -1
- package/examples/javascript/radar-line/package.json +1 -1
- package/examples/javascript/radar-time-line/package.json +1 -1
- package/examples/javascript/sliced-funnel/package.json +1 -1
- package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/javascript/sliced-pyramid/package.json +1 -1
- package/examples/javascript/stock-chart/package.json +1 -1
- package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
- package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
- package/examples/javascript/stock-chart-intraday/package.json +1 -1
- package/examples/javascript/stock-chart-live/package.json +1 -1
- package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/javascript/timeline-horizontal-serpentine-chart/README.md +6 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/index.css +11 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/index.html +12 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/index.js +268 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/package.json +16 -0
- package/examples/javascript/timeline-horizontal-serpentine-chart/webpack.config.js +38 -0
- package/examples/javascript/timeline-linear-process-diagram/README.md +6 -0
- package/examples/javascript/timeline-linear-process-diagram/index.css +11 -0
- package/examples/javascript/timeline-linear-process-diagram/index.html +12 -0
- package/examples/javascript/timeline-linear-process-diagram/index.js +365 -0
- package/examples/javascript/timeline-linear-process-diagram/package.json +16 -0
- package/examples/javascript/timeline-linear-process-diagram/webpack.config.js +38 -0
- package/examples/javascript/timeline-serpentine-chart/README.md +6 -0
- package/examples/javascript/timeline-serpentine-chart/index.css +11 -0
- package/examples/javascript/timeline-serpentine-chart/index.html +12 -0
- package/examples/javascript/timeline-serpentine-chart/index.js +274 -0
- package/examples/javascript/timeline-serpentine-chart/package.json +16 -0
- package/examples/javascript/timeline-serpentine-chart/webpack.config.js +38 -0
- package/examples/javascript/timeline-spiral-chart/README.md +6 -0
- package/examples/javascript/timeline-spiral-chart/index.css +11 -0
- package/examples/javascript/timeline-spiral-chart/index.html +12 -0
- package/examples/javascript/timeline-spiral-chart/index.js +274 -0
- package/examples/javascript/timeline-spiral-chart/package.json +16 -0
- package/examples/javascript/timeline-spiral-chart/webpack.config.js +38 -0
- package/examples/javascript/venn-diagram/package.json +1 -1
- package/examples/javascript/wordcloud-with-data/package.json +1 -1
- package/examples/javascript/wordcloud-with-text/package.json +1 -1
- package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/javascript/xy-bubble/package.json +1 -1
- package/examples/javascript/xy-candlestick/package.json +1 -1
- package/examples/javascript/xy-clustered-column/package.json +1 -1
- package/examples/javascript/xy-column/package.json +1 -1
- package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/javascript/xy-data-grouping/package.json +1 -1
- package/examples/javascript/xy-draggable-range/package.json +1 -1
- package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/javascript/xy-dumbbell plot/package.json +1 -1
- package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/javascript/xy-line/package.json +1 -1
- package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/javascript/xy-live-data/package.json +1 -1
- package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/javascript/xy-ohlc/package.json +1 -1
- package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/javascript/xy-smoothed-line/package.json +1 -1
- package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/javascript/xy-stacked-column/package.json +1 -1
- package/examples/javascript/xy-stacked-step/package.json +1 -1
- package/examples/javascript/xy-stock/package.json +1 -1
- package/examples/javascript/xy-stock-comparing/package.json +1 -1
- package/examples/typescript/flow-arc-horizontal/package.json +1 -1
- package/examples/typescript/flow-arc-vertical/package.json +1 -1
- package/examples/typescript/flow-chord/package.json +1 -1
- package/examples/typescript/flow-chord-directed/package.json +1 -1
- package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/typescript/flow-sankey/package.json +1 -1
- package/examples/typescript/gauge/package.json +1 -1
- package/examples/typescript/gauge-bands/package.json +1 -1
- package/examples/typescript/hierarchy-force-directed/package.json +1 -1
- package/examples/typescript/hierarchy-pack/package.json +1 -1
- package/examples/typescript/hierarchy-partition/package.json +1 -1
- package/examples/typescript/hierarchy-sunburst/package.json +1 -1
- package/examples/typescript/hierarchy-tree/package.json +1 -1
- package/examples/typescript/hierarchy-treemap/package.json +1 -1
- package/examples/typescript/hierarchy-voronoi-treemap/package.json +1 -1
- package/examples/typescript/jest/package.json +1 -1
- package/examples/typescript/json-pie/package.json +1 -1
- package/examples/typescript/json-xy/package.json +1 -1
- package/examples/typescript/map-animating-along-lines/package.json +1 -1
- package/examples/typescript/map-clustered-points/package.json +1 -1
- package/examples/typescript/map-day-and-night/package.json +1 -1
- package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/typescript/map-with-bubbles/package.json +1 -1
- package/examples/typescript/map-zoom-to-country/package.json +1 -1
- package/examples/typescript/misc-40-charts/package.json +1 -1
- package/examples/typescript/misc-microchart-grid/package.json +1 -1
- package/examples/typescript/pie-chart/package.json +1 -1
- package/examples/typescript/pie-donut-chart/package.json +1 -1
- package/examples/typescript/pie-variable-radius/package.json +1 -1
- package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
- package/examples/typescript/radar-heat-map/package.json +1 -1
- package/examples/typescript/radar-line/package.json +1 -1
- package/examples/typescript/radar-time-line/package.json +1 -1
- package/examples/typescript/sliced-funnel/package.json +1 -1
- package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/typescript/sliced-pyramid/package.json +1 -1
- package/examples/typescript/stock-chart/package.json +1 -1
- package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
- package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
- package/examples/typescript/stock-chart-intraday/package.json +1 -1
- package/examples/typescript/stock-chart-live/package.json +1 -1
- package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/typescript/timeline-horizontal-serpentine-chart/README.md +6 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/index.css +11 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/index.html +12 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/index.ts +268 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/package.json +18 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/tsconfig.json +12 -0
- package/examples/typescript/timeline-horizontal-serpentine-chart/webpack.config.js +45 -0
- package/examples/typescript/timeline-linear-process-diagram/README.md +6 -0
- package/examples/typescript/timeline-linear-process-diagram/index.css +11 -0
- package/examples/typescript/timeline-linear-process-diagram/index.html +12 -0
- package/examples/typescript/timeline-linear-process-diagram/index.ts +365 -0
- package/examples/typescript/timeline-linear-process-diagram/package.json +18 -0
- package/examples/typescript/timeline-linear-process-diagram/tsconfig.json +12 -0
- package/examples/typescript/timeline-linear-process-diagram/webpack.config.js +45 -0
- package/examples/typescript/timeline-serpentine-chart/README.md +6 -0
- package/examples/typescript/timeline-serpentine-chart/index.css +11 -0
- package/examples/typescript/timeline-serpentine-chart/index.html +12 -0
- package/examples/typescript/timeline-serpentine-chart/index.ts +274 -0
- package/examples/typescript/timeline-serpentine-chart/package.json +18 -0
- package/examples/typescript/timeline-serpentine-chart/tsconfig.json +12 -0
- package/examples/typescript/timeline-serpentine-chart/webpack.config.js +45 -0
- package/examples/typescript/timeline-spiral-chart/README.md +6 -0
- package/examples/typescript/timeline-spiral-chart/index.css +11 -0
- package/examples/typescript/timeline-spiral-chart/index.html +12 -0
- package/examples/typescript/timeline-spiral-chart/index.ts +274 -0
- package/examples/typescript/timeline-spiral-chart/package.json +18 -0
- package/examples/typescript/timeline-spiral-chart/tsconfig.json +12 -0
- package/examples/typescript/timeline-spiral-chart/webpack.config.js +45 -0
- package/examples/typescript/venn-diagram/package.json +1 -1
- package/examples/typescript/wordcloud-with-data/package.json +1 -1
- package/examples/typescript/wordcloud-with-text/package.json +1 -1
- package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/typescript/xy-bubble/package.json +1 -1
- package/examples/typescript/xy-candlestick/package.json +1 -1
- package/examples/typescript/xy-clustered-column/package.json +1 -1
- package/examples/typescript/xy-column/package.json +1 -1
- package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/typescript/xy-data-grouping/package.json +1 -1
- package/examples/typescript/xy-draggable-range/package.json +1 -1
- package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/typescript/xy-dumbbell plot/package.json +1 -1
- package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/typescript/xy-line/package.json +1 -1
- package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/typescript/xy-live-data/package.json +1 -1
- package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/typescript/xy-ohlc/package.json +1 -1
- package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/typescript/xy-smoothed-line/package.json +1 -1
- package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/typescript/xy-stacked-column/package.json +1 -1
- package/examples/typescript/xy-stacked-step/package.json +1 -1
- package/examples/typescript/xy-stock/package.json +1 -1
- package/examples/typescript/xy-stock-comparing/package.json +1 -1
- package/package.json +1 -1
- package/timeline.d.ts +11 -0
- package/timeline.d.ts.map +1 -0
- package/timeline.js +11 -0
- package/timeline.js.map +1 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Theme } from "../../core/Theme";
|
|
2
|
+
import { percent } from "../../core/util/Percent";
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
export class CurveDefaultTheme extends Theme {
|
|
7
|
+
setupDefaultRules() {
|
|
8
|
+
super.setupDefaultRules();
|
|
9
|
+
const r = this.rule.bind(this);
|
|
10
|
+
/**
|
|
11
|
+
* ========================================================================
|
|
12
|
+
* charts/timeline
|
|
13
|
+
* ========================================================================
|
|
14
|
+
*/
|
|
15
|
+
r("SpiralChart").setAll({
|
|
16
|
+
levelCount: 3,
|
|
17
|
+
endAngle: 0,
|
|
18
|
+
startAngle: -90,
|
|
19
|
+
yAxisRadius: percent(60),
|
|
20
|
+
innerRadius: percent(20)
|
|
21
|
+
});
|
|
22
|
+
r("SerpentineChart").setAll({
|
|
23
|
+
levelCount: 3,
|
|
24
|
+
orientation: "vertical",
|
|
25
|
+
startLocation: 0,
|
|
26
|
+
endLocation: 1
|
|
27
|
+
});
|
|
28
|
+
r("CurveColumnSeries").setAll({
|
|
29
|
+
clustered: true
|
|
30
|
+
});
|
|
31
|
+
r("Slice", ["curve", "column", "series"]).setAll({
|
|
32
|
+
width: percent(50),
|
|
33
|
+
height: percent(50)
|
|
34
|
+
});
|
|
35
|
+
r("AxisRendererCurveY").setAll({
|
|
36
|
+
minGridDistance: 20,
|
|
37
|
+
inversed: false,
|
|
38
|
+
cellStartLocation: 0,
|
|
39
|
+
cellEndLocation: 1,
|
|
40
|
+
rotateLabels: false,
|
|
41
|
+
axisLocation: 0.5,
|
|
42
|
+
axisLength: 60
|
|
43
|
+
});
|
|
44
|
+
r("AxisRendererCurveX").setAll({
|
|
45
|
+
minGridDistance: 100,
|
|
46
|
+
inversed: false,
|
|
47
|
+
cellStartLocation: 0,
|
|
48
|
+
cellEndLocation: 1,
|
|
49
|
+
rotateLabels: false
|
|
50
|
+
});
|
|
51
|
+
r("RadialLabel", ["circular"]).setAll({
|
|
52
|
+
textType: "circular",
|
|
53
|
+
paddingTop: 1,
|
|
54
|
+
paddingRight: 0,
|
|
55
|
+
paddingBottom: 1,
|
|
56
|
+
paddingLeft: 0,
|
|
57
|
+
centerX: 0,
|
|
58
|
+
centerY: 0,
|
|
59
|
+
radius: 8
|
|
60
|
+
});
|
|
61
|
+
r("AxisLabelRadial", ["category"]).setAll({
|
|
62
|
+
text: "{category}",
|
|
63
|
+
populateText: true
|
|
64
|
+
});
|
|
65
|
+
r("RadialLabel", ["radial"]).setAll({
|
|
66
|
+
textType: "regular",
|
|
67
|
+
centerX: 0,
|
|
68
|
+
textAlign: "right"
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=CurveDefaultTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurveDefaultTheme.js","sourceRoot":"","sources":["../../../../../src/.internal/charts/timeline/CurveDefaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGlD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACjC,iBAAiB;QAC1B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAG/B;;;;WAIG;QAEH,CAAC,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC;YACvB,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,CAAC;YACX,UAAU,EAAE,CAAC,EAAE;YACf,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;YACxB,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;SACxB,CAAC,CAAC;QAEH,CAAC,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC;YAC3B,UAAU,EAAE,CAAC;YACb,WAAW,EAAE,UAAU;YACvB,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;SACd,CAAC,CAAC;QAEH,CAAC,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC;YAC7B,SAAS,EAAE,IAAI;SACf,CAAC,CAAC;QAEH,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;YAChD,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;YAClB,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;SACnB,CAAC,CAAC;QAEH,CAAC,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC;YAC9B,eAAe,EAAE,EAAE;YACnB,QAAQ,EAAE,KAAK;YACf,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,KAAK;YACnB,YAAY,EAAE,GAAG;YACjB,UAAU,EAAE,EAAE;SACd,CAAC,CAAC;QAEH,CAAC,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC;YAC9B,eAAe,EAAE,GAAG;YACpB,QAAQ,EAAE,KAAK;YACf,iBAAiB,EAAE,CAAC;YACpB,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,KAAK;SACnB,CAAC,CAAC;QAEH,CAAC,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;YACrC,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,CAAC;YACb,YAAY,EAAE,CAAC;YACf,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;YACd,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,CAAC;SACT,CAAC,CAAC;QAGH,CAAC,CAAC,iBAAiB,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;YACzC,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE,IAAI;SAClB,CAAC,CAAC;QAEH,CAAC,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,OAAO;SAClB,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { Theme } from \"../../core/Theme\";\r\nimport { percent } from \"../../core/util/Percent\";\r\n\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport class CurveDefaultTheme extends Theme {\r\n\tprotected setupDefaultRules() {\r\n\t\tsuper.setupDefaultRules();\r\n\r\n\t\tconst r = this.rule.bind(this);\r\n\r\n\r\n\t\t/**\r\n\t\t * ========================================================================\r\n\t\t * charts/timeline\r\n\t\t * ========================================================================\r\n\t\t */\r\n\r\n\t\tr(\"SpiralChart\").setAll({\r\n\t\t\tlevelCount: 3,\r\n\t\t\tendAngle: 0,\r\n\t\t\tstartAngle: -90,\r\n\t\t\tyAxisRadius: percent(60),\r\n\t\t\tinnerRadius: percent(20)\r\n\t\t});\r\n\r\n\t\tr(\"SerpentineChart\").setAll({\r\n\t\t\tlevelCount: 3,\r\n\t\t\torientation: \"vertical\",\r\n\t\t\tstartLocation: 0,\r\n\t\t\tendLocation: 1\r\n\t\t});\r\n\r\n\t\tr(\"CurveColumnSeries\").setAll({\r\n\t\t\tclustered: true\r\n\t\t});\r\n\r\n\t\tr(\"Slice\", [\"curve\", \"column\", \"series\"]).setAll({\r\n\t\t\twidth: percent(50),\r\n\t\t\theight: percent(50)\r\n\t\t});\r\n\r\n\t\tr(\"AxisRendererCurveY\").setAll({\r\n\t\t\tminGridDistance: 20,\r\n\t\t\tinversed: false,\r\n\t\t\tcellStartLocation: 0,\r\n\t\t\tcellEndLocation: 1,\r\n\t\t\trotateLabels: false,\r\n\t\t\taxisLocation: 0.5,\r\n\t\t\taxisLength: 60\r\n\t\t});\r\n\r\n\t\tr(\"AxisRendererCurveX\").setAll({\r\n\t\t\tminGridDistance: 100,\r\n\t\t\tinversed: false,\r\n\t\t\tcellStartLocation: 0,\r\n\t\t\tcellEndLocation: 1,\r\n\t\t\trotateLabels: false\r\n\t\t});\r\n\r\n\t\tr(\"RadialLabel\", [\"circular\"]).setAll({\r\n\t\t\ttextType: \"circular\",\r\n\t\t\tpaddingTop: 1,\r\n\t\t\tpaddingRight: 0,\r\n\t\t\tpaddingBottom: 1,\r\n\t\t\tpaddingLeft: 0,\r\n\t\t\tcenterX: 0,\r\n\t\t\tcenterY: 0,\r\n\t\t\tradius: 8\r\n\t\t});\r\n\r\n\r\n\t\tr(\"AxisLabelRadial\", [\"category\"]).setAll({\r\n\t\t\ttext: \"{category}\",\r\n\t\t\tpopulateText: true\r\n\t\t});\r\n\r\n\t\tr(\"RadialLabel\", [\"radial\"]).setAll({\r\n\t\t\ttextType: \"regular\",\r\n\t\t\tcenterX: 0,\r\n\t\t\ttextAlign: \"right\"\r\n\t\t});\r\n\t}\r\n}\r\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IPoint } from "../../core/util/IPoint";
|
|
2
|
+
import type { Bullet } from "../../core/render/Bullet";
|
|
3
|
+
import type { CurveChart } from "./CurveChart";
|
|
4
|
+
import { LineSeries, ILineSeriesPrivate, ILineSeriesSettings, ILineSeriesDataItem, ILineSeriesAxisRange } from "../xy/series/LineSeries";
|
|
5
|
+
export interface ICurveLineSeriesDataItem extends ILineSeriesDataItem {
|
|
6
|
+
}
|
|
7
|
+
export interface ICurveLineSeriesSettings extends ILineSeriesSettings {
|
|
8
|
+
}
|
|
9
|
+
export interface ICurveLineSeriesPrivate extends ILineSeriesPrivate {
|
|
10
|
+
}
|
|
11
|
+
export interface ICurveLineSeriesAxisRange extends ILineSeriesAxisRange {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A line series for use in a [[CurveChart]], [[SerpetineChart]], or
|
|
15
|
+
* a [[SpiralChart]].
|
|
16
|
+
*
|
|
17
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info
|
|
18
|
+
* @since 5.12.0
|
|
19
|
+
* @important
|
|
20
|
+
*/
|
|
21
|
+
export declare class CurveLineSeries extends LineSeries {
|
|
22
|
+
_settings: ICurveLineSeriesSettings;
|
|
23
|
+
_privateSettings: ICurveLineSeriesPrivate;
|
|
24
|
+
_dataItemSettings: ICurveLineSeriesDataItem;
|
|
25
|
+
_axisRangeType: ICurveLineSeriesAxisRange;
|
|
26
|
+
/**
|
|
27
|
+
* A chart series belongs to.
|
|
28
|
+
*/
|
|
29
|
+
chart: CurveChart | undefined;
|
|
30
|
+
static className: string;
|
|
31
|
+
static classNames: Array<string>;
|
|
32
|
+
protected _afterNew(): void;
|
|
33
|
+
protected _handleMaskBullets(): void;
|
|
34
|
+
_updateChildren(): void;
|
|
35
|
+
getPoint(positionX: number, positionY: number): IPoint;
|
|
36
|
+
protected _shouldInclude(position: number): boolean;
|
|
37
|
+
protected _shouldShowBullet(positionX: number, _positionY: number): boolean;
|
|
38
|
+
_positionBullet(bullet: Bullet): void;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=CurveLineSeries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurveLineSeries.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/charts/timeline/CurveLineSeries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAGzI,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;CACpE;AAED,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;CACpE;AAED,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;CAClE;AAED,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;CACtE;AAED;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAE/B,SAAS,EAAE,wBAAwB,CAAC;IACpC,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,cAAc,EAAE,yBAAyB,CAAC;IAEzD;;OAEG;IACY,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;IAE7C,OAAc,SAAS,EAAE,MAAM,CAAqB;IACpD,OAAc,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAA6D;IAEpG,SAAS,CAAC,SAAS;IAOnB,SAAS,CAAC,kBAAkB;IAIrB,eAAe,IAAI,IAAI;IAOvB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAM7D,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAQnD,SAAS,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAQpE,eAAe,CAAC,MAAM,EAAE,MAAM;CAsDrC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Graphics } from "../../core/render/Graphics";
|
|
2
|
+
import { LineSeries } from "../xy/series/LineSeries";
|
|
3
|
+
/**
|
|
4
|
+
* A line series for use in a [[CurveChart]], [[SerpetineChart]], or
|
|
5
|
+
* a [[SpiralChart]].
|
|
6
|
+
*
|
|
7
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info
|
|
8
|
+
* @since 5.12.0
|
|
9
|
+
* @important
|
|
10
|
+
*/
|
|
11
|
+
export class CurveLineSeries extends LineSeries {
|
|
12
|
+
_afterNew() {
|
|
13
|
+
super._afterNew();
|
|
14
|
+
this.set("maskContent", false);
|
|
15
|
+
this.bulletsContainer.set("maskContent", false);
|
|
16
|
+
this.bulletsContainer.set("mask", Graphics.new(this._root, {}));
|
|
17
|
+
}
|
|
18
|
+
_handleMaskBullets() {
|
|
19
|
+
}
|
|
20
|
+
_updateChildren() {
|
|
21
|
+
super._updateChildren();
|
|
22
|
+
if (!this.get("maskBullets")) {
|
|
23
|
+
this.bulletsContainer.remove("mask");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
getPoint(positionX, positionY) {
|
|
27
|
+
const xRenderer = this.get("xAxis").get("renderer");
|
|
28
|
+
return xRenderer.positionToPoint(positionX, positionY);
|
|
29
|
+
}
|
|
30
|
+
_shouldInclude(position) {
|
|
31
|
+
const xAxis = this.get("xAxis");
|
|
32
|
+
if (position < xAxis.get("start", 0) || position > xAxis.get("end", 1)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
_shouldShowBullet(positionX, _positionY) {
|
|
38
|
+
const xAxis = this.get("xAxis");
|
|
39
|
+
if (positionX < xAxis.get("start", 0) || positionX > xAxis.get("end", 1)) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return this._showBullets;
|
|
43
|
+
}
|
|
44
|
+
_positionBullet(bullet) {
|
|
45
|
+
let sprite = bullet.get("sprite");
|
|
46
|
+
if (sprite) {
|
|
47
|
+
const dataItem = sprite.dataItem;
|
|
48
|
+
const diLocationX = dataItem.get("locationX", 0.5);
|
|
49
|
+
const diLocationY = dataItem.get("locationY", 0.5);
|
|
50
|
+
const locationX = bullet.get("locationX", diLocationX);
|
|
51
|
+
const locationY = bullet.get("locationY", diLocationY);
|
|
52
|
+
const series = dataItem.component;
|
|
53
|
+
const xAxis = series.get("xAxis");
|
|
54
|
+
const yAxis = series.get("yAxis");
|
|
55
|
+
let positionX = 0;
|
|
56
|
+
let vcx = series.get("vcx", 1);
|
|
57
|
+
let vcy = series.get("vcy", 1);
|
|
58
|
+
if (this.get("openValueXField")) {
|
|
59
|
+
const p0 = xAxis.getDataItemPositionX(dataItem, series._xOpenField, diLocationX, vcx);
|
|
60
|
+
const p1 = xAxis.getDataItemPositionX(dataItem, series._xField, diLocationX, vcx);
|
|
61
|
+
positionX = p0 + (p1 - p0) * locationX;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
positionX = xAxis.getDataItemPositionX(dataItem, series._xField, locationX, vcx);
|
|
65
|
+
}
|
|
66
|
+
let positionY = 0;
|
|
67
|
+
if (this.get("openValueYField")) {
|
|
68
|
+
const p0 = yAxis.getDataItemPositionY(dataItem, series._yOpenField, diLocationY, vcy);
|
|
69
|
+
const p1 = yAxis.getDataItemPositionY(dataItem, series._yField, diLocationY, vcy);
|
|
70
|
+
positionY = p0 + (p1 - p0) * locationY;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
positionY = yAxis.getDataItemPositionY(dataItem, series._yField, locationY, vcy);
|
|
74
|
+
}
|
|
75
|
+
if (series._shouldShowBullet(positionX, positionY)) {
|
|
76
|
+
sprite.setPrivate("visible", true);
|
|
77
|
+
const point = series.getPoint(positionX, positionY);
|
|
78
|
+
sprite.setAll({
|
|
79
|
+
x: point.x,
|
|
80
|
+
y: point.y
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
sprite.setPrivate("visible", false);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
Object.defineProperty(CurveLineSeries, "className", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
configurable: true,
|
|
92
|
+
writable: true,
|
|
93
|
+
value: "CurveLineSeries"
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(CurveLineSeries, "classNames", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
configurable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
value: LineSeries.classNames.concat([CurveLineSeries.className])
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=CurveLineSeries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurveLineSeries.js","sourceRoot":"","sources":["../../../../../src/.internal/charts/timeline/CurveLineSeries.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAsF,MAAM,yBAAyB,CAAC;AAezI;;;;;;;GAOG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAepC,SAAS;QAClB,KAAK,CAAC,SAAS,EAAE,CAAC;QAClB,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QAC/B,IAAI,CAAC,gBAAgB,CAAC,GAAG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AC","sourcesContent":["import type { IPoint } from \"../../core/util/IPoint\";\r\nimport type { AxisRendererCurveX } from \"./AxisRendererCurveX\";\r\nimport type { Bullet } from \"../../core/render/Bullet\";\r\nimport type { CurveChart } from \"./CurveChart\";\r\n\r\nimport { Graphics } from \"../../core/render/Graphics\";\r\nimport { LineSeries, ILineSeriesPrivate, ILineSeriesSettings, ILineSeriesDataItem, ILineSeriesAxisRange } from \"../xy/series/LineSeries\";\r\n\r\n\r\nexport interface ICurveLineSeriesDataItem extends ILineSeriesDataItem {\r\n}\r\n\r\nexport interface ICurveLineSeriesSettings extends ILineSeriesSettings {\r\n}\r\n\r\nexport interface ICurveLineSeriesPrivate extends ILineSeriesPrivate {\r\n}\r\n\r\nexport interface ICurveLineSeriesAxisRange extends ILineSeriesAxisRange {\r\n}\r\n\r\n/**\r\n * A line series for use in a [[CurveChart]], [[SerpetineChart]], or\r\n * a [[SpiralChart]].\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info\r\n * @since 5.12.0\r\n * @important\r\n */\r\nexport class CurveLineSeries extends LineSeries {\r\n\r\n\tdeclare public _settings: ICurveLineSeriesSettings;\r\n\tdeclare public _privateSettings: ICurveLineSeriesPrivate;\r\n\tdeclare public _dataItemSettings: ICurveLineSeriesDataItem;\r\n\tdeclare public _axisRangeType: ICurveLineSeriesAxisRange;\r\n\r\n\t/**\r\n\t * A chart series belongs to.\r\n\t */\r\n\tdeclare public chart: CurveChart | undefined;\r\n\r\n\tpublic static className: string = \"CurveLineSeries\";\r\n\tpublic static classNames: Array<string> = LineSeries.classNames.concat([CurveLineSeries.className]);\r\n\r\n\tprotected _afterNew() {\r\n\t\tsuper._afterNew();\r\n\t\tthis.set(\"maskContent\", false);\r\n\t\tthis.bulletsContainer.set(\"maskContent\", false);\r\n\t\tthis.bulletsContainer.set(\"mask\", Graphics.new(this._root, {}));\r\n\t}\r\n\r\n\tprotected _handleMaskBullets() {\r\n\r\n\t}\r\n\r\n\tpublic _updateChildren(): void {\r\n\t\tsuper._updateChildren();\r\n\t\tif (!this.get(\"maskBullets\")) {\r\n\t\t\tthis.bulletsContainer.remove(\"mask\");\r\n\t\t}\r\n\t}\r\n\r\n\tpublic getPoint(positionX: number, positionY: number): IPoint {\r\n\r\n\t\tconst xRenderer = this.get(\"xAxis\").get(\"renderer\") as AxisRendererCurveX;\r\n\t\treturn xRenderer.positionToPoint(positionX, positionY);\r\n\t}\r\n\r\n\tprotected _shouldInclude(position: number): boolean {\r\n\t\tconst xAxis = this.get(\"xAxis\");\r\n\t\tif (position < xAxis.get(\"start\", 0) || position > xAxis.get(\"end\", 1)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n\tprotected _shouldShowBullet(positionX: number, _positionY: number): boolean {\r\n\t\tconst xAxis = this.get(\"xAxis\");\r\n\t\tif (positionX < xAxis.get(\"start\", 0) || positionX > xAxis.get(\"end\", 1)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn this._showBullets;\r\n\t}\r\n\r\n\tpublic _positionBullet(bullet: Bullet) {\r\n\r\n\t\tlet sprite = bullet.get(\"sprite\");\r\n\t\tif (sprite) {\r\n\t\t\tconst dataItem = sprite.dataItem as any;\r\n\r\n\t\t\tconst diLocationX = dataItem.get(\"locationX\", 0.5);\r\n\t\t\tconst diLocationY = dataItem.get(\"locationY\", 0.5);\r\n\r\n\t\t\tconst locationX = bullet.get(\"locationX\", diLocationX);\r\n\t\t\tconst locationY = bullet.get(\"locationY\", diLocationY);\r\n\r\n\t\t\tconst series = dataItem.component;\r\n\r\n\t\t\tconst xAxis = series.get(\"xAxis\");\r\n\t\t\tconst yAxis = series.get(\"yAxis\");\r\n\r\n\t\t\tlet positionX = 0;\r\n\t\t\tlet vcx = series.get(\"vcx\", 1);\r\n\t\t\tlet vcy = series.get(\"vcy\", 1);\r\n\r\n\t\t\tif (this.get(\"openValueXField\")) {\r\n\t\t\t\tconst p0 = xAxis.getDataItemPositionX(dataItem, series._xOpenField, diLocationX, vcx);\r\n\t\t\t\tconst p1 = xAxis.getDataItemPositionX(dataItem, series._xField, diLocationX, vcx);\r\n\t\t\t\tpositionX = p0 + (p1 - p0) * locationX;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpositionX = xAxis.getDataItemPositionX(dataItem, series._xField, locationX, vcx);\r\n\t\t\t}\r\n\t\t\tlet positionY = 0;\r\n\t\t\tif (this.get(\"openValueYField\")) {\r\n\t\t\t\tconst p0 = yAxis.getDataItemPositionY(dataItem, series._yOpenField, diLocationY, vcy);\r\n\t\t\t\tconst p1 = yAxis.getDataItemPositionY(dataItem, series._yField, diLocationY, vcy);\r\n\t\t\t\tpositionY = p0 + (p1 - p0) * locationY;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpositionY = yAxis.getDataItemPositionY(dataItem, series._yField, locationY, vcy);\r\n\t\t\t}\r\n\r\n\t\t\tif (series._shouldShowBullet(positionX, positionY)) {\r\n\t\t\t\tsprite.setPrivate(\"visible\", true);\r\n\r\n\t\t\t\tconst point = series.getPoint(positionX, positionY);\r\n\r\n\t\t\t\tsprite.setAll({\r\n\t\t\t\t\tx: point.x,\r\n\t\t\t\t\ty: point.y\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsprite.setPrivate(\"visible\", false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { CurveChart, ICurveChartPrivate, ICurveChartSettings } from "./CurveChart";
|
|
2
|
+
import { Percent } from "../../core/util/Percent";
|
|
3
|
+
import type { CurveColumnSeries } from "./CurveColumnSeries";
|
|
4
|
+
export interface ISerpentineChartSettings extends ICurveChartSettings {
|
|
5
|
+
/**
|
|
6
|
+
* Orientation of the serpatine.
|
|
7
|
+
*
|
|
8
|
+
* @default "vertical"
|
|
9
|
+
*/
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
/**
|
|
12
|
+
* Number of levels in the chart.
|
|
13
|
+
*
|
|
14
|
+
* @default 3
|
|
15
|
+
*/
|
|
16
|
+
levelCount?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Radius of the Y-axis in `Percent`.
|
|
19
|
+
*
|
|
20
|
+
* @default 50%
|
|
21
|
+
*/
|
|
22
|
+
yAxisRadius?: Percent;
|
|
23
|
+
/**
|
|
24
|
+
* Relative location (0-1) of the start postion.
|
|
25
|
+
*
|
|
26
|
+
* @defult 0
|
|
27
|
+
*/
|
|
28
|
+
startLocation?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Relative location (0-1) of the end position.
|
|
31
|
+
*
|
|
32
|
+
* @defult 1
|
|
33
|
+
*/
|
|
34
|
+
endLocation?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface ISerpentineChartPrivate extends ICurveChartPrivate {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A Serpentine chart.
|
|
40
|
+
*
|
|
41
|
+
* For this chart to work, it needs curve points provided via renderer of
|
|
42
|
+
* its X-axis.
|
|
43
|
+
*
|
|
44
|
+
* Note: it is an experimental chart type and does not support all the
|
|
45
|
+
* functionality of the [[XYChart]].
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info
|
|
48
|
+
* @since 5.12.0
|
|
49
|
+
* @important
|
|
50
|
+
*/
|
|
51
|
+
export declare class SerpentineChart extends CurveChart {
|
|
52
|
+
static className: string;
|
|
53
|
+
static classNames: Array<string>;
|
|
54
|
+
_settings: ISerpentineChartSettings;
|
|
55
|
+
_privateSettings: ISerpentineChartPrivate;
|
|
56
|
+
_seriesType: CurveColumnSeries;
|
|
57
|
+
_prepareChildren(): void;
|
|
58
|
+
_updateMasks(): void;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=SerpentineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SerpentineChart.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/charts/timeline/SerpentineChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAO,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAS7D,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IAEpE;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAExC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CAErB;AAED,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;CAClE;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAE9C,OAAc,SAAS,EAAE,MAAM,CAAqB;IACpD,OAAc,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAA6D;IAErF,SAAS,EAAE,wBAAwB,CAAC;IACpC,gBAAgB,EAAE,uBAAuB,CAAC;IAE1C,WAAW,EAAE,iBAAiB,CAAC;IAGvC,gBAAgB,IAAI,IAAI;IAQxB,YAAY,IAAI,IAAI;CAiI3B"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { CurveChart } from "./CurveChart";
|
|
2
|
+
import { p50 } from "../../core/util/Percent";
|
|
3
|
+
import * as $math from "../../core/util/Math";
|
|
4
|
+
import * as $utils from "../../core/util/Utils";
|
|
5
|
+
/**
|
|
6
|
+
* A Serpentine chart.
|
|
7
|
+
*
|
|
8
|
+
* For this chart to work, it needs curve points provided via renderer of
|
|
9
|
+
* its X-axis.
|
|
10
|
+
*
|
|
11
|
+
* Note: it is an experimental chart type and does not support all the
|
|
12
|
+
* functionality of the [[XYChart]].
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info
|
|
15
|
+
* @since 5.12.0
|
|
16
|
+
* @important
|
|
17
|
+
*/
|
|
18
|
+
export class SerpentineChart extends CurveChart {
|
|
19
|
+
_prepareChildren() {
|
|
20
|
+
super._prepareChildren();
|
|
21
|
+
if (this.isDirty("levelCount") || this.isDirty("orientation")) {
|
|
22
|
+
this._updateMasks();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
_updateMasks() {
|
|
26
|
+
const levelCount = this.get("levelCount", 1) - 1;
|
|
27
|
+
let w = this.plotContainer.innerWidth();
|
|
28
|
+
let h = this.plotContainer.innerHeight();
|
|
29
|
+
let points = [];
|
|
30
|
+
let radius;
|
|
31
|
+
if (this.get("orientation") == "vertical") {
|
|
32
|
+
radius = Math.min(h / (levelCount + 1) / 2, w / 3);
|
|
33
|
+
h = Math.min(radius * (levelCount + 1) * 2, h);
|
|
34
|
+
const startLocation = this.get("startLocation", 0);
|
|
35
|
+
const endLocation = this.get("endLocation", 1);
|
|
36
|
+
for (let i = 0; i <= levelCount; i++) {
|
|
37
|
+
if (i % 2 === 0) {
|
|
38
|
+
if (i === 0) {
|
|
39
|
+
points.push({ x: -w / 2 + (w - radius * 2) * startLocation, y: -h / 2 + h / (levelCount + 1) * i });
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
points.push({ x: -w / 2 + radius, y: -h / 2 + h / (levelCount + 1) * i });
|
|
43
|
+
}
|
|
44
|
+
if (i === levelCount) {
|
|
45
|
+
points.push({ x: w / 2 - radius - (w - radius * 2) * (1 - endLocation), y: -h / 2 + h / (levelCount + 1) * i });
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
points.push({ x: w / 2 - 2 * radius, y: -h / 2 + h / (levelCount + 1) * i });
|
|
49
|
+
}
|
|
50
|
+
let centerPoint = { x: w / 2 - 2 * radius, y: -h / 2 + h / (levelCount + 1) * (i + 0.5) };
|
|
51
|
+
if (i < levelCount) {
|
|
52
|
+
for (let i = 1; i < 50; i++) {
|
|
53
|
+
let angle = -90 + i / 50 * 180;
|
|
54
|
+
points.push({ x: centerPoint.x + radius * $math.cos(angle), y: centerPoint.y + radius * $math.sin(angle) });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
points.push({ x: w / 2 - 2 * radius, y: -h / 2 + h / (levelCount + 1) * i });
|
|
60
|
+
if (i === levelCount) {
|
|
61
|
+
points.push({ x: -w / 2 + (w - radius * 2) * (1 - endLocation), y: -h / 2 + h / (levelCount + 1) * i });
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
points.push({ x: -w / 2 + radius, y: -h / 2 + h / (levelCount + 1) * i });
|
|
65
|
+
}
|
|
66
|
+
let centerPoint = { x: -w / 2 + radius, y: -h / 2 + h / (levelCount + 1) * (i + 0.5) };
|
|
67
|
+
if (i < levelCount) {
|
|
68
|
+
for (let i = 1; i < 50; i++) {
|
|
69
|
+
let angle = -90 - i / 50 * 180;
|
|
70
|
+
points.push({ x: centerPoint.x + radius * $math.cos(angle), y: centerPoint.y + radius * $math.sin(angle) });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
radius = Math.min(w / (levelCount + 1) / 2, h / 3);
|
|
78
|
+
w = Math.min(radius * (levelCount + 1) * 2, w);
|
|
79
|
+
const startLocation = this.get("startLocation", 0);
|
|
80
|
+
const endLocation = this.get("endLocation", 1);
|
|
81
|
+
for (let i = 0; i <= levelCount; i++) {
|
|
82
|
+
if (i % 2 === 0) {
|
|
83
|
+
if (i === 0) {
|
|
84
|
+
points.push({ y: -h / 2 + (h - radius * 2) * startLocation, x: -w / 2 + w / (levelCount + 1) * i });
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
points.push({ y: -h / 2 + radius, x: -w / 2 + w / (levelCount + 1) * i });
|
|
88
|
+
}
|
|
89
|
+
if (i === levelCount) {
|
|
90
|
+
points.push({ y: h / 2 - radius - (h - radius * 2) * (1 - endLocation), x: -w / 2 + w / (levelCount + 1) * i });
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
points.push({ y: h / 2 - 2 * radius, x: -w / 2 + w / (levelCount + 1) * i });
|
|
94
|
+
}
|
|
95
|
+
let centerPoint = { y: h / 2 - 2 * radius, x: -w / 2 + w / (levelCount + 1) * (i + 0.5) };
|
|
96
|
+
if (i < levelCount) {
|
|
97
|
+
for (let i = 1; i < 50; i++) {
|
|
98
|
+
let angle = -90 + i / 50 * 180;
|
|
99
|
+
points.push({ y: centerPoint.y + radius * $math.cos(angle), x: centerPoint.x + radius * $math.sin(angle) });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
points.push({ y: h / 2 - 2 * radius, x: -w / 2 + w / (levelCount + 1) * i });
|
|
105
|
+
if (i === levelCount) {
|
|
106
|
+
points.push({ y: -h / 2 + (h - radius * 2) * (1 - endLocation), x: -w / 2 + w / (levelCount + 1) * i });
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
points.push({ y: -h / 2 + radius, x: -w / 2 + w / (levelCount + 1) * i });
|
|
110
|
+
}
|
|
111
|
+
let centerPoint = { y: -h / 2 + radius, x: -w / 2 + w / (levelCount + 1) * (i + 0.5) };
|
|
112
|
+
if (i < levelCount) {
|
|
113
|
+
for (let i = 1; i < 50; i++) {
|
|
114
|
+
let angle = -90 - i / 50 * 180;
|
|
115
|
+
points.push({ y: centerPoint.y + radius * $math.cos(angle), x: centerPoint.x + radius * $math.sin(angle) });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
this.yAxes.each((axis) => {
|
|
122
|
+
const renderer = axis.get("renderer");
|
|
123
|
+
renderer.set("axisLength", $utils.relativeToValue(this.get("yAxisRadius", p50), 2 * radius));
|
|
124
|
+
axis.markDirtySize();
|
|
125
|
+
});
|
|
126
|
+
this.xAxes.each((axis) => {
|
|
127
|
+
const renderer = axis.get("renderer");
|
|
128
|
+
renderer.setPrivate("autoScale", false);
|
|
129
|
+
renderer.set("points", points);
|
|
130
|
+
});
|
|
131
|
+
super._updateMasks();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
Object.defineProperty(SerpentineChart, "className", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
configurable: true,
|
|
137
|
+
writable: true,
|
|
138
|
+
value: "SerpentineChart"
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(SerpentineChart, "classNames", {
|
|
141
|
+
enumerable: true,
|
|
142
|
+
configurable: true,
|
|
143
|
+
writable: true,
|
|
144
|
+
value: CurveChart.classNames.concat([SerpentineChart.className])
|
|
145
|
+
});
|
|
146
|
+
//# sourceMappingURL=SerpentineChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SerpentineChart.js","sourceRoot":"","sources":["../../../../../src/.internal/charts/timeline/SerpentineChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,GAAG,EAAW,MAAM,yBAAyB,CAAC;AAOvD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AA6ChD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAWvC,gBAAgB;QACtB,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAEzB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YAC9D,IAAI,CAAC,YAAY,EAAE,CAAC;SACpB;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AAC,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;GAAC","sourcesContent":["import { CurveChart, ICurveChartPrivate, ICurveChartSettings } from \"./CurveChart\";\r\nimport { p50, Percent } from \"../../core/util/Percent\";\r\n\r\nimport type { CurveColumnSeries } from \"./CurveColumnSeries\";\r\nimport type { AxisRendererCurveY } from \"./AxisRendererCurveY\";\r\nimport type { IPoint } from \"../../core/util/IPoint\";\r\nimport type { AxisRendererCurveX } from \"./AxisRendererCurveX\";\r\n\r\nimport * as $math from \"../../core/util/Math\";\r\nimport * as $utils from \"../../core/util/Utils\";\r\n\r\n\r\nexport interface ISerpentineChartSettings extends ICurveChartSettings {\r\n\r\n\t/**\r\n\t * Orientation of the serpatine.\r\n\t *\r\n\t * @default \"vertical\"\r\n\t */\r\n\torientation?: \"horizontal\" | \"vertical\";\r\n\r\n\t/**\r\n\t * Number of levels in the chart.\r\n\t *\r\n\t * @default 3\r\n\t */\r\n\tlevelCount?: number;\r\n\r\n\t/**\r\n\t * Radius of the Y-axis in `Percent`.\r\n\t *\r\n\t * @default 50%\r\n\t */\r\n\tyAxisRadius?: Percent;\r\n\r\n\t/**\r\n\t * Relative location (0-1) of the start postion.\r\n\t *\r\n\t * @defult 0\r\n\t */\r\n\tstartLocation?: number;\r\n\r\n\t/**\r\n\t * Relative location (0-1) of the end position.\r\n\t *\r\n\t * @defult 1\r\n\t */\r\n\tendLocation?: number;\r\n\r\n}\r\n\r\nexport interface ISerpentineChartPrivate extends ICurveChartPrivate {\r\n}\r\n\r\n/**\r\n * A Serpentine chart.\r\n *\r\n * For this chart to work, it needs curve points provided via renderer of\r\n * its X-axis.\r\n * \r\n * Note: it is an experimental chart type and does not support all the\r\n * functionality of the [[XYChart]].\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info\r\n * @since 5.12.0\r\n * @important\r\n */\r\nexport class SerpentineChart extends CurveChart {\r\n\r\n\tpublic static className: string = \"SerpentineChart\";\r\n\tpublic static classNames: Array<string> = CurveChart.classNames.concat([SerpentineChart.className]);\r\n\r\n\tdeclare public _settings: ISerpentineChartSettings;\r\n\tdeclare public _privateSettings: ISerpentineChartPrivate;\r\n\r\n\tdeclare public _seriesType: CurveColumnSeries;\r\n\r\n\r\n\tpublic _prepareChildren(): void {\r\n\t\tsuper._prepareChildren();\r\n\r\n\t\tif (this.isDirty(\"levelCount\") || this.isDirty(\"orientation\")) {\r\n\t\t\tthis._updateMasks();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic _updateMasks(): void {\r\n\t\tconst levelCount = this.get(\"levelCount\", 1) - 1;\r\n\r\n\t\tlet w = this.plotContainer.innerWidth();\r\n\t\tlet h = this.plotContainer.innerHeight();\r\n\r\n\t\tlet points: IPoint[] = [];\r\n\t\tlet radius: number;\r\n\r\n\r\n\t\tif (this.get(\"orientation\") == \"vertical\") {\r\n\t\t\tradius = Math.min(h / (levelCount + 1) / 2, w / 3);\t\t\r\n\t\t\th = Math.min(radius * (levelCount + 1) * 2, h);\t\t\t\t\r\n\r\n\t\t\tconst startLocation = this.get(\"startLocation\", 0);\r\n\t\t\tconst endLocation = this.get(\"endLocation\", 1);\r\n\r\n\t\t\tfor (let i = 0; i <= levelCount; i++) {\r\n\t\t\t\tif (i % 2 === 0) {\r\n\t\t\t\t\tif (i === 0) {\r\n\t\t\t\t\t\tpoints.push({ x: -w / 2 + (w - radius * 2) * startLocation, y: -h / 2 + h / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpoints.push({ x: -w / 2 + radius, y: -h / 2 + h / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (i === levelCount) {\r\n\t\t\t\t\t\tpoints.push({ x: w / 2 - radius - (w - radius * 2) * (1 - endLocation), y: -h / 2 + h / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpoints.push({ x: w / 2 - 2 * radius, y: -h / 2 + h / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet centerPoint = { x: w / 2 - 2 * radius, y: -h / 2 + h / (levelCount + 1) * (i + 0.5) }\r\n\t\t\t\t\tif (i < levelCount) {\r\n\t\t\t\t\t\tfor (let i = 1; i < 50; i++) {\r\n\t\t\t\t\t\t\tlet angle = -90 + i / 50 * 180;\r\n\t\t\t\t\t\t\tpoints.push({ x: centerPoint.x + radius * $math.cos(angle), y: centerPoint.y + radius * $math.sin(angle) });\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tpoints.push({ x: w / 2 - 2 * radius, y: -h / 2 + h / (levelCount + 1) * i })\r\n\r\n\t\t\t\t\tif (i === levelCount) {\r\n\t\t\t\t\t\tpoints.push({ x: -w / 2 + (w - radius * 2) * (1 - endLocation), y: -h / 2 + h / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpoints.push({ x: -w / 2 + radius, y: -h / 2 + h / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet centerPoint = { x: -w / 2 + radius, y: -h / 2 + h / (levelCount + 1) * (i + 0.5) }\r\n\r\n\t\t\t\t\tif (i < levelCount) {\r\n\t\t\t\t\t\tfor (let i = 1; i < 50; i++) {\r\n\t\t\t\t\t\t\tlet angle = -90 - i / 50 * 180;\r\n\t\t\t\t\t\t\tpoints.push({ x: centerPoint.x + radius * $math.cos(angle), y: centerPoint.y + radius * $math.sin(angle) });\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tradius = Math.min(w / (levelCount + 1) / 2, h / 3);\t\t\r\n\t\t\tw = Math.min(radius * (levelCount + 1) * 2, w);\t\r\n\r\n\t\t\tconst startLocation = this.get(\"startLocation\", 0);\r\n\t\t\tconst endLocation = this.get(\"endLocation\", 1);\r\n\r\n\t\t\tfor (let i = 0; i <= levelCount; i++) {\r\n\t\t\t\tif (i % 2 === 0) {\r\n\t\t\t\t\tif (i === 0) {\r\n\t\t\t\t\t\tpoints.push({ y: -h / 2 + (h - radius * 2) * startLocation, x: -w / 2 + w / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpoints.push({ y: -h / 2 + radius, x: -w / 2 + w / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (i === levelCount) {\r\n\t\t\t\t\t\tpoints.push({ y: h / 2 - radius - (h - radius * 2) * (1 - endLocation), x: -w / 2 + w / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpoints.push({ y: h / 2 - 2 * radius, x: -w / 2 + w / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet centerPoint = { y: h / 2 - 2 * radius, x: -w / 2 + w / (levelCount + 1) * (i + 0.5) }\r\n\t\t\t\t\tif (i < levelCount) {\r\n\t\t\t\t\t\tfor (let i = 1; i < 50; i++) {\r\n\t\t\t\t\t\t\tlet angle = -90 + i / 50 * 180;\r\n\t\t\t\t\t\t\tpoints.push({ y: centerPoint.y + radius * $math.cos(angle), x: centerPoint.x + radius * $math.sin(angle) });\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tpoints.push({ y: h / 2 - 2 * radius, x: -w / 2 + w / (levelCount + 1) * i })\r\n\r\n\t\t\t\t\tif (i === levelCount) {\r\n\t\t\t\t\t\tpoints.push({ y: -h / 2 + (h - radius * 2) * (1 - endLocation), x: -w / 2 + w / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tpoints.push({ y: -h / 2 + radius, x: -w / 2 + w / (levelCount + 1) * i })\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet centerPoint = { y: -h / 2 + radius, x: -w / 2 + w / (levelCount + 1) * (i + 0.5) }\r\n\r\n\t\t\t\t\tif (i < levelCount) {\r\n\t\t\t\t\t\tfor (let i = 1; i < 50; i++) {\r\n\t\t\t\t\t\t\tlet angle = -90 - i / 50 * 180;\r\n\t\t\t\t\t\t\tpoints.push({ y: centerPoint.y + radius * $math.cos(angle), x: centerPoint.x + radius * $math.sin(angle) });\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tthis.yAxes.each((axis) => {\r\n\t\t\tconst renderer = axis.get(\"renderer\") as AxisRendererCurveY;\r\n\t\t\trenderer.set(\"axisLength\", $utils.relativeToValue(this.get(\"yAxisRadius\", p50), 2 * radius));\r\n\t\t\taxis.markDirtySize();\r\n\t\t})\r\n\r\n\t\tthis.xAxes.each((axis) => {\r\n\t\t\tconst renderer = axis.get(\"renderer\") as AxisRendererCurveX;\r\n\t\t\trenderer.setPrivate(\"autoScale\", false);\r\n\t\t\trenderer.set(\"points\", points);\r\n\t\t})\r\n\t\tsuper._updateMasks();\r\n\t}\r\n}\r\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { CurveChart, ICurveChartPrivate, ICurveChartSettings } from "./CurveChart";
|
|
2
|
+
import { Percent } from "../../core/util/Percent";
|
|
3
|
+
import type { CurveColumnSeries } from "./CurveColumnSeries";
|
|
4
|
+
export interface ISpiralChartSettings extends ICurveChartSettings {
|
|
5
|
+
/**
|
|
6
|
+
* Numer of spiral circles.
|
|
7
|
+
*
|
|
8
|
+
* @default 3
|
|
9
|
+
*/
|
|
10
|
+
levelCount?: number;
|
|
11
|
+
/**
|
|
12
|
+
* y Axis radius in percent.
|
|
13
|
+
*
|
|
14
|
+
* @defgault 50%
|
|
15
|
+
*/
|
|
16
|
+
yAxisRadius?: Percent;
|
|
17
|
+
/**
|
|
18
|
+
* Start angle of the spiral in degrees.
|
|
19
|
+
*
|
|
20
|
+
* @default -90
|
|
21
|
+
*/
|
|
22
|
+
startAngle?: number;
|
|
23
|
+
/**
|
|
24
|
+
* End angle of the spiral in degrees.
|
|
25
|
+
*
|
|
26
|
+
* default 0
|
|
27
|
+
*/
|
|
28
|
+
endAngle?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Inner radius of the spiral in percent.
|
|
31
|
+
*
|
|
32
|
+
* @default 60%
|
|
33
|
+
*/
|
|
34
|
+
innerRadius?: Percent;
|
|
35
|
+
}
|
|
36
|
+
export interface ISpiralChartPrivate extends ICurveChartPrivate {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A spiral chart.
|
|
40
|
+
*
|
|
41
|
+
* For this chart to work, it needs curve points provided via renderer of
|
|
42
|
+
* its X-axis.
|
|
43
|
+
*
|
|
44
|
+
* Note: it is an experimental chart type and does not support all the
|
|
45
|
+
* functionality of the [[XYChart]].
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info
|
|
48
|
+
* @since 5.12.0
|
|
49
|
+
* @important
|
|
50
|
+
*/
|
|
51
|
+
export declare class SpiralChart extends CurveChart {
|
|
52
|
+
static className: string;
|
|
53
|
+
static classNames: Array<string>;
|
|
54
|
+
_settings: ISpiralChartSettings;
|
|
55
|
+
_privateSettings: ISpiralChartPrivate;
|
|
56
|
+
_seriesType: CurveColumnSeries;
|
|
57
|
+
_prepareChildren(): void;
|
|
58
|
+
_updateMasks(): void;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=SpiralChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpiralChart.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/charts/timeline/SpiralChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAO,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQ7D,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAEhE;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CAEtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;CAC9D;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,WAAY,SAAQ,UAAU;IAE1C,OAAc,SAAS,EAAE,MAAM,CAAiB;IAChD,OAAc,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAyD;IAEjF,SAAS,EAAE,oBAAoB,CAAC;IAChC,gBAAgB,EAAE,mBAAmB,CAAC;IAEtC,WAAW,EAAE,iBAAiB,CAAC;IAGvC,gBAAgB,IAAI,IAAI;IAQxB,YAAY,IAAI,IAAI;CAyB3B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CurveChart } from "./CurveChart";
|
|
2
|
+
import { p50 } from "../../core/util/Percent";
|
|
3
|
+
import * as $math from "../../core/util/Math";
|
|
4
|
+
import * as $utils from "../../core/util/Utils";
|
|
5
|
+
/**
|
|
6
|
+
* A spiral chart.
|
|
7
|
+
*
|
|
8
|
+
* For this chart to work, it needs curve points provided via renderer of
|
|
9
|
+
* its X-axis.
|
|
10
|
+
*
|
|
11
|
+
* Note: it is an experimental chart type and does not support all the
|
|
12
|
+
* functionality of the [[XYChart]].
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info
|
|
15
|
+
* @since 5.12.0
|
|
16
|
+
* @important
|
|
17
|
+
*/
|
|
18
|
+
export class SpiralChart extends CurveChart {
|
|
19
|
+
_prepareChildren() {
|
|
20
|
+
super._prepareChildren();
|
|
21
|
+
if (this.isDirty("levelCount")) {
|
|
22
|
+
this._updateMasks();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
_updateMasks() {
|
|
26
|
+
let w = this.plotContainer.innerWidth();
|
|
27
|
+
let h = this.plotContainer.innerHeight();
|
|
28
|
+
let radius = Math.min(w, h) / 2;
|
|
29
|
+
let innerRadius = $utils.relativeToValue(this.get("innerRadius", 0), radius);
|
|
30
|
+
let radiusStep = (radius - innerRadius) / this.get("levelCount", 1);
|
|
31
|
+
let yAxisRadius = $utils.relativeToValue(this.get("yAxisRadius", p50), radiusStep);
|
|
32
|
+
const points = $math.spiralPoints(0, 0, radius, radius, innerRadius, 20, radiusStep, this.get("startAngle", 0), this.get("endAngle", 360));
|
|
33
|
+
this.yAxes.each((axis) => {
|
|
34
|
+
const renderer = axis.get("renderer");
|
|
35
|
+
renderer.set("axisLength", yAxisRadius);
|
|
36
|
+
axis.markDirtySize();
|
|
37
|
+
});
|
|
38
|
+
this.xAxes.each((axis) => {
|
|
39
|
+
const renderer = axis.get("renderer");
|
|
40
|
+
renderer.setPrivate("autoScale", false);
|
|
41
|
+
renderer.set("points", points);
|
|
42
|
+
});
|
|
43
|
+
super._updateMasks();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
Object.defineProperty(SpiralChart, "className", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
configurable: true,
|
|
49
|
+
writable: true,
|
|
50
|
+
value: "SpiralChart"
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(SpiralChart, "classNames", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true,
|
|
56
|
+
value: CurveChart.classNames.concat([SpiralChart.className])
|
|
57
|
+
});
|
|
58
|
+
//# source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,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;QAE3I,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAuB,CAAC;YAC5D,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;YACxC,IAAI,CAAC,aAAa,EAAE,CAAC;QACtB,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAuB,CAAC;YAC5D,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YACxC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAChC,CAAC,CAAC,CAAA;QACF,KAAK,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;;AAzCD;;;;WAAkC,aAAa;GAAC;AAChD;;;;WAA0C,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;GAAC","sourcesContent":["import { CurveChart, ICurveChartPrivate, ICurveChartSettings } from \"./CurveChart\";\r\nimport { p50, Percent } from \"../../core/util/Percent\";\r\n\r\nimport type { CurveColumnSeries } from \"./CurveColumnSeries\";\r\nimport type { AxisRendererCurveY } from \"./AxisRendererCurveY\";\r\nimport type { AxisRendererCurveX } from \"./AxisRendererCurveX\";\r\n\r\nimport * as $math from \"../../core/util/Math\";\r\nimport * as $utils from \"../../core/util/Utils\";\r\n\r\n\r\nexport interface ISpiralChartSettings extends ICurveChartSettings {\r\n\r\n\t/**\r\n\t * Numer of spiral circles.\r\n\t *\r\n\t * @default 3\r\n\t */\r\n\tlevelCount?: number;\r\n\r\n\t/**\r\n\t * y Axis radius in percent.\r\n\t *\r\n\t * @defgault 50%\r\n\t */\r\n\tyAxisRadius?: Percent;\r\n\r\n\t/**\r\n\t * Start angle of the spiral in degrees.\r\n\t *\r\n\t * @default -90\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * End angle of the spiral in degrees.\r\n\t *\r\n\t * default 0\r\n\t */\r\n\tendAngle?: number;\r\n\r\n\t/**\r\n\t * Inner radius of the spiral in percent.\r\n\t *\r\n\t * @default 60%\r\n\t */\r\n\tinnerRadius?: Percent;\r\n\r\n}\r\n\r\nexport interface ISpiralChartPrivate extends ICurveChartPrivate {\r\n}\r\n\r\n/**\r\n * A spiral chart.\r\n * \r\n * For this chart to work, it needs curve points provided via renderer of\r\n * its X-axis.\r\n * \r\n * Note: it is an experimental chart type and does not support all the\r\n * functionality of the [[XYChart]].\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v5/charts/timeline/} for more info\r\n * @since 5.12.0\r\n * @important\r\n */\r\nexport class SpiralChart extends CurveChart {\r\n\r\n\tpublic static className: string = \"SpiralChart\";\r\n\tpublic static classNames: Array<string> = CurveChart.classNames.concat([SpiralChart.className]);\r\n\r\n\tdeclare public _settings: ISpiralChartSettings;\r\n\tdeclare public _privateSettings: ISpiralChartPrivate;\r\n\r\n\tdeclare public _seriesType: CurveColumnSeries;\r\n\r\n\r\n\tpublic _prepareChildren(): void {\r\n\t\tsuper._prepareChildren();\r\n\r\n\t\tif (this.isDirty(\"levelCount\")) {\r\n\t\t\tthis._updateMasks();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic _updateMasks(): void {\r\n\r\n\t\tlet w = this.plotContainer.innerWidth();\r\n\t\tlet h = this.plotContainer.innerHeight();\r\n\r\n\t\tlet radius: number = Math.min(w, h) / 2;\r\n\t\tlet innerRadius = $utils.relativeToValue(this.get(\"innerRadius\", 0), radius);\r\n\t\tlet radiusStep = (radius - innerRadius) / this.get(\"levelCount\", 1);\r\n\t\tlet yAxisRadius: number = $utils.relativeToValue(this.get(\"yAxisRadius\", p50), radiusStep);\r\n\r\n\t\tconst points = $math.spiralPoints(0, 0, radius, radius, innerRadius, 20, radiusStep, this.get(\"startAngle\", 0), this.get(\"endAngle\", 360));\r\n\r\n\t\tthis.yAxes.each((axis) => {\r\n\t\t\tconst renderer = axis.get(\"renderer\") as AxisRendererCurveY;\r\n\t\t\trenderer.set(\"axisLength\", yAxisRadius);\r\n\t\t\taxis.markDirtySize();\r\n\t\t})\r\n\r\n\t\tthis.xAxes.each((axis) => {\r\n\t\t\tconst renderer = axis.get(\"renderer\") as AxisRendererCurveX;\r\n\t\t\trenderer.setPrivate(\"autoScale\", false);\r\n\t\t\trenderer.set(\"points\", points);\r\n\t\t})\r\n\t\tsuper._updateMasks();\r\n\t}\r\n}\r\n"]}
|