@amcharts/amcharts5 5.13.5 → 5.14.0
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/funnel/FunnelSeries.d.ts +1 -1
- package/.internal/charts/funnel/FunnelSeries.d.ts.map +1 -1
- package/.internal/charts/funnel/FunnelSeries.js.map +1 -1
- package/.internal/charts/funnel/FunnelSlice.d.ts +1 -1
- package/.internal/charts/funnel/FunnelSlice.d.ts.map +1 -1
- package/.internal/charts/funnel/FunnelSlice.js.map +1 -1
- package/.internal/charts/funnel/PyramidSeries.d.ts.map +1 -1
- package/.internal/charts/funnel/PyramidSeries.js.map +1 -1
- package/.internal/charts/funnel/SlicedChart.d.ts +1 -1
- package/.internal/charts/funnel/SlicedChart.d.ts.map +1 -1
- package/.internal/charts/funnel/SlicedChart.js.map +1 -1
- package/.internal/charts/gantt/Gantt.d.ts +216 -0
- package/.internal/charts/gantt/Gantt.d.ts.map +1 -0
- package/.internal/charts/gantt/Gantt.js +772 -0
- package/.internal/charts/gantt/Gantt.js.map +1 -0
- package/.internal/charts/gantt/GanttCategoryAxis.d.ts +287 -0
- package/.internal/charts/gantt/GanttCategoryAxis.d.ts.map +1 -0
- package/.internal/charts/gantt/GanttCategoryAxis.js +1238 -0
- package/.internal/charts/gantt/GanttCategoryAxis.js.map +1 -0
- package/.internal/charts/gantt/GanttCategoryAxisRenderer.d.ts +98 -0
- package/.internal/charts/gantt/GanttCategoryAxisRenderer.d.ts.map +1 -0
- package/.internal/charts/gantt/GanttCategoryAxisRenderer.js +270 -0
- package/.internal/charts/gantt/GanttCategoryAxisRenderer.js.map +1 -0
- package/.internal/charts/gantt/GanttDateAxis.d.ts +36 -0
- package/.internal/charts/gantt/GanttDateAxis.d.ts.map +1 -0
- package/.internal/charts/gantt/GanttDateAxis.js +35 -0
- package/.internal/charts/gantt/GanttDateAxis.js.map +1 -0
- package/.internal/charts/gantt/GanttDateAxisRenderer.d.ts +19 -0
- package/.internal/charts/gantt/GanttDateAxisRenderer.d.ts.map +1 -0
- package/.internal/charts/gantt/GanttDateAxisRenderer.js +23 -0
- package/.internal/charts/gantt/GanttDateAxisRenderer.js.map +1 -0
- package/.internal/charts/gantt/GanttDefaultTheme.d.ts +8 -0
- package/.internal/charts/gantt/GanttDefaultTheme.d.ts.map +1 -0
- package/.internal/charts/gantt/GanttDefaultTheme.js +756 -0
- package/.internal/charts/gantt/GanttDefaultTheme.js.map +1 -0
- package/.internal/charts/gantt/GanttSeries.d.ts +348 -0
- package/.internal/charts/gantt/GanttSeries.d.ts.map +1 -0
- package/.internal/charts/gantt/GanttSeries.js +1524 -0
- package/.internal/charts/gantt/GanttSeries.js.map +1 -0
- package/.internal/charts/hierarchy/Hierarchy.js.map +1 -1
- package/.internal/charts/hierarchy/HierarchyDefaultTheme.js.map +1 -1
- package/.internal/charts/hierarchy/HierarchyLink.d.ts +1 -1
- package/.internal/charts/hierarchy/HierarchyLink.d.ts.map +1 -1
- package/.internal/charts/hierarchy/HierarchyLink.js.map +1 -1
- package/.internal/charts/hierarchy/LinkedHierarchy.d.ts +2 -2
- package/.internal/charts/hierarchy/LinkedHierarchy.d.ts.map +1 -1
- package/.internal/charts/hierarchy/LinkedHierarchy.js +1 -1
- package/.internal/charts/hierarchy/LinkedHierarchy.js.map +1 -1
- package/.internal/charts/hierarchy/Pack.d.ts.map +1 -1
- package/.internal/charts/hierarchy/Pack.js.map +1 -1
- package/.internal/charts/hierarchy/Partition.d.ts.map +1 -1
- package/.internal/charts/hierarchy/Partition.js.map +1 -1
- package/.internal/charts/hierarchy/Treemap.js.map +1 -1
- package/.internal/charts/hierarchy/VoronoiTreemap.d.ts.map +1 -1
- package/.internal/charts/hierarchy/VoronoiTreemap.js +3 -3
- package/.internal/charts/hierarchy/VoronoiTreemap.js.map +1 -1
- package/.internal/charts/map/MapChart.d.ts.map +1 -1
- package/.internal/charts/map/MapChart.js +1 -3
- package/.internal/charts/map/MapChart.js.map +1 -1
- package/.internal/charts/stock/StockChart.d.ts +0 -1
- package/.internal/charts/stock/StockChart.d.ts.map +1 -1
- package/.internal/charts/stock/StockChart.js +11 -8
- package/.internal/charts/stock/StockChart.js.map +1 -1
- package/.internal/charts/stock/StockChartDefaultTheme.js +0 -1
- package/.internal/charts/stock/StockChartDefaultTheme.js.map +1 -1
- package/.internal/charts/stock/drawing/DrawingSeries.d.ts +1 -0
- package/.internal/charts/stock/drawing/DrawingSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/DrawingSeries.js +18 -10
- package/.internal/charts/stock/drawing/DrawingSeries.js.map +1 -1
- package/.internal/charts/stock/drawing/HorizontalLineSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/HorizontalLineSeries.js +2 -1
- package/.internal/charts/stock/drawing/HorizontalLineSeries.js.map +1 -1
- package/.internal/charts/stock/drawing/HorizontalRaySeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/HorizontalRaySeries.js +2 -1
- package/.internal/charts/stock/drawing/HorizontalRaySeries.js.map +1 -1
- package/.internal/charts/stock/drawing/ParallelChannelSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/ParallelChannelSeries.js +2 -1
- package/.internal/charts/stock/drawing/ParallelChannelSeries.js.map +1 -1
- package/.internal/charts/stock/drawing/PolylineSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/PolylineSeries.js +3 -1
- package/.internal/charts/stock/drawing/PolylineSeries.js.map +1 -1
- package/.internal/charts/stock/drawing/SimpleLineSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/SimpleLineSeries.js +2 -1
- package/.internal/charts/stock/drawing/SimpleLineSeries.js.map +1 -1
- package/.internal/charts/stock/drawing/VerticalLineSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/VerticalLineSeries.js +2 -1
- package/.internal/charts/stock/drawing/VerticalLineSeries.js.map +1 -1
- package/.internal/charts/stock/toolbar/DrawingControl.js +2 -2
- package/.internal/charts/stock/toolbar/DrawingControl.js.map +1 -1
- package/.internal/charts/timeline/AxisRendererCurveX.js.map +1 -1
- package/.internal/charts/timeline/AxisRendererCurveY.js.map +1 -1
- package/.internal/charts/timeline/CurveChart.js.map +1 -1
- package/.internal/charts/timeline/CurveColumnSeries.js.map +1 -1
- package/.internal/charts/timeline/CurveCursor.js +1 -1
- package/.internal/charts/timeline/CurveCursor.js.map +1 -1
- package/.internal/charts/timeline/SerpentineChart.d.ts +1 -1
- package/.internal/charts/timeline/SerpentineChart.d.ts.map +1 -1
- package/.internal/charts/timeline/SerpentineChart.js.map +1 -1
- package/.internal/charts/timeline/SpiralChart.d.ts +1 -1
- package/.internal/charts/timeline/SpiralChart.d.ts.map +1 -1
- package/.internal/charts/timeline/SpiralChart.js.map +1 -1
- package/.internal/charts/wordcloud/WordCloud.js.map +1 -1
- package/.internal/charts/xy/XYChart.d.ts.map +1 -1
- package/.internal/charts/xy/XYChart.js +16 -8
- package/.internal/charts/xy/XYChart.js.map +1 -1
- package/.internal/charts/xy/XYChartDefaultTheme.d.ts.map +1 -1
- package/.internal/charts/xy/XYChartDefaultTheme.js +6 -3
- package/.internal/charts/xy/XYChartDefaultTheme.js.map +1 -1
- package/.internal/charts/xy/axes/Axis.d.ts +17 -1
- package/.internal/charts/xy/axes/Axis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/Axis.js +46 -26
- package/.internal/charts/xy/axes/Axis.js.map +1 -1
- package/.internal/charts/xy/axes/AxisBullet.d.ts +1 -1
- package/.internal/charts/xy/axes/AxisBullet.d.ts.map +1 -1
- package/.internal/charts/xy/axes/AxisBullet.js.map +1 -1
- package/.internal/charts/xy/axes/AxisLabel.d.ts +1 -1
- package/.internal/charts/xy/axes/AxisLabel.d.ts.map +1 -1
- package/.internal/charts/xy/axes/AxisLabel.js.map +1 -1
- package/.internal/charts/xy/axes/AxisLabelRadial.d.ts +1 -1
- package/.internal/charts/xy/axes/AxisLabelRadial.d.ts.map +1 -1
- package/.internal/charts/xy/axes/AxisLabelRadial.js.map +1 -1
- package/.internal/charts/xy/axes/AxisRenderer.d.ts +5 -5
- package/.internal/charts/xy/axes/AxisRenderer.d.ts.map +1 -1
- package/.internal/charts/xy/axes/AxisRenderer.js.map +1 -1
- package/.internal/charts/xy/axes/AxisRendererX.d.ts +1 -1
- package/.internal/charts/xy/axes/AxisRendererX.d.ts.map +1 -1
- package/.internal/charts/xy/axes/AxisRendererX.js +9 -5
- package/.internal/charts/xy/axes/AxisRendererX.js.map +1 -1
- package/.internal/charts/xy/axes/AxisRendererY.d.ts +1 -1
- package/.internal/charts/xy/axes/AxisRendererY.d.ts.map +1 -1
- package/.internal/charts/xy/axes/AxisRendererY.js +9 -5
- package/.internal/charts/xy/axes/AxisRendererY.js.map +1 -1
- package/.internal/charts/xy/axes/CategoryAxis.d.ts +34 -3
- package/.internal/charts/xy/axes/CategoryAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/CategoryAxis.js +243 -40
- package/.internal/charts/xy/axes/CategoryAxis.js.map +1 -1
- package/.internal/charts/xy/axes/CategoryDateAxis.d.ts +1 -1
- package/.internal/charts/xy/axes/CategoryDateAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/CategoryDateAxis.js.map +1 -1
- package/.internal/charts/xy/axes/DateAxis.d.ts +16 -2
- package/.internal/charts/xy/axes/DateAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/DateAxis.js +20 -5
- package/.internal/charts/xy/axes/DateAxis.js.map +1 -1
- package/.internal/charts/xy/axes/EditableAxisLabel.d.ts +21 -0
- package/.internal/charts/xy/axes/EditableAxisLabel.d.ts.map +1 -0
- package/.internal/charts/xy/axes/EditableAxisLabel.js +31 -0
- package/.internal/charts/xy/axes/EditableAxisLabel.js.map +1 -0
- package/.internal/charts/xy/axes/GaplessDateAxis.d.ts +2 -2
- package/.internal/charts/xy/axes/GaplessDateAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/GaplessDateAxis.js.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.d.ts +2 -2
- package/.internal/charts/xy/axes/ValueAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.js +4 -3
- package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.d.ts +5 -1
- package/.internal/charts/xy/series/BaseColumnSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.js +60 -32
- package/.internal/charts/xy/series/BaseColumnSeries.js.map +1 -1
- package/.internal/charts/xy/series/CandlestickSeries.d.ts +2 -1
- package/.internal/charts/xy/series/CandlestickSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/CandlestickSeries.js +99 -44
- package/.internal/charts/xy/series/CandlestickSeries.js.map +1 -1
- package/.internal/charts/xy/series/ColumnSeries.d.ts +39 -0
- package/.internal/charts/xy/series/ColumnSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/ColumnSeries.js +77 -1
- package/.internal/charts/xy/series/ColumnSeries.js.map +1 -1
- package/.internal/charts/xy/series/LineSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/LineSeries.js.map +1 -1
- package/.internal/charts/xy/series/OHLC.d.ts +6 -0
- package/.internal/charts/xy/series/OHLC.d.ts.map +1 -1
- package/.internal/charts/xy/series/OHLC.js +6 -0
- package/.internal/charts/xy/series/OHLC.js.map +1 -1
- package/.internal/charts/xy/series/SmoothedXLineSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/SmoothedXLineSeries.js.map +1 -1
- package/.internal/charts/xy/series/SmoothedXYLineSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/SmoothedXYLineSeries.js.map +1 -1
- package/.internal/charts/xy/series/SmoothedYLineSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/SmoothedYLineSeries.js.map +1 -1
- package/.internal/charts/xy/series/StepLineSeries.d.ts +8 -2
- package/.internal/charts/xy/series/StepLineSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/StepLineSeries.js +6 -0
- package/.internal/charts/xy/series/StepLineSeries.js.map +1 -1
- package/.internal/charts/xy/series/XYSeries.d.ts +1 -1
- package/.internal/charts/xy/series/XYSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/XYSeries.js +4 -1
- package/.internal/charts/xy/series/XYSeries.js.map +1 -1
- package/.internal/core/Classes.d.ts +28 -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/Root.d.ts +8 -0
- package/.internal/core/Root.d.ts.map +1 -1
- package/.internal/core/Root.js +26 -19
- package/.internal/core/Root.js.map +1 -1
- package/.internal/core/render/Button.d.ts +4 -1
- package/.internal/core/render/Button.d.ts.map +1 -1
- package/.internal/core/render/Button.js.map +1 -1
- package/.internal/core/render/Component.d.ts +8 -0
- package/.internal/core/render/Component.d.ts.map +1 -1
- package/.internal/core/render/Component.js +17 -0
- package/.internal/core/render/Component.js.map +1 -1
- package/.internal/core/render/ConfirmButton.d.ts +30 -0
- package/.internal/core/render/ConfirmButton.d.ts.map +1 -0
- package/.internal/core/render/ConfirmButton.js +84 -0
- package/.internal/core/render/ConfirmButton.js.map +1 -0
- package/.internal/core/render/Container.d.ts +6 -0
- package/.internal/core/render/Container.d.ts.map +1 -1
- package/.internal/core/render/Container.js +49 -2
- package/.internal/core/render/Container.js.map +1 -1
- package/.internal/core/render/EditableLabel.d.ts.map +1 -1
- package/.internal/core/render/EditableLabel.js +6 -6
- package/.internal/core/render/EditableLabel.js.map +1 -1
- package/.internal/core/render/HeatLegend.d.ts +14 -0
- package/.internal/core/render/HeatLegend.d.ts.map +1 -1
- package/.internal/core/render/HeatLegend.js +16 -3
- package/.internal/core/render/HeatLegend.js.map +1 -1
- package/.internal/core/render/Link.d.ts +28 -0
- package/.internal/core/render/Link.d.ts.map +1 -0
- package/.internal/core/render/Link.js +90 -0
- package/.internal/core/render/Link.js.map +1 -0
- package/.internal/core/render/MonotoneXTension.d.ts.map +1 -1
- package/.internal/core/render/MonotoneXTension.js.map +1 -1
- package/.internal/core/render/MonotoneYTension.d.ts.map +1 -1
- package/.internal/core/render/MonotoneYTension.js.map +1 -1
- package/.internal/core/render/NumericStepper.d.ts +27 -0
- package/.internal/core/render/NumericStepper.d.ts.map +1 -0
- package/.internal/core/render/NumericStepper.js +117 -0
- package/.internal/core/render/NumericStepper.js.map +1 -0
- package/.internal/core/render/OrthogonalLine.d.ts +33 -0
- package/.internal/core/render/OrthogonalLine.d.ts.map +1 -0
- package/.internal/core/render/OrthogonalLine.js +97 -0
- package/.internal/core/render/OrthogonalLine.js.map +1 -0
- package/.internal/core/render/ProgressPie.d.ts +32 -0
- package/.internal/core/render/ProgressPie.d.ts.map +1 -0
- package/.internal/core/render/ProgressPie.js +89 -0
- package/.internal/core/render/ProgressPie.js.map +1 -0
- package/.internal/core/render/Series.d.ts +0 -7
- package/.internal/core/render/Series.d.ts.map +1 -1
- package/.internal/core/render/Series.js +24 -27
- package/.internal/core/render/Series.js.map +1 -1
- package/.internal/core/render/Sprite.d.ts +3 -2
- package/.internal/core/render/Sprite.d.ts.map +1 -1
- package/.internal/core/render/Sprite.js +40 -30
- package/.internal/core/render/Sprite.js.map +1 -1
- package/.internal/core/render/patterns/LinePattern.d.ts +8 -0
- package/.internal/core/render/patterns/LinePattern.d.ts.map +1 -1
- package/.internal/core/render/patterns/LinePattern.js +32 -1
- package/.internal/core/render/patterns/LinePattern.js.map +1 -1
- package/.internal/core/util/DurationFormatter.js +1 -1
- package/.internal/core/util/DurationFormatter.js.map +1 -1
- package/.internal/core/util/Entity.d.ts.map +1 -1
- package/.internal/core/util/Entity.js.map +1 -1
- package/.internal/core/util/EventDispatcher.d.ts +32 -3
- package/.internal/core/util/EventDispatcher.d.ts.map +1 -1
- package/.internal/core/util/EventDispatcher.js +51 -5
- package/.internal/core/util/EventDispatcher.js.map +1 -1
- package/.internal/core/util/Language.d.ts +2 -0
- package/.internal/core/util/Language.d.ts.map +1 -1
- package/.internal/core/util/Language.js.map +1 -1
- package/.internal/core/util/Time.d.ts.map +1 -1
- package/.internal/core/util/Time.js +4 -1
- package/.internal/core/util/Time.js.map +1 -1
- package/.internal/plugins/colorPicker/ColorPicker.d.ts +151 -0
- package/.internal/plugins/colorPicker/ColorPicker.d.ts.map +1 -0
- package/.internal/plugins/colorPicker/ColorPicker.js +665 -0
- package/.internal/plugins/colorPicker/ColorPicker.js.map +1 -0
- package/.internal/plugins/colorPicker/ColorPickerButton.d.ts +28 -0
- package/.internal/plugins/colorPicker/ColorPickerButton.d.ts.map +1 -0
- package/.internal/plugins/colorPicker/ColorPickerButton.js +87 -0
- package/.internal/plugins/colorPicker/ColorPickerButton.js.map +1 -0
- package/.internal/plugins/colorPicker/ColorPickerDefaultTheme.d.ts +8 -0
- package/.internal/plugins/colorPicker/ColorPickerDefaultTheme.d.ts.map +1 -0
- package/.internal/plugins/colorPicker/ColorPickerDefaultTheme.js +248 -0
- package/.internal/plugins/colorPicker/ColorPickerDefaultTheme.js.map +1 -0
- package/.internal/plugins/json/Classes-script.d.ts +28 -0
- package/.internal/plugins/json/Classes-script.d.ts.map +1 -1
- package/.internal/plugins/json/Classes-script.js +14 -0
- package/.internal/plugins/json/Classes-script.js.map +1 -1
- package/.internal/plugins/json/Classes.d.ts +28 -0
- package/.internal/plugins/json/Classes.d.ts.map +1 -1
- package/.internal/plugins/json/Classes.js +14 -0
- package/.internal/plugins/json/Classes.js.map +1 -1
- package/.internal/themes/DefaultTheme.d.ts.map +1 -1
- package/.internal/themes/DefaultTheme.js +227 -2
- package/.internal/themes/DefaultTheme.js.map +1 -1
- package/CHANGELOG.md +34 -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/gantt/README.md +6 -0
- package/examples/javascript/gantt/index.css +11 -0
- package/examples/javascript/gantt/index.html +12 -0
- package/examples/javascript/gantt/index.js +233 -0
- package/examples/javascript/gantt/package.json +16 -0
- package/examples/javascript/gantt/webpack.config.js +38 -0
- package/examples/javascript/gantt-multilevel/README.md +6 -0
- package/examples/javascript/gantt-multilevel/index.css +11 -0
- package/examples/javascript/gantt-multilevel/index.html +12 -0
- package/examples/javascript/gantt-multilevel/index.js +111 -0
- package/examples/javascript/gantt-multilevel/package.json +16 -0
- package/examples/javascript/gantt-multilevel/webpack.config.js +38 -0
- package/examples/javascript/gantt-simple/README.md +6 -0
- package/examples/javascript/gantt-simple/index.css +11 -0
- package/examples/javascript/gantt-simple/index.html +12 -0
- package/examples/javascript/gantt-simple/index.js +94 -0
- package/examples/javascript/gantt-simple/package.json +16 -0
- package/examples/javascript/gantt-simple/webpack.config.js +38 -0
- 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/index.js +2 -0
- package/examples/javascript/stock-chart/package.json +1 -1
- package/examples/javascript/stock-chart-comparing-stocks/index.js +2 -0
- package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/javascript/stock-chart-data-granularity/index.js +2 -0
- package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
- package/examples/javascript/stock-chart-data-grouping/index.js +2 -0
- package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
- package/examples/javascript/stock-chart-intraday/index.js +2 -0
- package/examples/javascript/stock-chart-intraday/package.json +1 -1
- package/examples/javascript/stock-chart-live/index.js +1 -0
- package/examples/javascript/stock-chart-live/package.json +1 -1
- package/examples/javascript/stock-chart-volume-separate-panel/index.js +2 -0
- package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/javascript/timeline-horizontal-serpentine-chart/package.json +1 -1
- package/examples/javascript/timeline-linear-process-diagram/package.json +1 -1
- package/examples/javascript/timeline-serpentine-chart/package.json +1 -1
- package/examples/javascript/timeline-spiral-chart/package.json +1 -1
- 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/index.js +1 -0
- 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/gantt/README.md +6 -0
- package/examples/typescript/gantt/index.css +11 -0
- package/examples/typescript/gantt/index.html +12 -0
- package/examples/typescript/gantt/index.ts +233 -0
- package/examples/typescript/gantt/package.json +18 -0
- package/examples/typescript/gantt/tsconfig.json +12 -0
- package/examples/typescript/gantt/webpack.config.js +45 -0
- package/examples/typescript/gantt-multilevel/README.md +6 -0
- package/examples/typescript/gantt-multilevel/index.css +11 -0
- package/examples/typescript/gantt-multilevel/index.html +12 -0
- package/examples/typescript/gantt-multilevel/index.ts +111 -0
- package/examples/typescript/gantt-multilevel/package.json +18 -0
- package/examples/typescript/gantt-multilevel/tsconfig.json +12 -0
- package/examples/typescript/gantt-multilevel/webpack.config.js +45 -0
- package/examples/typescript/gantt-simple/README.md +6 -0
- package/examples/typescript/gantt-simple/index.css +11 -0
- package/examples/typescript/gantt-simple/index.html +12 -0
- package/examples/typescript/gantt-simple/index.ts +94 -0
- package/examples/typescript/gantt-simple/package.json +18 -0
- package/examples/typescript/gantt-simple/tsconfig.json +12 -0
- package/examples/typescript/gantt-simple/webpack.config.js +45 -0
- 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/index.ts +2 -0
- package/examples/typescript/stock-chart/package.json +1 -1
- package/examples/typescript/stock-chart-comparing-stocks/index.ts +2 -0
- package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/typescript/stock-chart-data-granularity/index.ts +2 -0
- package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
- package/examples/typescript/stock-chart-data-grouping/index.ts +2 -0
- package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
- package/examples/typescript/stock-chart-intraday/index.ts +2 -0
- package/examples/typescript/stock-chart-intraday/package.json +1 -1
- package/examples/typescript/stock-chart-live/index.ts +1 -0
- package/examples/typescript/stock-chart-live/package.json +1 -1
- package/examples/typescript/stock-chart-volume-separate-panel/index.ts +2 -0
- package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/typescript/timeline-horizontal-serpentine-chart/package.json +1 -1
- package/examples/typescript/timeline-linear-process-diagram/package.json +1 -1
- package/examples/typescript/timeline-serpentine-chart/package.json +1 -1
- package/examples/typescript/timeline-spiral-chart/package.json +1 -1
- 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/index.ts +1 -0
- 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/gantt.d.ts +9 -0
- package/gantt.d.ts.map +1 -0
- package/gantt.js +9 -0
- package/gantt.js.map +1 -0
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -1
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/locales/ar.d.ts +4 -0
- package/locales/ar.d.ts.map +1 -1
- package/locales/ar.js +5 -0
- package/locales/ar.js.map +1 -1
- package/locales/bg_BG.d.ts +2 -0
- package/locales/bg_BG.d.ts.map +1 -1
- package/locales/bg_BG.js +3 -1
- package/locales/bg_BG.js.map +1 -1
- package/locales/bs_BA.d.ts +4 -0
- package/locales/bs_BA.d.ts.map +1 -1
- package/locales/bs_BA.js +5 -0
- package/locales/bs_BA.js.map +1 -1
- package/locales/ca_ES.d.ts +4 -0
- package/locales/ca_ES.d.ts.map +1 -1
- package/locales/ca_ES.js +5 -0
- package/locales/ca_ES.js.map +1 -1
- package/locales/cs_CZ.d.ts +4 -0
- package/locales/cs_CZ.d.ts.map +1 -1
- package/locales/cs_CZ.js +5 -0
- package/locales/cs_CZ.js.map +1 -1
- package/locales/da_DK.d.ts +4 -0
- package/locales/da_DK.d.ts.map +1 -1
- package/locales/da_DK.js +5 -0
- package/locales/da_DK.js.map +1 -1
- package/locales/de_CH.d.ts +4 -0
- package/locales/de_CH.d.ts.map +1 -1
- package/locales/de_CH.js +5 -0
- package/locales/de_CH.js.map +1 -1
- package/locales/de_DE.d.ts +4 -0
- package/locales/de_DE.d.ts.map +1 -1
- package/locales/de_DE.js +5 -0
- package/locales/de_DE.js.map +1 -1
- package/locales/el_GR.d.ts +4 -0
- package/locales/el_GR.d.ts.map +1 -1
- package/locales/el_GR.js +5 -0
- package/locales/el_GR.js.map +1 -1
- package/locales/en.d.ts +2 -0
- package/locales/en.d.ts.map +1 -1
- package/locales/en.js +3 -1
- package/locales/en.js.map +1 -1
- package/locales/en_CA.d.ts +4 -0
- package/locales/en_CA.d.ts.map +1 -1
- package/locales/en_CA.js +5 -0
- package/locales/en_CA.js.map +1 -1
- package/locales/en_US.d.ts +4 -0
- package/locales/en_US.d.ts.map +1 -1
- package/locales/en_US.js +5 -0
- package/locales/en_US.js.map +1 -1
- package/locales/es_ES.d.ts +4 -0
- package/locales/es_ES.d.ts.map +1 -1
- package/locales/es_ES.js +6 -1
- package/locales/es_ES.js.map +1 -1
- package/locales/et_EE.d.ts +4 -0
- package/locales/et_EE.d.ts.map +1 -1
- package/locales/et_EE.js +5 -0
- package/locales/et_EE.js.map +1 -1
- package/locales/fi_FI.d.ts +4 -0
- package/locales/fi_FI.d.ts.map +1 -1
- package/locales/fi_FI.js +5 -0
- package/locales/fi_FI.js.map +1 -1
- package/locales/fo_FO.d.ts +2 -0
- package/locales/fo_FO.d.ts.map +1 -1
- package/locales/fo_FO.js +3 -1
- package/locales/fo_FO.js.map +1 -1
- package/locales/fr_FR.d.ts +4 -0
- package/locales/fr_FR.d.ts.map +1 -1
- package/locales/fr_FR.js +5 -0
- package/locales/fr_FR.js.map +1 -1
- package/locales/he_IL.d.ts +4 -0
- package/locales/he_IL.d.ts.map +1 -1
- package/locales/he_IL.js +5 -0
- package/locales/he_IL.js.map +1 -1
- package/locales/hi_IN.d.ts +4 -0
- package/locales/hi_IN.d.ts.map +1 -1
- package/locales/hi_IN.js +5 -0
- package/locales/hi_IN.js.map +1 -1
- package/locales/hr_HR.d.ts +4 -0
- package/locales/hr_HR.d.ts.map +1 -1
- package/locales/hr_HR.js +5 -0
- package/locales/hr_HR.js.map +1 -1
- package/locales/hu_HU.d.ts +4 -0
- package/locales/hu_HU.d.ts.map +1 -1
- package/locales/hu_HU.js +5 -0
- package/locales/hu_HU.js.map +1 -1
- package/locales/id_ID.d.ts +4 -0
- package/locales/id_ID.d.ts.map +1 -1
- package/locales/id_ID.js +5 -0
- package/locales/id_ID.js.map +1 -1
- package/locales/it_IT.d.ts +4 -0
- package/locales/it_IT.d.ts.map +1 -1
- package/locales/it_IT.js +5 -0
- package/locales/it_IT.js.map +1 -1
- package/locales/ja_JP.d.ts +4 -0
- package/locales/ja_JP.d.ts.map +1 -1
- package/locales/ja_JP.js +5 -0
- package/locales/ja_JP.js.map +1 -1
- package/locales/ko_KR.d.ts +4 -0
- package/locales/ko_KR.d.ts.map +1 -1
- package/locales/ko_KR.js +5 -0
- package/locales/ko_KR.js.map +1 -1
- package/locales/lt_LT.d.ts +4 -0
- package/locales/lt_LT.d.ts.map +1 -1
- package/locales/lt_LT.js +5 -0
- package/locales/lt_LT.js.map +1 -1
- package/locales/lv_LV.d.ts +4 -0
- package/locales/lv_LV.d.ts.map +1 -1
- package/locales/lv_LV.js +5 -0
- package/locales/lv_LV.js.map +1 -1
- package/locales/nb_NO.d.ts +4 -0
- package/locales/nb_NO.d.ts.map +1 -1
- package/locales/nb_NO.js +5 -0
- package/locales/nb_NO.js.map +1 -1
- package/locales/nl_NL.d.ts +4 -0
- package/locales/nl_NL.d.ts.map +1 -1
- package/locales/nl_NL.js +5 -0
- package/locales/nl_NL.js.map +1 -1
- package/locales/pl_PL.d.ts +4 -0
- package/locales/pl_PL.d.ts.map +1 -1
- package/locales/pl_PL.js +5 -0
- package/locales/pl_PL.js.map +1 -1
- package/locales/pt_BR.d.ts +4 -0
- package/locales/pt_BR.d.ts.map +1 -1
- package/locales/pt_BR.js +5 -0
- package/locales/pt_BR.js.map +1 -1
- package/locales/pt_PT.d.ts +4 -0
- package/locales/pt_PT.d.ts.map +1 -1
- package/locales/pt_PT.js +5 -0
- package/locales/pt_PT.js.map +1 -1
- package/locales/ro_RO.d.ts +4 -0
- package/locales/ro_RO.d.ts.map +1 -1
- package/locales/ro_RO.js +5 -0
- package/locales/ro_RO.js.map +1 -1
- package/locales/ru_RU.d.ts +4 -0
- package/locales/ru_RU.d.ts.map +1 -1
- package/locales/ru_RU.js +5 -0
- package/locales/ru_RU.js.map +1 -1
- package/locales/sk_SK.d.ts +4 -0
- package/locales/sk_SK.d.ts.map +1 -1
- package/locales/sk_SK.js +5 -0
- package/locales/sk_SK.js.map +1 -1
- package/locales/sl_SL.d.ts +4 -0
- package/locales/sl_SL.d.ts.map +1 -1
- package/locales/sl_SL.js +5 -0
- package/locales/sl_SL.js.map +1 -1
- package/locales/sr_RS.d.ts +4 -0
- package/locales/sr_RS.d.ts.map +1 -1
- package/locales/sr_RS.js +5 -0
- package/locales/sr_RS.js.map +1 -1
- package/locales/sv_SE.d.ts +4 -0
- package/locales/sv_SE.d.ts.map +1 -1
- package/locales/sv_SE.js +5 -0
- package/locales/sv_SE.js.map +1 -1
- package/locales/th_TH.d.ts +4 -0
- package/locales/th_TH.d.ts.map +1 -1
- package/locales/th_TH.js +5 -0
- package/locales/th_TH.js.map +1 -1
- package/locales/tr_TR.d.ts +4 -0
- package/locales/tr_TR.d.ts.map +1 -1
- package/locales/tr_TR.js +5 -0
- package/locales/tr_TR.js.map +1 -1
- package/locales/uk_UA.d.ts +4 -0
- package/locales/uk_UA.d.ts.map +1 -1
- package/locales/uk_UA.js +5 -0
- package/locales/uk_UA.js.map +1 -1
- package/locales/vi_VN.d.ts +4 -0
- package/locales/vi_VN.d.ts.map +1 -1
- package/locales/vi_VN.js +5 -0
- package/locales/vi_VN.js.map +1 -1
- package/locales/zh_Hans.d.ts +4 -0
- package/locales/zh_Hans.d.ts.map +1 -1
- package/locales/zh_Hans.js +5 -0
- package/locales/zh_Hans.js.map +1 -1
- package/locales/zh_Hant.d.ts +4 -0
- package/locales/zh_Hant.d.ts.map +1 -1
- package/locales/zh_Hant.js +5 -0
- package/locales/zh_Hant.js.map +1 -1
- package/package.json +1 -1
- package/plugins/colorPicker.d.ts +3 -0
- package/plugins/colorPicker.d.ts.map +1 -0
- package/plugins/colorPicker.js +3 -0
- package/plugins/colorPicker.js.map +1 -0
- package/xy.d.ts +1 -0
- package/xy.d.ts.map +1 -1
- package/xy.js +1 -0
- package/xy.js.map +1 -1
|
@@ -0,0 +1,1524 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { ColumnSeries } from "../xy/series/ColumnSeries";
|
|
3
|
+
import { Container } from "../../core/render/Container";
|
|
4
|
+
import { Circle, color, Line, Link, ListTemplate, percent, Percent, Rectangle, RoundedRectangle, Template, Triangle } from "../../..";
|
|
5
|
+
import * as $array from "../../core/util/Array";
|
|
6
|
+
import * as $utils from "../../core/util/Utils";
|
|
7
|
+
import * as $math from "../../core/util/Math";
|
|
8
|
+
import * as $time from "../../core/util/Time";
|
|
9
|
+
import * as $object from "../../core/util/Object";
|
|
10
|
+
import * as $type from "../../core/util/Type";
|
|
11
|
+
/**
|
|
12
|
+
* A series used in [[Gantt]] chart to display tasks and their progress.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/gantt/#Gantt_series} for more info
|
|
15
|
+
* @important
|
|
16
|
+
* @since 5.14.0
|
|
17
|
+
*/
|
|
18
|
+
export class GanttSeries extends ColumnSeries {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
Object.defineProperty(this, "_startBullet", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(this, "_endBullet", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: void 0
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* A reference to the parent [[Gantt]] chart.
|
|
35
|
+
*/
|
|
36
|
+
Object.defineProperty(this, "gantt", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
writable: true,
|
|
40
|
+
value: void 0
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(this, "_columnDragStartX", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
value: void 0
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(this, "_columnDragStartY", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
configurable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
value: void 0
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(this, "_hoveredDataItem", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: void 0
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(this, "_xPan", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
configurable: true,
|
|
63
|
+
writable: true,
|
|
64
|
+
value: false
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(this, "_yPan", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: false
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* A container that holds all the links between tasks.
|
|
74
|
+
*/
|
|
75
|
+
Object.defineProperty(this, "linksContainer", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
configurable: true,
|
|
78
|
+
writable: true,
|
|
79
|
+
value: this.children.push(Container.new(this._root, {}))
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* A line which is shown while creating a connector between two tasks.
|
|
83
|
+
*/
|
|
84
|
+
Object.defineProperty(this, "connectorLine", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
value: this.children.push(Line.new(this._root, {
|
|
89
|
+
themeTags: ["connectorline"],
|
|
90
|
+
visible: false,
|
|
91
|
+
forceInactive: true
|
|
92
|
+
}))
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* A triangle that is shown at the end of the connector line, while creating
|
|
96
|
+
* a connector.
|
|
97
|
+
*/
|
|
98
|
+
Object.defineProperty(this, "connectorArrow", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
writable: true,
|
|
102
|
+
value: this.children.push(Triangle.new(this._root, {
|
|
103
|
+
themeTags: ["connectorarrow"],
|
|
104
|
+
visible: false,
|
|
105
|
+
forceInactive: true
|
|
106
|
+
}))
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* [[ListTemplate]] of [[Link]] that connect tasks.
|
|
110
|
+
*/
|
|
111
|
+
Object.defineProperty(this, "links", {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
configurable: true,
|
|
114
|
+
writable: true,
|
|
115
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Link._new(this._root, {
|
|
116
|
+
themeTags: $utils.mergeTags(this.containers.template.get("themeTags", []), ["link"])
|
|
117
|
+
}, [this.links.template])))
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* [[ListTemplate]] of [[Container]]s that hold all the elements of series
|
|
121
|
+
* items, such as grips, bullets, etc.
|
|
122
|
+
*/
|
|
123
|
+
Object.defineProperty(this, "containers", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
configurable: true,
|
|
126
|
+
writable: true,
|
|
127
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Container._new(this._root, {
|
|
128
|
+
position: "absolute",
|
|
129
|
+
themeTagsSelf: ["columncontainer"]
|
|
130
|
+
}, [this.containers.template])))
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* [[ListTemplate]] of [[Container]]s that are used to mask elements, such
|
|
134
|
+
* as progress rectangles.
|
|
135
|
+
*/
|
|
136
|
+
Object.defineProperty(this, "maskedContainers", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
configurable: true,
|
|
139
|
+
writable: true,
|
|
140
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Container._new(this._root, {
|
|
141
|
+
position: "absolute",
|
|
142
|
+
themeTagsSelf: ["maskedcontainer"]
|
|
143
|
+
}, [this.maskedContainers.template])))
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* [[ListTemplate]] of [[Circle]]s that are used as start bullets.
|
|
147
|
+
*/
|
|
148
|
+
Object.defineProperty(this, "startBullets", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
configurable: true,
|
|
151
|
+
writable: true,
|
|
152
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Circle._new(this._root, {
|
|
153
|
+
x: -1000,
|
|
154
|
+
themeTagsSelf: ["connectorbullet", "start"],
|
|
155
|
+
}, [this.startBullets.template])))
|
|
156
|
+
});
|
|
157
|
+
/**
|
|
158
|
+
* [[ListTemplate]] of [[Circle]]s that are used as end bullets.
|
|
159
|
+
*/
|
|
160
|
+
Object.defineProperty(this, "endBullets", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
configurable: true,
|
|
163
|
+
writable: true,
|
|
164
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Circle._new(this._root, {
|
|
165
|
+
x: -1000,
|
|
166
|
+
themeTagsSelf: ["connectorbullet", "end"]
|
|
167
|
+
}, [this.endBullets.template])))
|
|
168
|
+
});
|
|
169
|
+
/**
|
|
170
|
+
* [[ListTemplate]] of [[Rectangle]]s that are used to resize task bars.
|
|
171
|
+
*/
|
|
172
|
+
Object.defineProperty(this, "startGrips", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
configurable: true,
|
|
175
|
+
writable: true,
|
|
176
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Rectangle._new(this._root, {
|
|
177
|
+
themeTagsSelf: ["resizegrip", "start"]
|
|
178
|
+
}, [this.startGrips.template])))
|
|
179
|
+
});
|
|
180
|
+
/**
|
|
181
|
+
* [[ListTemplate]] of [[Rectangle]]s that are used to resize task bars.
|
|
182
|
+
*/
|
|
183
|
+
Object.defineProperty(this, "endGrips", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
configurable: true,
|
|
186
|
+
writable: true,
|
|
187
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Rectangle._new(this._root, {
|
|
188
|
+
themeTagsSelf: ["resizegrip", "end"]
|
|
189
|
+
}, [this.endGrips.template])))
|
|
190
|
+
});
|
|
191
|
+
/**
|
|
192
|
+
* [[ListTemplate]] of [[RoundedRectangle]]s that are used to show
|
|
193
|
+
* zero-duration tasks.
|
|
194
|
+
*/
|
|
195
|
+
Object.defineProperty(this, "zeroRectangles", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
configurable: true,
|
|
198
|
+
writable: true,
|
|
199
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => RoundedRectangle._new(this._root, {
|
|
200
|
+
themeTagsSelf: ["zerorectangle"],
|
|
201
|
+
}, [this.zeroRectangles.template])))
|
|
202
|
+
});
|
|
203
|
+
/**
|
|
204
|
+
* [[ListTemplate]] of [[Rectangle]]s that are used to show progress of the
|
|
205
|
+
* task. It is actually a remaining part of the task and is filled with
|
|
206
|
+
* diagonal line pattern.
|
|
207
|
+
*/
|
|
208
|
+
Object.defineProperty(this, "progressRectangles", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true,
|
|
211
|
+
writable: true,
|
|
212
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Rectangle._new(this._root, {
|
|
213
|
+
themeTagsSelf: ["progressrectangle"]
|
|
214
|
+
}, [this.progressRectangles.template])))
|
|
215
|
+
});
|
|
216
|
+
/**
|
|
217
|
+
* [[ListTemplate]] of [[Triangle]]s that are used to resize progress
|
|
218
|
+
* rectangles.
|
|
219
|
+
*/
|
|
220
|
+
Object.defineProperty(this, "progressGrips", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
configurable: true,
|
|
223
|
+
writable: true,
|
|
224
|
+
value: this.addDisposer(new ListTemplate(Template.new({}), () => Triangle._new(this._root, {
|
|
225
|
+
themeTagsSelf: ["progressgrip"]
|
|
226
|
+
}, [this.progressGrips.template])))
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
_afterNew() {
|
|
230
|
+
this.fields.push("linkTo", "categoryId");
|
|
231
|
+
this.valueFields.push("progress", "duration");
|
|
232
|
+
this.set("exactLocationX", true);
|
|
233
|
+
super._afterNew();
|
|
234
|
+
this._disposers.push(this.events.on("globalpointermove", (event) => {
|
|
235
|
+
if (this.connectorLine.isVisible()) {
|
|
236
|
+
const point = this.toLocal(event.point);
|
|
237
|
+
this._updateConnector(point);
|
|
238
|
+
}
|
|
239
|
+
}));
|
|
240
|
+
this.events.on("globalpointerup", (_event) => {
|
|
241
|
+
if (this.connectorLine.isVisible()) {
|
|
242
|
+
this._endConnector();
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
this.columns.template.events.on("dragstart", (e) => {
|
|
246
|
+
this._columnDragStartX = e.target.x();
|
|
247
|
+
this._columnDragStartY = e.target.y();
|
|
248
|
+
});
|
|
249
|
+
this.columns.template.events.on("dragged", (e) => {
|
|
250
|
+
this._handleColumnDragged(e);
|
|
251
|
+
});
|
|
252
|
+
this.columns.template.events.on("dragstop", (e) => {
|
|
253
|
+
const xAxis = this.get("xAxis");
|
|
254
|
+
const dataItem = e.target.dataItem;
|
|
255
|
+
const openValueX = dataItem.get("openValueX", 0);
|
|
256
|
+
let newOpenValueX = xAxis.positionToValue(xAxis.coordinateToPosition(e.target.x()));
|
|
257
|
+
const valueX = dataItem.get("valueX", 0);
|
|
258
|
+
let diff = newOpenValueX - openValueX;
|
|
259
|
+
dataItem.set("openValueX", newOpenValueX);
|
|
260
|
+
dataItem.set("valueX", valueX + diff);
|
|
261
|
+
dataItem.set("openValueXWorking", newOpenValueX);
|
|
262
|
+
dataItem.set("valueXWorking", valueX + diff);
|
|
263
|
+
this._fixValues(dataItem, "duration");
|
|
264
|
+
this._moveChildValues(dataItem, diff);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* @ignore
|
|
269
|
+
*/
|
|
270
|
+
roundValue(value, invertThreshold) {
|
|
271
|
+
let threshold = this.gantt.get("snapThreshold", 0.8);
|
|
272
|
+
if (invertThreshold) {
|
|
273
|
+
threshold = 1 - threshold;
|
|
274
|
+
}
|
|
275
|
+
const snapCount = this.get("snapCount", 1);
|
|
276
|
+
const xAxis = this.get("xAxis");
|
|
277
|
+
const baseInterval = xAxis.get("baseInterval");
|
|
278
|
+
return $time.roun(value + this.getUnitDuration() * threshold, baseInterval.timeUnit, baseInterval.count * snapCount, this._root);
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* @ignore
|
|
282
|
+
*/
|
|
283
|
+
makeColumn(dataItem, listTemplate) {
|
|
284
|
+
// Create the main column
|
|
285
|
+
const column = super.makeColumn(dataItem, listTemplate);
|
|
286
|
+
const yAxis = this.get("yAxis");
|
|
287
|
+
column.events.on("click", () => {
|
|
288
|
+
yAxis.selectDataItem(dataItem.get("categoryAxisDataItem"));
|
|
289
|
+
});
|
|
290
|
+
// --- Container setup ---
|
|
291
|
+
const container = this.mainContainer.children.push(this.containers.make());
|
|
292
|
+
container._setDataItem(dataItem);
|
|
293
|
+
this.containers.push(container);
|
|
294
|
+
const zeroRectangle = this.zeroRectangles.make();
|
|
295
|
+
dataItem.set("zeroRectangle", zeroRectangle);
|
|
296
|
+
this.zeroRectangles.push(zeroRectangle);
|
|
297
|
+
container.children.unshift(zeroRectangle);
|
|
298
|
+
if (dataItem.get("duration", 0) > 0) {
|
|
299
|
+
zeroRectangle.hide(0);
|
|
300
|
+
}
|
|
301
|
+
let zy = 0;
|
|
302
|
+
zeroRectangle.events.on("pointerdown", (e) => {
|
|
303
|
+
zy = e.target.y();
|
|
304
|
+
column.dragStart(e);
|
|
305
|
+
});
|
|
306
|
+
zeroRectangle.events.on("dragstart", (e) => {
|
|
307
|
+
this._handleColumnDragged(e);
|
|
308
|
+
e.target.setAll({
|
|
309
|
+
x: 0,
|
|
310
|
+
y: zy
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
zeroRectangle.events.on("dragged", (e) => {
|
|
314
|
+
this._handleColumnDragged(e);
|
|
315
|
+
e.target.setAll({
|
|
316
|
+
x: 0,
|
|
317
|
+
y: zy
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
zeroRectangle.events.on("dragstop", (e) => {
|
|
321
|
+
column.dragStop(e);
|
|
322
|
+
});
|
|
323
|
+
zeroRectangle.events.on("pointerover", (e) => {
|
|
324
|
+
this._handleColumnHover(e);
|
|
325
|
+
});
|
|
326
|
+
zeroRectangle.adapters.add("fillPattern", (fillPattern, target) => {
|
|
327
|
+
const dataItem = target.dataItem;
|
|
328
|
+
if (dataItem.get("progress", 0) < 1) {
|
|
329
|
+
return progressRectangle.get("fillPattern");
|
|
330
|
+
}
|
|
331
|
+
return fillPattern;
|
|
332
|
+
});
|
|
333
|
+
const maskedContainer = container.children.push(this.maskedContainers.make());
|
|
334
|
+
dataItem.setRaw("maskedContainer", maskedContainer);
|
|
335
|
+
const mask = container.children.push(RoundedRectangle.new(this._root, {
|
|
336
|
+
fill: color(0xffffff),
|
|
337
|
+
forceInactive: true,
|
|
338
|
+
fillOpacity: 0
|
|
339
|
+
}));
|
|
340
|
+
dataItem.setRaw("mask", mask);
|
|
341
|
+
maskedContainer.set("mask", mask);
|
|
342
|
+
// --- Progress elements ---
|
|
343
|
+
const progressRectangle = maskedContainer.children.push(this.progressRectangles.make());
|
|
344
|
+
this.progressRectangles.push(progressRectangle);
|
|
345
|
+
const progressGrip = this.progressGrips.make();
|
|
346
|
+
this.progressGrips.push(progressGrip);
|
|
347
|
+
maskedContainer.children.push(progressGrip);
|
|
348
|
+
progressGrip.events.on("dragged", () => {
|
|
349
|
+
let x = progressGrip.x();
|
|
350
|
+
x = $math.fitToRange(x, 0, column.getPrivate("width", 0));
|
|
351
|
+
progressGrip.setAll({ x: x, y: column.getPrivate("height", 0) });
|
|
352
|
+
dataItem.set("progress", progressGrip.x() / column.getPrivate("width", 0));
|
|
353
|
+
});
|
|
354
|
+
// --- Grips (start/end) ---
|
|
355
|
+
const startGrip = this.startGrips.make();
|
|
356
|
+
this.startGrips.push(startGrip);
|
|
357
|
+
container.children.push(startGrip);
|
|
358
|
+
const endGrip = this.endGrips.make();
|
|
359
|
+
this.endGrips.push(endGrip);
|
|
360
|
+
container.children.push(endGrip);
|
|
361
|
+
dataItem.setRaw("startGrip", startGrip);
|
|
362
|
+
dataItem.setRaw("endGrip", endGrip);
|
|
363
|
+
// --- Axis reference ---
|
|
364
|
+
const xAxis = this.get("xAxis");
|
|
365
|
+
// --- Grip events ---
|
|
366
|
+
let startX = 0;
|
|
367
|
+
startGrip.events.on("dragstart", () => {
|
|
368
|
+
startX = column.x();
|
|
369
|
+
column.show();
|
|
370
|
+
zeroRectangle.hide();
|
|
371
|
+
maskedContainer.show();
|
|
372
|
+
});
|
|
373
|
+
startGrip.events.on("pointerover", () => {
|
|
374
|
+
column.states.applyAnimate("hover");
|
|
375
|
+
});
|
|
376
|
+
startGrip.events.on("pointerout", () => {
|
|
377
|
+
if (column.isVisible()) {
|
|
378
|
+
column.states.applyAnimate("default");
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
startGrip.events.on("dragged", () => {
|
|
382
|
+
startGrip.set("y", 0);
|
|
383
|
+
const x = startGrip.x() + startX;
|
|
384
|
+
let openValueX = xAxis.positionToValue(xAxis.coordinateToPosition(x));
|
|
385
|
+
let minStart = this._findMinStart(dataItem);
|
|
386
|
+
openValueX = Math.max(openValueX, minStart);
|
|
387
|
+
openValueX = Math.min(openValueX, dataItem.get("valueX", openValueX));
|
|
388
|
+
dataItem.set("openValueX", openValueX);
|
|
389
|
+
startGrip.set("x", 0);
|
|
390
|
+
});
|
|
391
|
+
startGrip.events.on("dragstop", () => {
|
|
392
|
+
this._fixValues(dataItem, "end");
|
|
393
|
+
this.markDirtyValues();
|
|
394
|
+
});
|
|
395
|
+
let endX = 0;
|
|
396
|
+
endGrip.events.on("dragstart", () => {
|
|
397
|
+
endX = column.x();
|
|
398
|
+
column.show();
|
|
399
|
+
zeroRectangle.hide();
|
|
400
|
+
maskedContainer.show();
|
|
401
|
+
});
|
|
402
|
+
endGrip.events.on("pointerover", () => {
|
|
403
|
+
column.states.applyAnimate("hover");
|
|
404
|
+
});
|
|
405
|
+
endGrip.events.on("pointerout", () => {
|
|
406
|
+
if (column.isVisible()) {
|
|
407
|
+
column.states.applyAnimate("default");
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
endGrip.events.on("dragged", () => {
|
|
411
|
+
endGrip.set("y", 0);
|
|
412
|
+
const x = endGrip.x() + endX;
|
|
413
|
+
let valueX = xAxis.positionToValue(xAxis.coordinateToPosition(x));
|
|
414
|
+
valueX = Math.max(valueX, dataItem.get("openValueX", 0));
|
|
415
|
+
dataItem.set("valueX", valueX);
|
|
416
|
+
dataItem.set("valueXWorking", valueX);
|
|
417
|
+
const column = dataItem.get("graphics");
|
|
418
|
+
if (column) {
|
|
419
|
+
endGrip.set("x", column.width());
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
endGrip.events.on("dragstop", () => {
|
|
423
|
+
this._fixValues(dataItem, "start");
|
|
424
|
+
this.markDirtyValues();
|
|
425
|
+
});
|
|
426
|
+
// --- Bullets (start/end) ---
|
|
427
|
+
const startBullet = this.startBullets.make();
|
|
428
|
+
startBullet.events.on("pointerout", () => {
|
|
429
|
+
if (column.isVisible()) {
|
|
430
|
+
column.states.applyAnimate("default");
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
this.startBullets.push(startBullet);
|
|
434
|
+
container.children.push(startBullet);
|
|
435
|
+
const endBullet = this.endBullets.make();
|
|
436
|
+
this.endBullets.push(endBullet);
|
|
437
|
+
container.children.push(endBullet);
|
|
438
|
+
// --- Bullet events (connector logic) ---
|
|
439
|
+
const bulletPointerDown = (bullet) => {
|
|
440
|
+
this._startConnector(bullet);
|
|
441
|
+
};
|
|
442
|
+
startBullet.events.on("pointerdown", () => bulletPointerDown(startBullet));
|
|
443
|
+
endBullet.events.on("pointerdown", () => bulletPointerDown(endBullet));
|
|
444
|
+
column.events.on("pointerover", (e) => {
|
|
445
|
+
this._handleColumnHover(e);
|
|
446
|
+
});
|
|
447
|
+
column.events.on("pointerout", () => {
|
|
448
|
+
this._hoveredDataItem = undefined;
|
|
449
|
+
if (this.connectorLine.isVisible()) {
|
|
450
|
+
startBullet.hide();
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
// --- Data item references ---
|
|
454
|
+
dataItem.setRaw("container", container);
|
|
455
|
+
dataItem.setRaw("startBullet", startBullet);
|
|
456
|
+
dataItem.setRaw("endBullet", endBullet);
|
|
457
|
+
dataItem.setRaw("progressRectangle", progressRectangle);
|
|
458
|
+
dataItem.setRaw("progressGrip", progressGrip);
|
|
459
|
+
// --- Sync container with column position ---
|
|
460
|
+
const syncProp = (prop, target) => {
|
|
461
|
+
column.on(prop, (val) => {
|
|
462
|
+
target.set(prop, val);
|
|
463
|
+
});
|
|
464
|
+
};
|
|
465
|
+
syncProp("x", container);
|
|
466
|
+
syncProp("y", container);
|
|
467
|
+
syncProp("dx", container);
|
|
468
|
+
syncProp("dy", container);
|
|
469
|
+
syncProp("cornerRadiusBL", mask);
|
|
470
|
+
syncProp("cornerRadiusBR", mask);
|
|
471
|
+
syncProp("cornerRadiusTL", mask);
|
|
472
|
+
syncProp("cornerRadiusTR", mask);
|
|
473
|
+
if (this.isCollapsed(dataItem)) {
|
|
474
|
+
dataItem.hide(0);
|
|
475
|
+
column.hide(0);
|
|
476
|
+
maskedContainer.hide(0);
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
if (dataItem.get("duration", 0) > 0) {
|
|
480
|
+
column.appear();
|
|
481
|
+
maskedContainer.appear();
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return column;
|
|
485
|
+
}
|
|
486
|
+
_handleColumnDragged(e) {
|
|
487
|
+
const column = e.target;
|
|
488
|
+
const dataItem = column.dataItem;
|
|
489
|
+
// Maintain vertical position to prevent vertical dragging
|
|
490
|
+
if (this._columnDragStartY !== undefined) {
|
|
491
|
+
column.set("y", this._columnDragStartY);
|
|
492
|
+
}
|
|
493
|
+
// Calculate horizontal drag offset and apply to child elements
|
|
494
|
+
if (dataItem && this._columnDragStartX !== undefined) {
|
|
495
|
+
const dragOffset = column.x() - this._columnDragStartX;
|
|
496
|
+
this._dragChildValues(dataItem, dragOffset);
|
|
497
|
+
this._updateLinks();
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
_handleColumnHover(e) {
|
|
501
|
+
var _a;
|
|
502
|
+
// Only process hover if we're currently creating a connector
|
|
503
|
+
if (!this.connectorLine.isVisible())
|
|
504
|
+
return;
|
|
505
|
+
const column = e.target;
|
|
506
|
+
const dataItem = column.dataItem;
|
|
507
|
+
// Skip if no valid data item
|
|
508
|
+
if (!dataItem)
|
|
509
|
+
return;
|
|
510
|
+
const startBullet = dataItem.get("startBullet");
|
|
511
|
+
const sourceDataItem = (_a = this._startBullet) === null || _a === void 0 ? void 0 : _a.dataItem;
|
|
512
|
+
// Show the start bullet only if:
|
|
513
|
+
// 1. We have a valid start bullet
|
|
514
|
+
// 2. We have a source data item for the connection
|
|
515
|
+
// 3. Both items are at the same depth level
|
|
516
|
+
// 4. We're not trying to connect to the same item
|
|
517
|
+
if (startBullet &&
|
|
518
|
+
sourceDataItem &&
|
|
519
|
+
this.getDepth(sourceDataItem) === this.getDepth(dataItem) &&
|
|
520
|
+
sourceDataItem !== dataItem) {
|
|
521
|
+
startBullet.show();
|
|
522
|
+
this._hoveredDataItem = dataItem;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Checks if the task is collapsed.
|
|
527
|
+
*
|
|
528
|
+
* @param dataItem Data item
|
|
529
|
+
* @return Collapsed?
|
|
530
|
+
*/
|
|
531
|
+
isCollapsed(dataItem) {
|
|
532
|
+
const categoryAxisDataItem = dataItem.get("categoryAxisDataItem");
|
|
533
|
+
if (categoryAxisDataItem) {
|
|
534
|
+
const parent = categoryAxisDataItem.get("parent");
|
|
535
|
+
if (parent) {
|
|
536
|
+
if (parent.get("collapsed")) {
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
return this.isCollapsed(parent);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Updates the series, recalculating values and updating children.
|
|
546
|
+
*
|
|
547
|
+
* @ignore Exclude from docs
|
|
548
|
+
*/
|
|
549
|
+
_updateChildren() {
|
|
550
|
+
if (this._valuesDirty) {
|
|
551
|
+
this.setPrivateRaw("minX", undefined);
|
|
552
|
+
this.setPrivateRaw("maxX", undefined);
|
|
553
|
+
const yAxis = this.get("yAxis");
|
|
554
|
+
const yRenderer = yAxis.get("renderer");
|
|
555
|
+
$array.each(this.dataItems, (dataItem) => {
|
|
556
|
+
const dataContext = dataItem.dataContext;
|
|
557
|
+
const categoryAxisDataItem = dataItem.get("categoryAxisDataItem");
|
|
558
|
+
if (categoryAxisDataItem) {
|
|
559
|
+
const children = dataItem.get("children");
|
|
560
|
+
if (children && children.length > 0) {
|
|
561
|
+
dataItem.set("openValueX", undefined);
|
|
562
|
+
dataItem.set("valueX", undefined);
|
|
563
|
+
dataItem.set("openValueXWorking", undefined);
|
|
564
|
+
dataItem.set("valueXWorking", undefined);
|
|
565
|
+
delete (dataContext[this.get("openValueXField")]);
|
|
566
|
+
delete (dataContext[this.get("durationField")]);
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
dataContext[this.get("openValueXField")] = dataItem.get("openValueX");
|
|
570
|
+
dataContext[this.get("durationField")] = dataItem.get("duration");
|
|
571
|
+
dataContext[this.get("progressField")] = dataItem.get("progress");
|
|
572
|
+
}
|
|
573
|
+
dataContext[this.get("linkToField")] = dataItem.get("linkTo");
|
|
574
|
+
const category = dataItem.get("categoryY");
|
|
575
|
+
const categoryYField = this.get("categoryYField", "category");
|
|
576
|
+
dataContext[categoryYField] = category;
|
|
577
|
+
const categoryDataContext = categoryAxisDataItem.dataContext;
|
|
578
|
+
const categoryField = yAxis.get("categoryField", "category");
|
|
579
|
+
const parent = categoryAxisDataItem.get("parent");
|
|
580
|
+
categoryDataContext[categoryField] = category;
|
|
581
|
+
if (parent) {
|
|
582
|
+
categoryDataContext[yAxis.get("parentIdField", "parentId")] = parent.get("id");
|
|
583
|
+
categoryDataContext[yAxis.get("collapsedField", "collapsed")] = categoryAxisDataItem.get("collapsed", false);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
$array.each(this.dataItems, (dataItem) => {
|
|
588
|
+
this._adjustParentValues(dataItem);
|
|
589
|
+
const children = dataItem.get("children");
|
|
590
|
+
const startGrip = dataItem.get("startGrip");
|
|
591
|
+
const endGrip = dataItem.get("endGrip");
|
|
592
|
+
const progressGrip = dataItem.get("progressGrip");
|
|
593
|
+
let visible = true;
|
|
594
|
+
if (children && children.length > 0) {
|
|
595
|
+
visible = false;
|
|
596
|
+
}
|
|
597
|
+
if (startGrip) {
|
|
598
|
+
startGrip.setPrivate("visible", visible);
|
|
599
|
+
}
|
|
600
|
+
if (endGrip) {
|
|
601
|
+
endGrip.set("visible", visible);
|
|
602
|
+
}
|
|
603
|
+
if (progressGrip) {
|
|
604
|
+
progressGrip.set("visible", visible);
|
|
605
|
+
}
|
|
606
|
+
const categoryAxisDataItem = dataItem.get("categoryAxisDataItem");
|
|
607
|
+
let index = 0;
|
|
608
|
+
if (categoryAxisDataItem) {
|
|
609
|
+
const durationStepper = categoryAxisDataItem.get("durationStepper");
|
|
610
|
+
if (durationStepper) {
|
|
611
|
+
durationStepper.set("disabled", !visible);
|
|
612
|
+
}
|
|
613
|
+
index = categoryAxisDataItem.get("index", 0);
|
|
614
|
+
}
|
|
615
|
+
const duration = dataItem.get("duration", 0);
|
|
616
|
+
let zeroRectangle = dataItem.get("zeroRectangle");
|
|
617
|
+
const column = dataItem.get("graphics");
|
|
618
|
+
const maskedContainer = dataItem.get("maskedContainer");
|
|
619
|
+
const fill = categoryAxisDataItem.get("customColor", categoryAxisDataItem.get("color"));
|
|
620
|
+
if (zeroRectangle) {
|
|
621
|
+
let height = 20;
|
|
622
|
+
let y0 = yAxis.indexToPosition(index, 0);
|
|
623
|
+
let y1 = yAxis.indexToPosition(index, 1);
|
|
624
|
+
y0 = yRenderer.positionToCoordinate(y0);
|
|
625
|
+
y1 = yRenderer.positionToCoordinate(y1);
|
|
626
|
+
const columnHeight = column.get("height", 0);
|
|
627
|
+
let r = 1;
|
|
628
|
+
if (columnHeight instanceof Percent) {
|
|
629
|
+
r *= columnHeight.value * $math.cos(45);
|
|
630
|
+
}
|
|
631
|
+
height = (y1 - y0) * r;
|
|
632
|
+
zeroRectangle.setPrivate("height", height);
|
|
633
|
+
zeroRectangle.setPrivate("width", height);
|
|
634
|
+
}
|
|
635
|
+
if (column && maskedContainer && !this.isCollapsed(dataItem)) {
|
|
636
|
+
if (duration === 0 && zeroRectangle) {
|
|
637
|
+
if (!column.isHidden() && !column.isHiding()) {
|
|
638
|
+
zeroRectangle.setAll({
|
|
639
|
+
fill: fill,
|
|
640
|
+
stroke: fill
|
|
641
|
+
});
|
|
642
|
+
if (!(startGrip === null || startGrip === void 0 ? void 0 : startGrip.isDragging()) && !(endGrip === null || endGrip === void 0 ? void 0 : endGrip.isDragging())) {
|
|
643
|
+
column.hide();
|
|
644
|
+
maskedContainer.hide();
|
|
645
|
+
zeroRectangle.show();
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
if (zeroRectangle) {
|
|
651
|
+
zeroRectangle.hide();
|
|
652
|
+
}
|
|
653
|
+
column.show();
|
|
654
|
+
maskedContainer.show();
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
$array.each(this.dataItems, (dataItem) => {
|
|
659
|
+
this._adjustLinkValues(dataItem);
|
|
660
|
+
});
|
|
661
|
+
$array.each(this.dataItems, (dataItem) => {
|
|
662
|
+
this._adjustParentValues(dataItem);
|
|
663
|
+
const categoryAxisDataItem = dataItem.get("categoryAxisDataItem");
|
|
664
|
+
if (categoryAxisDataItem) {
|
|
665
|
+
categoryAxisDataItem.set("duration", dataItem.get("duration"));
|
|
666
|
+
categoryAxisDataItem.set("progress", dataItem.get("progress"));
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
// dispatch event
|
|
670
|
+
const eventType = "valueschanged";
|
|
671
|
+
if (this.events.isEnabled(eventType)) {
|
|
672
|
+
this.events.dispatch(eventType, {
|
|
673
|
+
type: eventType, target: this
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
super._updateChildren();
|
|
678
|
+
if (this._columnsUpdated) {
|
|
679
|
+
this._updateLinks();
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
_getParentOpen(dataItem) {
|
|
683
|
+
const parent = dataItem.get("parent");
|
|
684
|
+
if (parent) {
|
|
685
|
+
return this._getParentOpen(parent);
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
return dataItem.get("openValueX", -Infinity);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
_adjustLinkValues(dataItem) {
|
|
692
|
+
const linkTo = dataItem.get("linkTo");
|
|
693
|
+
if (linkTo) {
|
|
694
|
+
const valueX = dataItem.get("valueX", 0);
|
|
695
|
+
$array.each(linkTo, (id) => {
|
|
696
|
+
const linkDataItem = this.getDataItemById(id);
|
|
697
|
+
if (linkDataItem && linkDataItem !== dataItem) {
|
|
698
|
+
const linkOpenValueX = linkDataItem.get("openValueX", 0);
|
|
699
|
+
if (linkOpenValueX !== undefined && linkOpenValueX < valueX) {
|
|
700
|
+
linkDataItem.set("openValueX", valueX);
|
|
701
|
+
this._fixValues(linkDataItem, "duration");
|
|
702
|
+
this._adjustChildValues(linkDataItem);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
_adjustChildValues(dataItem) {
|
|
709
|
+
const children = dataItem.get("children", []);
|
|
710
|
+
if (children && children.length > 0) {
|
|
711
|
+
let openValueX = dataItem.get("openValueX", 0);
|
|
712
|
+
$array.each(children, (child) => {
|
|
713
|
+
const childOpenValueX = child.get("openValueX", 0);
|
|
714
|
+
if (childOpenValueX === undefined || childOpenValueX < openValueX) {
|
|
715
|
+
child.set("openValueX", openValueX);
|
|
716
|
+
this._fixValues(child, "duration");
|
|
717
|
+
}
|
|
718
|
+
this._adjustChildValues(child);
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
_dragChildValues(dataItem, dx) {
|
|
723
|
+
const children = dataItem.get("children");
|
|
724
|
+
if (children && children.length > 0) {
|
|
725
|
+
$array.each(children, (child) => {
|
|
726
|
+
const column = child.get("graphics");
|
|
727
|
+
if (column) {
|
|
728
|
+
column.set("dx", dx);
|
|
729
|
+
}
|
|
730
|
+
this._dragChildValues(child, dx);
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
_moveChildValues(dataItem, diff) {
|
|
735
|
+
const children = dataItem.get("children");
|
|
736
|
+
if (children && children.length > 0) {
|
|
737
|
+
$array.each(children, (child) => {
|
|
738
|
+
child.set("openValueX", child.get("openValueX", 0) + diff);
|
|
739
|
+
child.set("valueX", child.get("valueX", 0) + diff);
|
|
740
|
+
child.set("openValueXWorking", child.get("openValueX"));
|
|
741
|
+
child.set("valueXWorking", child.get("openValueX"));
|
|
742
|
+
const column = child.get("graphics");
|
|
743
|
+
if (column) {
|
|
744
|
+
column.set("dx", 0);
|
|
745
|
+
}
|
|
746
|
+
this._fixValues(child, "duration");
|
|
747
|
+
this._moveChildValues(child, diff);
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
_findMinStart(dataItem) {
|
|
752
|
+
// check if item has links from other items
|
|
753
|
+
let maxValue = -Infinity;
|
|
754
|
+
$array.each(this.dataItems, (item) => {
|
|
755
|
+
const linkTo = item.get("linkTo");
|
|
756
|
+
if (linkTo) {
|
|
757
|
+
$array.each(linkTo, (id) => {
|
|
758
|
+
if (id === dataItem.get("id")) {
|
|
759
|
+
const itemValueX = item.get("valueX", 0);
|
|
760
|
+
if (itemValueX > maxValue) {
|
|
761
|
+
maxValue = itemValueX;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
// if this is a child, check parent start
|
|
768
|
+
const parent = dataItem.get("parent");
|
|
769
|
+
if (parent) {
|
|
770
|
+
maxValue = Math.max(maxValue, this._findMinStart(parent));
|
|
771
|
+
}
|
|
772
|
+
return maxValue;
|
|
773
|
+
}
|
|
774
|
+
_adjustParentValues(dataItem) {
|
|
775
|
+
const categoryAxisDataItem = dataItem.get("categoryAxisDataItem");
|
|
776
|
+
if (categoryAxisDataItem) {
|
|
777
|
+
const column = dataItem.get("graphics");
|
|
778
|
+
let color = categoryAxisDataItem.get("customColor", categoryAxisDataItem.get("color"));
|
|
779
|
+
if (column) {
|
|
780
|
+
column.setAll({
|
|
781
|
+
fill: color,
|
|
782
|
+
stroke: color
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
const zeroRectangle = dataItem.get("zeroRectangle");
|
|
786
|
+
if (zeroRectangle) {
|
|
787
|
+
zeroRectangle.setAll({
|
|
788
|
+
fill: color,
|
|
789
|
+
stroke: color,
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
const children = dataItem.get("children");
|
|
793
|
+
if (children && children.length > 0) {
|
|
794
|
+
let progress = 0;
|
|
795
|
+
$array.each(children, (child) => {
|
|
796
|
+
const childProgress = child.get("progress", 0);
|
|
797
|
+
if (childProgress !== undefined) {
|
|
798
|
+
progress += childProgress;
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
progress /= children.length;
|
|
802
|
+
dataItem.set("progress", progress);
|
|
803
|
+
}
|
|
804
|
+
if (categoryAxisDataItem) {
|
|
805
|
+
let valueX = dataItem.get("valueX");
|
|
806
|
+
let openValueX = dataItem.get("openValueX");
|
|
807
|
+
const duration = dataItem.get("duration", 0);
|
|
808
|
+
if (valueX === undefined && openValueX !== undefined) {
|
|
809
|
+
openValueX = this.getOpenValue(openValueX);
|
|
810
|
+
valueX = this.getEndValue(openValueX, duration);
|
|
811
|
+
dataItem.setRaw("openValueX", openValueX);
|
|
812
|
+
dataItem.setRaw("valueX", valueX);
|
|
813
|
+
//dataItem.setRaw("openValueXWorking", openValueX);
|
|
814
|
+
//dataItem.setRaw("valueXWorking", valueX);
|
|
815
|
+
}
|
|
816
|
+
let parent = dataItem.get("parent");
|
|
817
|
+
if (openValueX !== undefined && valueX !== undefined && parent) {
|
|
818
|
+
const parentOpenValueX = parent.get("openValueX");
|
|
819
|
+
const parentValueX = parent.get("valueX");
|
|
820
|
+
if (parentOpenValueX === undefined || parentOpenValueX > openValueX) {
|
|
821
|
+
parent.set("openValueX", openValueX);
|
|
822
|
+
}
|
|
823
|
+
if (parentValueX === undefined || parentValueX < valueX) {
|
|
824
|
+
parent.set("valueX", valueX);
|
|
825
|
+
parent.set("valueXWorking", valueX);
|
|
826
|
+
}
|
|
827
|
+
parent.set("duration", this.getDataItemDuration(parent));
|
|
828
|
+
this._adjustParentValues(parent);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
_startConnector(bullet) {
|
|
834
|
+
var _a, _b, _c, _d;
|
|
835
|
+
this._startBullet = bullet;
|
|
836
|
+
this.connectorLine.show();
|
|
837
|
+
this.connectorArrow.show();
|
|
838
|
+
this._xPan = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.get("panX");
|
|
839
|
+
this._yPan = (_b = this.chart) === null || _b === void 0 ? void 0 : _b.get("panY");
|
|
840
|
+
(_c = this.chart) === null || _c === void 0 ? void 0 : _c.set("panX", false);
|
|
841
|
+
(_d = this.chart) === null || _d === void 0 ? void 0 : _d.set("panY", false);
|
|
842
|
+
const dataItem = bullet.dataItem;
|
|
843
|
+
// disable all columns of not the same depth
|
|
844
|
+
const depth = this.getDepth(dataItem);
|
|
845
|
+
const itemsToDisable = [];
|
|
846
|
+
$array.each(this.dataItems, (item) => {
|
|
847
|
+
if (this.getDepth(item) != depth) {
|
|
848
|
+
$array.move(itemsToDisable, item);
|
|
849
|
+
}
|
|
850
|
+
// also if already connected, disable
|
|
851
|
+
const links = dataItem.get("links");
|
|
852
|
+
if (links && links[item.get("id")]) {
|
|
853
|
+
$array.move(itemsToDisable, item);
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
// if this item has parent, disable all items ecept items in the same branch
|
|
857
|
+
const parent = dataItem.get("parent");
|
|
858
|
+
if (parent) {
|
|
859
|
+
$array.each(this.dataItems, (item) => {
|
|
860
|
+
if (item.get("parent") !== parent) {
|
|
861
|
+
$array.move(itemsToDisable, item);
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
// disable all columns of the same depth which are connected to start bullet data item
|
|
866
|
+
const id = dataItem.get("id");
|
|
867
|
+
const checkIfConnected = (id) => {
|
|
868
|
+
$array.each(this.dataItems, (item) => {
|
|
869
|
+
const links = item.get("links");
|
|
870
|
+
if (links && links[id]) {
|
|
871
|
+
itemsToDisable.push(item);
|
|
872
|
+
checkIfConnected(item.get("id"));
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
};
|
|
876
|
+
checkIfConnected(id);
|
|
877
|
+
$array.each(itemsToDisable, (item) => {
|
|
878
|
+
const column = item.get("graphics");
|
|
879
|
+
if (column) {
|
|
880
|
+
column.states.applyAnimate("disabled");
|
|
881
|
+
}
|
|
882
|
+
const container = item.get("container");
|
|
883
|
+
if (container) {
|
|
884
|
+
container.states.applyAnimate("disabled");
|
|
885
|
+
}
|
|
886
|
+
const zeroRectangle = item.get("zeroRectangle");
|
|
887
|
+
if (zeroRectangle) {
|
|
888
|
+
zeroRectangle.states.applyAnimate("disabled");
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
_updateConnector(point) {
|
|
893
|
+
var _a;
|
|
894
|
+
let startPoint = (_a = this._startBullet) === null || _a === void 0 ? void 0 : _a.toGlobal({ x: 0, y: 0 });
|
|
895
|
+
if (startPoint) {
|
|
896
|
+
startPoint = this.toLocal(startPoint);
|
|
897
|
+
this.connectorLine.setAll({
|
|
898
|
+
segments: [[[{ x: startPoint.x, y: startPoint.y }, { x: point.x, y: point.y }]]]
|
|
899
|
+
});
|
|
900
|
+
this.connectorArrow.setAll({
|
|
901
|
+
x: point.x,
|
|
902
|
+
y: point.y,
|
|
903
|
+
rotation: $math.getAngle(startPoint, point) + 90,
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
_endConnector() {
|
|
908
|
+
var _a, _b, _c, _d, _e;
|
|
909
|
+
let startPoint = (_a = this._startBullet) === null || _a === void 0 ? void 0 : _a.toGlobal({ x: 0, y: 0 });
|
|
910
|
+
if (startPoint) {
|
|
911
|
+
startPoint = this.toLocal(startPoint);
|
|
912
|
+
this.connectorLine.hide();
|
|
913
|
+
this.connectorArrow.hide();
|
|
914
|
+
$array.each(this.dataItems, (item) => {
|
|
915
|
+
const column = item.get("graphics");
|
|
916
|
+
if (column && column.isVisible()) {
|
|
917
|
+
column.states.applyAnimate("default");
|
|
918
|
+
}
|
|
919
|
+
const container = item.get("container");
|
|
920
|
+
if (container && container.isVisible()) {
|
|
921
|
+
container.states.applyAnimate("default");
|
|
922
|
+
}
|
|
923
|
+
const zeroRectangle = item.get("zeroRectangle");
|
|
924
|
+
if (zeroRectangle && zeroRectangle.isVisible()) {
|
|
925
|
+
zeroRectangle.states.applyAnimate("default");
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
let dataItem = this._hoveredDataItem;
|
|
929
|
+
if (dataItem && dataItem !== ((_b = this._startBullet) === null || _b === void 0 ? void 0 : _b.dataItem)) {
|
|
930
|
+
const id = dataItem.get("id");
|
|
931
|
+
if (id) {
|
|
932
|
+
const startDataItem = (_c = this._startBullet) === null || _c === void 0 ? void 0 : _c.dataItem;
|
|
933
|
+
if (startDataItem) {
|
|
934
|
+
const linkTo = startDataItem.get("linkTo", []);
|
|
935
|
+
if ($array.indexOf(linkTo, id) === -1) {
|
|
936
|
+
linkTo.push(id);
|
|
937
|
+
startDataItem.set("linkTo", linkTo);
|
|
938
|
+
this.markDirtyValues();
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
this._updateLinks();
|
|
944
|
+
}
|
|
945
|
+
this.endBullets.each((bullet) => {
|
|
946
|
+
bullet.show();
|
|
947
|
+
});
|
|
948
|
+
this.startBullets.each((bullet) => {
|
|
949
|
+
bullet.hide();
|
|
950
|
+
});
|
|
951
|
+
(_d = this.chart) === null || _d === void 0 ? void 0 : _d.set("panX", this._xPan);
|
|
952
|
+
(_e = this.chart) === null || _e === void 0 ? void 0 : _e.set("panY", this._yPan);
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Fixes values of a data item, adjusting start, end, or duration as needed.
|
|
956
|
+
*/
|
|
957
|
+
_fixValues(dataItem, keep) {
|
|
958
|
+
let valueX = dataItem.get("valueX");
|
|
959
|
+
let openValueX = dataItem.get("openValueX");
|
|
960
|
+
let duration = dataItem.get("duration", 0);
|
|
961
|
+
if ($type.isNumber(valueX) && $type.isNumber(openValueX)) {
|
|
962
|
+
if (keep === "start") {
|
|
963
|
+
valueX = this.roundValue(valueX);
|
|
964
|
+
duration = this.getDataItemDuration(dataItem);
|
|
965
|
+
dataItem.set("duration", duration);
|
|
966
|
+
}
|
|
967
|
+
else if (keep === "end") {
|
|
968
|
+
openValueX = this.roundValue(openValueX, true);
|
|
969
|
+
duration = this.getDataItemDuration(dataItem);
|
|
970
|
+
dataItem.set("duration", duration);
|
|
971
|
+
}
|
|
972
|
+
else if (keep === "duration") {
|
|
973
|
+
openValueX = this.roundValue(openValueX, true);
|
|
974
|
+
valueX = openValueX + duration * this.getUnitDuration();
|
|
975
|
+
}
|
|
976
|
+
openValueX = this.getOpenValue(openValueX);
|
|
977
|
+
valueX = this.getEndValue(openValueX, duration);
|
|
978
|
+
const animationDuration = this.get("interpolationDuration", 0);
|
|
979
|
+
const animationEasing = this.get("interpolationEasing");
|
|
980
|
+
const index = this.dataItems.indexOf(dataItem);
|
|
981
|
+
if (index >= this.startIndex() && index <= this.endIndex()) {
|
|
982
|
+
dataItem.animate({ key: "openValueXWorking", to: openValueX, duration: animationDuration, easing: animationEasing });
|
|
983
|
+
dataItem.animate({ key: "valueXWorking", to: valueX, duration: animationDuration, easing: animationEasing });
|
|
984
|
+
// animate not working also
|
|
985
|
+
dataItem.animate({ key: "openValueX", to: openValueX, duration: animationDuration, easing: animationEasing });
|
|
986
|
+
dataItem.animate({ key: "valueX", to: valueX, duration: animationDuration, easing: animationEasing });
|
|
987
|
+
}
|
|
988
|
+
else {
|
|
989
|
+
dataItem.set("openValueXWorking", openValueX);
|
|
990
|
+
dataItem.set("valueXWorking", valueX);
|
|
991
|
+
dataItem.set("openValueX", openValueX);
|
|
992
|
+
dataItem.set("valueX", valueX);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
_toggleColumn(dataItem, visible) {
|
|
997
|
+
super._toggleColumn(dataItem, visible);
|
|
998
|
+
const container = dataItem.get("container");
|
|
999
|
+
if (container) {
|
|
1000
|
+
container.setPrivate("visible", visible);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
_afterDataChange() {
|
|
1004
|
+
const yAxis = this.get("yAxis");
|
|
1005
|
+
$array.each(this.dataItems, (dataItem) => {
|
|
1006
|
+
this._fixValues(dataItem, "duration");
|
|
1007
|
+
const category = dataItem.get("categoryY");
|
|
1008
|
+
if (category) {
|
|
1009
|
+
const categoryAxisDataItem = yAxis.dataItems.find((item) => item.get("category") === category);
|
|
1010
|
+
dataItem.set("categoryAxisDataItem", categoryAxisDataItem);
|
|
1011
|
+
if (categoryAxisDataItem) {
|
|
1012
|
+
categoryAxisDataItem.on("duration", () => {
|
|
1013
|
+
const duration = categoryAxisDataItem.get("duration");
|
|
1014
|
+
const children = dataItem.get("children");
|
|
1015
|
+
if (!children || children.length === 0) {
|
|
1016
|
+
if (duration !== undefined) {
|
|
1017
|
+
dataItem.set("duration", duration);
|
|
1018
|
+
this._fixValues(dataItem, "duration");
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
});
|
|
1025
|
+
this.get("yAxis").markDirtyTree();
|
|
1026
|
+
super._afterDataChange();
|
|
1027
|
+
}
|
|
1028
|
+
_updateLinks() {
|
|
1029
|
+
const xAxis = this.get("xAxis");
|
|
1030
|
+
const yAxis = this.get("yAxis");
|
|
1031
|
+
const yRenderer = yAxis.get("renderer");
|
|
1032
|
+
let endRadius = 0;
|
|
1033
|
+
const endBullet = this.endBullets.getIndex(0);
|
|
1034
|
+
if (endBullet && endBullet.isVisible()) {
|
|
1035
|
+
endRadius = endBullet.get("radius", 0);
|
|
1036
|
+
}
|
|
1037
|
+
let columnHeight = percent(60);
|
|
1038
|
+
let column = this.columns.getIndex(0);
|
|
1039
|
+
if (column) {
|
|
1040
|
+
columnHeight = column.get("height", 0);
|
|
1041
|
+
}
|
|
1042
|
+
$array.each(this.dataItems, (dataItem) => {
|
|
1043
|
+
const linkTo = dataItem.get("linkTo");
|
|
1044
|
+
const categoryDataItem = dataItem.get("categoryAxisDataItem");
|
|
1045
|
+
if (linkTo) {
|
|
1046
|
+
let links = dataItem.get("links");
|
|
1047
|
+
const linkHorizontalOffset = this.get("linkHorizontalOffset", 25);
|
|
1048
|
+
$array.each(linkTo, (dataItemId) => {
|
|
1049
|
+
if (!links) {
|
|
1050
|
+
links = dataItem.set("links", {});
|
|
1051
|
+
}
|
|
1052
|
+
let link = links[dataItemId];
|
|
1053
|
+
if (!link) {
|
|
1054
|
+
link = this.links.make();
|
|
1055
|
+
links[dataItemId] = link;
|
|
1056
|
+
this.links.push(link);
|
|
1057
|
+
this.linksContainer.children.push(link);
|
|
1058
|
+
link.appear();
|
|
1059
|
+
link.events.on("click", () => {
|
|
1060
|
+
if (link.get("active")) {
|
|
1061
|
+
this.links.removeValue(link);
|
|
1062
|
+
const links = dataItem.get("links");
|
|
1063
|
+
if (links) {
|
|
1064
|
+
delete links[dataItemId];
|
|
1065
|
+
}
|
|
1066
|
+
$array.remove(linkTo, dataItemId);
|
|
1067
|
+
this.markDirtyValues();
|
|
1068
|
+
link.dispose();
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
link.events.on("globalpointerup", () => {
|
|
1072
|
+
if (link.get("active") && !link.isHover()) {
|
|
1073
|
+
link.set("active", false);
|
|
1074
|
+
}
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
const points = [];
|
|
1078
|
+
const positionX = xAxis.valueToPosition(dataItem.get("valueX", 0));
|
|
1079
|
+
const positionY = yAxis.categoryToPosition(dataItem.get("categoryY"));
|
|
1080
|
+
const point = this.getPoint(positionX, positionY);
|
|
1081
|
+
let firstPoint = { x: point.x + endRadius, y: point.y };
|
|
1082
|
+
if (dataItem.get("duration", 0) === 0) {
|
|
1083
|
+
let y0 = yAxis.indexToPosition(categoryDataItem.get("index", 0), 0);
|
|
1084
|
+
let y1 = yAxis.indexToPosition(categoryDataItem.get("index", 0), 1);
|
|
1085
|
+
y0 = yRenderer.positionToCoordinate(y0);
|
|
1086
|
+
y1 = yRenderer.positionToCoordinate(y1);
|
|
1087
|
+
let h = (y1 - y0) / 2;
|
|
1088
|
+
if (columnHeight instanceof Percent) {
|
|
1089
|
+
h *= columnHeight.value;
|
|
1090
|
+
}
|
|
1091
|
+
firstPoint.x += h - endRadius;
|
|
1092
|
+
}
|
|
1093
|
+
points.push(firstPoint);
|
|
1094
|
+
points.push({ x: firstPoint.x + linkHorizontalOffset, y: firstPoint.y });
|
|
1095
|
+
const targetDataItem = this.getDataItemById(dataItemId);
|
|
1096
|
+
if (targetDataItem) {
|
|
1097
|
+
const positionX = xAxis.valueToPosition(targetDataItem.get("openValueX", 0));
|
|
1098
|
+
const positionY = yAxis.categoryToPosition(targetDataItem.get("categoryY"));
|
|
1099
|
+
const point = this.getPoint(positionX, positionY);
|
|
1100
|
+
let x = point.x;
|
|
1101
|
+
let y = point.y;
|
|
1102
|
+
let lastPoint = { x: x, y: y };
|
|
1103
|
+
if (targetDataItem.get("duration", 0) === 0) {
|
|
1104
|
+
let targetCategoryDataItem = targetDataItem.get("categoryAxisDataItem");
|
|
1105
|
+
if (targetCategoryDataItem) {
|
|
1106
|
+
let y0 = yAxis.indexToPosition(targetCategoryDataItem.get("index", 0), 0);
|
|
1107
|
+
let y1 = yAxis.indexToPosition(targetCategoryDataItem.get("index", 0), 1);
|
|
1108
|
+
y0 = yRenderer.positionToCoordinate(y0);
|
|
1109
|
+
y1 = yRenderer.positionToCoordinate(y1);
|
|
1110
|
+
let h = (y1 - y0) / 2;
|
|
1111
|
+
if (columnHeight instanceof Percent) {
|
|
1112
|
+
h *= columnHeight.value;
|
|
1113
|
+
}
|
|
1114
|
+
lastPoint.x -= h;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
if (lastPoint.x - linkHorizontalOffset < firstPoint.x + linkHorizontalOffset) {
|
|
1118
|
+
const category = dataItem.get("categoryY");
|
|
1119
|
+
const yAxis = this.get("yAxis");
|
|
1120
|
+
if (category) {
|
|
1121
|
+
let index = yAxis.categoryToIndex(category);
|
|
1122
|
+
const position0 = yAxis.indexToPosition(index);
|
|
1123
|
+
const position1 = yAxis.indexToPosition(index, 1);
|
|
1124
|
+
if (yAxis && category) {
|
|
1125
|
+
let sign = -1;
|
|
1126
|
+
if (lastPoint.y > firstPoint.y) {
|
|
1127
|
+
sign = 1;
|
|
1128
|
+
}
|
|
1129
|
+
let y = yAxis.get("renderer").positionToCoordinate(yAxis.categoryToPosition(category) + (position1 - position0) * sign);
|
|
1130
|
+
points.push({ x: firstPoint.x + linkHorizontalOffset, y: y });
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
points.push({ x: lastPoint.x - linkHorizontalOffset, y: lastPoint.y });
|
|
1135
|
+
points.push(lastPoint);
|
|
1136
|
+
}
|
|
1137
|
+
link.set("points", points);
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Updates series graphics.
|
|
1144
|
+
*/
|
|
1145
|
+
_updateSeriesGraphics(dataItem, graphics, l, r, t, b, _fitW, fitH) {
|
|
1146
|
+
super._updateSeriesGraphics(dataItem, graphics, l, r, t, b, false, fitH);
|
|
1147
|
+
let x = dataItem.get("left", 0);
|
|
1148
|
+
let y = dataItem.get("top", 0);
|
|
1149
|
+
let width = dataItem.get("right", 0) - x;
|
|
1150
|
+
let height = dataItem.get("bottom", 0) - y;
|
|
1151
|
+
// Update the container position and size
|
|
1152
|
+
const container = dataItem.get("container");
|
|
1153
|
+
const mask = dataItem.get("mask");
|
|
1154
|
+
const categoryAxisDataItem = dataItem.get("categoryAxisDataItem");
|
|
1155
|
+
const fill = categoryAxisDataItem ? categoryAxisDataItem.get("customColor", categoryAxisDataItem.get("color")) : undefined;
|
|
1156
|
+
dataItem.setRaw("name", categoryAxisDataItem.dataContext.name);
|
|
1157
|
+
const startBullet = dataItem.get("startBullet");
|
|
1158
|
+
startBullet === null || startBullet === void 0 ? void 0 : startBullet.setAll({
|
|
1159
|
+
x: 0,
|
|
1160
|
+
stroke: fill
|
|
1161
|
+
});
|
|
1162
|
+
const endBullet = dataItem.get("endBullet");
|
|
1163
|
+
endBullet === null || endBullet === void 0 ? void 0 : endBullet.setAll({
|
|
1164
|
+
stroke: fill,
|
|
1165
|
+
x: width
|
|
1166
|
+
});
|
|
1167
|
+
if (container) {
|
|
1168
|
+
container.setAll({
|
|
1169
|
+
x: x,
|
|
1170
|
+
y: y,
|
|
1171
|
+
width: width,
|
|
1172
|
+
height: height
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
const maskedContainer = dataItem.get("maskedContainer");
|
|
1176
|
+
if (maskedContainer) {
|
|
1177
|
+
maskedContainer.setAll({
|
|
1178
|
+
x: 0,
|
|
1179
|
+
y: 0,
|
|
1180
|
+
width: width,
|
|
1181
|
+
height: height
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1184
|
+
if (mask) {
|
|
1185
|
+
mask.setAll({
|
|
1186
|
+
x: 0,
|
|
1187
|
+
y: 0,
|
|
1188
|
+
width: width,
|
|
1189
|
+
height: height
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
const startGrip = dataItem.get("startGrip");
|
|
1193
|
+
if (startGrip) {
|
|
1194
|
+
startGrip.setAll({
|
|
1195
|
+
height: height
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
const endGrip = dataItem.get("endGrip");
|
|
1199
|
+
if (endGrip) {
|
|
1200
|
+
endGrip.setAll({
|
|
1201
|
+
x: width,
|
|
1202
|
+
height: height
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
// update progress rectangle
|
|
1206
|
+
const progressRectangle = dataItem.get("progressRectangle");
|
|
1207
|
+
if (progressRectangle) {
|
|
1208
|
+
const progress = dataItem.get("progress", 0);
|
|
1209
|
+
const progressWidth = width - width * progress;
|
|
1210
|
+
progressRectangle.setAll({
|
|
1211
|
+
x: width - progressWidth,
|
|
1212
|
+
width: progressWidth,
|
|
1213
|
+
height: height
|
|
1214
|
+
});
|
|
1215
|
+
const progressGrip = dataItem.get("progressGrip");
|
|
1216
|
+
if (progressGrip) {
|
|
1217
|
+
progressGrip.setAll({
|
|
1218
|
+
x: width - progressWidth
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
const zeroRectangle = dataItem.get("zeroRectangle");
|
|
1222
|
+
if (zeroRectangle) {
|
|
1223
|
+
zeroRectangle.markDirtyKey("fillPattern");
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Hides series's data item.
|
|
1229
|
+
*
|
|
1230
|
+
* @param dataItem Data item
|
|
1231
|
+
* @param duration Animation duration in milliseconds
|
|
1232
|
+
* @return Promise
|
|
1233
|
+
*/
|
|
1234
|
+
hideDataItem(dataItem, duration) {
|
|
1235
|
+
const _super = Object.create(null, {
|
|
1236
|
+
hideDataItem: { get: () => super.hideDataItem }
|
|
1237
|
+
});
|
|
1238
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1239
|
+
const promises = [_super.hideDataItem.call(this, dataItem, duration)];
|
|
1240
|
+
const container = dataItem.get("container");
|
|
1241
|
+
if (container) {
|
|
1242
|
+
promises.push(container.hide(duration));
|
|
1243
|
+
}
|
|
1244
|
+
// hide all links
|
|
1245
|
+
const links = dataItem.get("links", {});
|
|
1246
|
+
if (links) {
|
|
1247
|
+
$object.each(links, (_key, link) => {
|
|
1248
|
+
link.hide(duration);
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
// hide all links to this data item
|
|
1252
|
+
const id = dataItem.get("id");
|
|
1253
|
+
if (id) {
|
|
1254
|
+
$array.each(this.dataItems, (item) => {
|
|
1255
|
+
const linkTo = item.get("linkTo");
|
|
1256
|
+
if (linkTo && linkTo.includes(id)) {
|
|
1257
|
+
const links = item.get("links");
|
|
1258
|
+
if (links && links[id]) {
|
|
1259
|
+
const link = links[id];
|
|
1260
|
+
link.hide(duration);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
yield Promise.all(promises);
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Shows series's data item.
|
|
1270
|
+
*
|
|
1271
|
+
* @param dataItem Data item
|
|
1272
|
+
* @param duration Animation duration in milliseconds
|
|
1273
|
+
* @return Promise
|
|
1274
|
+
*/
|
|
1275
|
+
showDataItem(dataItem, duration) {
|
|
1276
|
+
const _super = Object.create(null, {
|
|
1277
|
+
showDataItem: { get: () => super.showDataItem }
|
|
1278
|
+
});
|
|
1279
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1280
|
+
const promises = [_super.showDataItem.call(this, dataItem, duration)];
|
|
1281
|
+
const container = dataItem.get("container");
|
|
1282
|
+
if (container) {
|
|
1283
|
+
promises.push(container.show(duration));
|
|
1284
|
+
}
|
|
1285
|
+
// show all links
|
|
1286
|
+
const links = dataItem.get("links", {});
|
|
1287
|
+
if (links) {
|
|
1288
|
+
$object.each(links, (_key, link) => {
|
|
1289
|
+
link.show(duration);
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
// show all links to this data item
|
|
1293
|
+
const id = dataItem.get("id");
|
|
1294
|
+
if (id) {
|
|
1295
|
+
$array.each(this.dataItems, (item) => {
|
|
1296
|
+
const linkTo = item.get("linkTo");
|
|
1297
|
+
if (linkTo && linkTo.includes(id)) {
|
|
1298
|
+
const links = item.get("links");
|
|
1299
|
+
if (links && links[id]) {
|
|
1300
|
+
const link = links[id];
|
|
1301
|
+
link.show(duration);
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
yield Promise.all(promises);
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* Disposes a data item and removes it from the series.
|
|
1311
|
+
*
|
|
1312
|
+
* @param dataItem Data item
|
|
1313
|
+
*/
|
|
1314
|
+
disposeDataItem(dataItem) {
|
|
1315
|
+
super.disposeDataItem(dataItem);
|
|
1316
|
+
const container = dataItem.get("container");
|
|
1317
|
+
if (container) {
|
|
1318
|
+
this.containers.removeValue(container);
|
|
1319
|
+
container.dispose();
|
|
1320
|
+
}
|
|
1321
|
+
const startBullet = dataItem.get("startBullet");
|
|
1322
|
+
if (startBullet) {
|
|
1323
|
+
this.startBullets.removeValue(startBullet);
|
|
1324
|
+
startBullet.dispose();
|
|
1325
|
+
}
|
|
1326
|
+
const endBullet = dataItem.get("endBullet");
|
|
1327
|
+
if (endBullet) {
|
|
1328
|
+
this.endBullets.removeValue(endBullet);
|
|
1329
|
+
endBullet.dispose();
|
|
1330
|
+
}
|
|
1331
|
+
const startGrip = dataItem.get("startGrip");
|
|
1332
|
+
if (startGrip) {
|
|
1333
|
+
this.startGrips.removeValue(startGrip);
|
|
1334
|
+
startGrip.dispose();
|
|
1335
|
+
}
|
|
1336
|
+
const endGrip = dataItem.get("endGrip");
|
|
1337
|
+
if (endGrip) {
|
|
1338
|
+
this.endGrips.removeValue(endGrip);
|
|
1339
|
+
endGrip.dispose();
|
|
1340
|
+
}
|
|
1341
|
+
const progressRectangle = dataItem.get("progressRectangle");
|
|
1342
|
+
if (progressRectangle) {
|
|
1343
|
+
this.progressRectangles.removeValue(progressRectangle);
|
|
1344
|
+
progressRectangle.dispose();
|
|
1345
|
+
}
|
|
1346
|
+
const zeroRectangle = dataItem.get("zeroRectangle");
|
|
1347
|
+
if (zeroRectangle) {
|
|
1348
|
+
this.zeroRectangles.removeValue(zeroRectangle);
|
|
1349
|
+
zeroRectangle.dispose();
|
|
1350
|
+
}
|
|
1351
|
+
const progressGrip = dataItem.get("progressGrip");
|
|
1352
|
+
if (progressGrip) {
|
|
1353
|
+
this.progressGrips.removeValue(progressGrip);
|
|
1354
|
+
progressGrip.dispose();
|
|
1355
|
+
}
|
|
1356
|
+
this.disposeLinks(dataItem);
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* Disposes all links of a data item and removes them from the series.
|
|
1360
|
+
*
|
|
1361
|
+
* @param dataItem Data item
|
|
1362
|
+
*/
|
|
1363
|
+
disposeLinks(dataItem) {
|
|
1364
|
+
const links = dataItem.get("links", {});
|
|
1365
|
+
if (links) {
|
|
1366
|
+
$object.each(links, (key, link) => {
|
|
1367
|
+
link.dispose();
|
|
1368
|
+
delete links[key];
|
|
1369
|
+
});
|
|
1370
|
+
dataItem.set("linkTo", []);
|
|
1371
|
+
}
|
|
1372
|
+
const id = dataItem.get("id", "");
|
|
1373
|
+
if (id) {
|
|
1374
|
+
$array.each(this.dataItems, (item) => {
|
|
1375
|
+
const linkTo = item.get("linkTo");
|
|
1376
|
+
if (linkTo && linkTo.includes(id)) {
|
|
1377
|
+
$array.remove(linkTo, id);
|
|
1378
|
+
const links = item.get("links");
|
|
1379
|
+
if (links && links[id]) {
|
|
1380
|
+
const link = links[id];
|
|
1381
|
+
this.links.removeValue(link);
|
|
1382
|
+
delete links[id];
|
|
1383
|
+
link.dispose();
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* Returns the duration of a data item in units.
|
|
1391
|
+
*
|
|
1392
|
+
* @param dataItem Data item
|
|
1393
|
+
* @return Duration in units
|
|
1394
|
+
*/
|
|
1395
|
+
getDataItemDuration(dataItem) {
|
|
1396
|
+
const openValueX = dataItem.get("openValueX", 0);
|
|
1397
|
+
let valueX = dataItem.get("valueX", 0);
|
|
1398
|
+
// if valueX is within weekend or holiday, round it to the end of a previous work day
|
|
1399
|
+
return Math.round((valueX - openValueX) / this.getUnitDuration()) - this.getHolidayCount(openValueX, valueX);
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Returns the depth of a data item in the hierarchy.
|
|
1403
|
+
*
|
|
1404
|
+
* @param dataItem Data item
|
|
1405
|
+
* @return Depth level
|
|
1406
|
+
*/
|
|
1407
|
+
getDepth(dataItem) {
|
|
1408
|
+
let depth = 0;
|
|
1409
|
+
let parent = dataItem.get("parent");
|
|
1410
|
+
while (parent) {
|
|
1411
|
+
depth++;
|
|
1412
|
+
parent = parent.get("parent");
|
|
1413
|
+
}
|
|
1414
|
+
return depth;
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Returns the end value of a data item, adjusting for holidays and weekends.
|
|
1418
|
+
*
|
|
1419
|
+
* @param openValue Open value in milliseconds
|
|
1420
|
+
* @param duration Duration in units
|
|
1421
|
+
* @return Adjusted end value in milliseconds
|
|
1422
|
+
*/
|
|
1423
|
+
getEndValue(openValue, duration) {
|
|
1424
|
+
let adjustedDuration = duration;
|
|
1425
|
+
const unitDuration = this.getUnitDuration();
|
|
1426
|
+
if (this.gantt.get("excludeWeekends", true)) {
|
|
1427
|
+
for (let i = 0; i < adjustedDuration; i++) {
|
|
1428
|
+
if (this.isHoliday(openValue + i * unitDuration)) {
|
|
1429
|
+
adjustedDuration++;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
return openValue + adjustedDuration * unitDuration;
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* Returns the open value of a data item, adjusting for holidays and weekends.
|
|
1437
|
+
*
|
|
1438
|
+
* @param openValue Open value in milliseconds
|
|
1439
|
+
* @return Adjusted open value
|
|
1440
|
+
*/
|
|
1441
|
+
getOpenValue(openValue) {
|
|
1442
|
+
if (this.gantt.get("excludeWeekends", true)) {
|
|
1443
|
+
while (this.isHoliday(openValue)) {
|
|
1444
|
+
openValue += this.getUnitDuration();
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
return openValue;
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Returns the duration of a unit in milliseconds.
|
|
1451
|
+
*
|
|
1452
|
+
* @return Duration in milliseconds
|
|
1453
|
+
*/
|
|
1454
|
+
getUnitDuration() {
|
|
1455
|
+
return $time.getDuration(this.gantt.get("durationUnit", "day"));
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1458
|
+
* Returns the count of holidays between two dates.
|
|
1459
|
+
*
|
|
1460
|
+
* @param start Start date in milliseconds
|
|
1461
|
+
* @param end End date in milliseconds
|
|
1462
|
+
* @return Count of holidays
|
|
1463
|
+
*/
|
|
1464
|
+
getHolidayCount(start, end) {
|
|
1465
|
+
let count = 0;
|
|
1466
|
+
let holiday = true;
|
|
1467
|
+
for (let i = end; i >= start; i -= this.getUnitDuration()) {
|
|
1468
|
+
if (!this.isHoliday(i)) {
|
|
1469
|
+
holiday = false;
|
|
1470
|
+
}
|
|
1471
|
+
else {
|
|
1472
|
+
if (!holiday && this.isHoliday(i)) {
|
|
1473
|
+
count++;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
return count;
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Checks if a given date is a holiday or weekend.
|
|
1481
|
+
*
|
|
1482
|
+
* @param value Date value in milliseconds
|
|
1483
|
+
* @return `true` if the date is a holiday or weekend, otherwise `false`
|
|
1484
|
+
*/
|
|
1485
|
+
isHoliday(value) {
|
|
1486
|
+
if (this.gantt.get("excludeWeekends", true)) {
|
|
1487
|
+
const holidays = this.gantt.get("holidays", []);
|
|
1488
|
+
const weekends = this.gantt.get("weekends", [0, 6]);
|
|
1489
|
+
const date = new Date(value);
|
|
1490
|
+
if (weekends.includes(date.getDay())) {
|
|
1491
|
+
return true;
|
|
1492
|
+
}
|
|
1493
|
+
if (holidays && holidays.length > 0) {
|
|
1494
|
+
let isHoliday = false;
|
|
1495
|
+
$array.eachContinue(holidays, (holiday) => {
|
|
1496
|
+
if (holiday instanceof Date) {
|
|
1497
|
+
const start = holiday.getTime();
|
|
1498
|
+
const end = holiday.getTime() + $time.getDuration("day");
|
|
1499
|
+
if (value >= start && value < end) {
|
|
1500
|
+
isHoliday = true;
|
|
1501
|
+
return false;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
return true;
|
|
1505
|
+
});
|
|
1506
|
+
return isHoliday;
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
return false;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
Object.defineProperty(GanttSeries, "className", {
|
|
1513
|
+
enumerable: true,
|
|
1514
|
+
configurable: true,
|
|
1515
|
+
writable: true,
|
|
1516
|
+
value: "GanttSeries"
|
|
1517
|
+
});
|
|
1518
|
+
Object.defineProperty(GanttSeries, "classNames", {
|
|
1519
|
+
enumerable: true,
|
|
1520
|
+
configurable: true,
|
|
1521
|
+
writable: true,
|
|
1522
|
+
value: ColumnSeries.classNames.concat([GanttSeries.className])
|
|
1523
|
+
});
|
|
1524
|
+
//# sourceMappingURL=GanttSeries.js.map
|