@amcharts/amcharts5 5.17.0 → 5.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.internal/charts/map/MapSankeySeries.d.ts +29 -0
- package/.internal/charts/map/MapSankeySeries.d.ts.map +1 -1
- package/.internal/charts/map/MapSankeySeries.js +126 -52
- package/.internal/charts/map/MapSankeySeries.js.map +1 -1
- package/.internal/core/Registry.js +1 -1
- package/.internal/core/Registry.js.map +1 -1
- package/CHANGELOG.md +6 -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/package.json +1 -1
- package/examples/javascript/gantt-multilevel/package.json +1 -1
- package/examples/javascript/gantt-simple/package.json +1 -1
- package/examples/javascript/gauge/package.json +1 -1
- package/examples/javascript/gauge-bands/package.json +1 -1
- package/examples/javascript/hierarchy-force-directed/package.json +1 -1
- package/examples/javascript/hierarchy-pack/package.json +1 -1
- package/examples/javascript/hierarchy-partition/package.json +1 -1
- package/examples/javascript/hierarchy-sunburst/package.json +1 -1
- package/examples/javascript/hierarchy-tree/package.json +1 -1
- package/examples/javascript/hierarchy-treemap/package.json +1 -1
- package/examples/javascript/hierarchy-voronoi-treemap/package.json +1 -1
- package/examples/javascript/jest/package.json +1 -1
- package/examples/javascript/json-pie/package.json +1 -1
- package/examples/javascript/json-xy/package.json +1 -1
- package/examples/javascript/map-animating-along-lines/package.json +1 -1
- package/examples/javascript/map-clustered-points/package.json +1 -1
- package/examples/javascript/map-day-and-night/package.json +1 -1
- package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/javascript/map-sankey/index.js +48 -55
- package/examples/javascript/map-sankey/package.json +1 -1
- package/examples/javascript/map-sankey-waypoints/package.json +1 -1
- package/examples/javascript/map-with-bubbles/package.json +1 -1
- package/examples/javascript/map-zoom-to-country/package.json +1 -1
- package/examples/javascript/misc-40-charts/package.json +1 -1
- package/examples/javascript/misc-microchart-grid/package.json +1 -1
- package/examples/javascript/pie-chart/package.json +1 -1
- package/examples/javascript/pie-donut-chart/package.json +1 -1
- package/examples/javascript/pie-variable-radius/package.json +1 -1
- package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
- package/examples/javascript/radar-heat-map/package.json +1 -1
- package/examples/javascript/radar-line/package.json +1 -1
- package/examples/javascript/radar-time-line/package.json +1 -1
- package/examples/javascript/sliced-funnel/package.json +1 -1
- package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/javascript/sliced-pyramid/package.json +1 -1
- package/examples/javascript/stock-chart/package.json +1 -1
- package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
- package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
- package/examples/javascript/stock-chart-intraday/package.json +1 -1
- package/examples/javascript/stock-chart-live/package.json +1 -1
- package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/javascript/timeline-horizontal-serpentine-chart/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/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/package.json +1 -1
- package/examples/typescript/gantt-multilevel/package.json +1 -1
- package/examples/typescript/gantt-simple/package.json +1 -1
- package/examples/typescript/gauge/package.json +1 -1
- package/examples/typescript/gauge-bands/package.json +1 -1
- package/examples/typescript/hierarchy-force-directed/package.json +1 -1
- package/examples/typescript/hierarchy-pack/package.json +1 -1
- package/examples/typescript/hierarchy-partition/package.json +1 -1
- package/examples/typescript/hierarchy-sunburst/package.json +1 -1
- package/examples/typescript/hierarchy-tree/package.json +1 -1
- package/examples/typescript/hierarchy-treemap/package.json +1 -1
- package/examples/typescript/hierarchy-voronoi-treemap/package.json +1 -1
- package/examples/typescript/jest/package.json +1 -1
- package/examples/typescript/json-pie/package.json +1 -1
- package/examples/typescript/json-xy/package.json +1 -1
- package/examples/typescript/map-animating-along-lines/package.json +1 -1
- package/examples/typescript/map-clustered-points/package.json +1 -1
- package/examples/typescript/map-day-and-night/package.json +1 -1
- package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/typescript/map-sankey/index.ts +48 -55
- package/examples/typescript/map-sankey/package.json +1 -1
- package/examples/typescript/map-sankey-waypoints/package.json +1 -1
- package/examples/typescript/map-with-bubbles/package.json +1 -1
- package/examples/typescript/map-zoom-to-country/package.json +1 -1
- package/examples/typescript/misc-40-charts/package.json +1 -1
- package/examples/typescript/misc-microchart-grid/package.json +1 -1
- package/examples/typescript/pie-chart/package.json +1 -1
- package/examples/typescript/pie-donut-chart/package.json +1 -1
- package/examples/typescript/pie-variable-radius/package.json +1 -1
- package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
- package/examples/typescript/radar-heat-map/package.json +1 -1
- package/examples/typescript/radar-line/package.json +1 -1
- package/examples/typescript/radar-time-line/package.json +1 -1
- package/examples/typescript/sliced-funnel/package.json +1 -1
- package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/typescript/sliced-pyramid/package.json +1 -1
- package/examples/typescript/stock-chart/package.json +1 -1
- package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
- package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
- package/examples/typescript/stock-chart-intraday/package.json +1 -1
- package/examples/typescript/stock-chart-live/package.json +1 -1
- package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/typescript/timeline-horizontal-serpentine-chart/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/package.json +1 -1
- package/examples/typescript/xy-clustered-column/package.json +1 -1
- package/examples/typescript/xy-column/package.json +1 -1
- package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/typescript/xy-data-grouping/package.json +1 -1
- package/examples/typescript/xy-draggable-range/package.json +1 -1
- package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/typescript/xy-dumbbell plot/package.json +1 -1
- package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/typescript/xy-line/package.json +1 -1
- package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/typescript/xy-live-data/package.json +1 -1
- package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/typescript/xy-ohlc/package.json +1 -1
- package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/typescript/xy-smoothed-line/package.json +1 -1
- package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/typescript/xy-stacked-column/package.json +1 -1
- package/examples/typescript/xy-stacked-step/package.json +1 -1
- package/examples/typescript/xy-stock/package.json +1 -1
- package/examples/typescript/xy-stock-comparing/package.json +1 -1
- package/package.json +1 -1
|
@@ -265,10 +265,28 @@ export declare class MapSankeySeries extends MapPolygonSeries {
|
|
|
265
265
|
private _geoNodeRange;
|
|
266
266
|
private _geoSourceOffsets;
|
|
267
267
|
private _geoTargetOffsets;
|
|
268
|
+
/**
|
|
269
|
+
* Disposer for the polygonSeries `datavalidated` listener. Re-attached
|
|
270
|
+
* whenever the `polygonSeries` setting changes.
|
|
271
|
+
*/
|
|
272
|
+
private _polygonSeriesDP?;
|
|
268
273
|
/**
|
|
269
274
|
* @ignore
|
|
270
275
|
*/
|
|
271
276
|
protected _afterNew(): void;
|
|
277
|
+
/**
|
|
278
|
+
* (Re)subscribes to the current `polygonSeries` `datavalidated` event so
|
|
279
|
+
* that any data items added before the polygon series finished loading
|
|
280
|
+
* its geoJSON get their endpoints resolved automatically.
|
|
281
|
+
*/
|
|
282
|
+
private _setupPolygonSeriesListener;
|
|
283
|
+
/**
|
|
284
|
+
* Walks all data items and resolves any whose source/target endpoints
|
|
285
|
+
* weren't resolved during the initial `processDataItem` call (because
|
|
286
|
+
* the polygon series wasn't ready yet). Marks values dirty so the
|
|
287
|
+
* geometries get regenerated.
|
|
288
|
+
*/
|
|
289
|
+
private _resolvePendingDataItems;
|
|
272
290
|
static className: string;
|
|
273
291
|
static classNames: Array<string>;
|
|
274
292
|
_settings: IMapSankeySeriesSettings;
|
|
@@ -364,6 +382,17 @@ export declare class MapSankeySeries extends MapPolygonSeries {
|
|
|
364
382
|
* @param dataItem Data item to process
|
|
365
383
|
*/
|
|
366
384
|
protected processDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
|
|
385
|
+
/**
|
|
386
|
+
* Resolves the source/target endpoints for a single data item:
|
|
387
|
+
* looks up centroids on the polygon series (if `sourceId`/`targetId` is set),
|
|
388
|
+
* then creates or attaches the appropriate sankey nodes.
|
|
389
|
+
*
|
|
390
|
+
* Returns `true` if anything was newly resolved, so callers can decide
|
|
391
|
+
* whether to mark geometries dirty.
|
|
392
|
+
*
|
|
393
|
+
* Safe to call repeatedly: skips endpoints that are already resolved.
|
|
394
|
+
*/
|
|
395
|
+
private _resolveEndpoints;
|
|
367
396
|
/**
|
|
368
397
|
* @ignore
|
|
369
398
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapSankeySeries.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/charts/map/MapSankeySeries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"MapSankeySeries.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/charts/map/MapSankeySeries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACtI,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAO3E;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAwB,SAAQ,wBAAwB;CACxE;AAED,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IAE1E;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;I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AM,GAAG,iBAAiB;IA4BlG;;OAEG;IACI,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAQzG;;;OAGG;IACI,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,wBAAwB,CAAC,GAAG,MAAM;IAQ1E;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAyBxB;;;;OAIG;IACI,eAAe,CAAC,MAAM,EAAE,MAAM;IA4BrC;;OAEG;IACI,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAMpE;;OAEG;IACH,SAAS,CAAC,QAAQ;IAoBlB;;;;;OAKG;IACH,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAWvE;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IA6EzB;;OAEG;IACH,SAAS,CAAC,YAAY;IAetB;;OAEG;IACI,gBAAgB;IAOvB;;;;;OAKG;IACH,SAAS,CAAC,mBAAmB;CAsZ7B"}
|
|
@@ -71,7 +71,58 @@ export class MapSankeySeries extends MapPolygonSeries {
|
|
|
71
71
|
this._setRawDefault("valueField", "value");
|
|
72
72
|
this._setRawDefault("waypointsField", "waypoints");
|
|
73
73
|
this.nodes.flow = this;
|
|
74
|
+
// Watch for polygonSeries changes — re-attach the datavalidated
|
|
75
|
+
// listener so users don't have to wait for the polygon series to
|
|
76
|
+
// be ready before calling sankey.data.setAll().
|
|
77
|
+
this.on("polygonSeries", () => {
|
|
78
|
+
this._setupPolygonSeriesListener();
|
|
79
|
+
});
|
|
74
80
|
super._afterNew();
|
|
81
|
+
// Initial setup in case polygonSeries was passed in constructor settings.
|
|
82
|
+
this._setupPolygonSeriesListener();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* (Re)subscribes to the current `polygonSeries` `datavalidated` event so
|
|
86
|
+
* that any data items added before the polygon series finished loading
|
|
87
|
+
* its geoJSON get their endpoints resolved automatically.
|
|
88
|
+
*/
|
|
89
|
+
_setupPolygonSeriesListener() {
|
|
90
|
+
if (this._polygonSeriesDP) {
|
|
91
|
+
this._polygonSeriesDP.dispose();
|
|
92
|
+
this._polygonSeriesDP = undefined;
|
|
93
|
+
}
|
|
94
|
+
const polygonSeries = this.get("polygonSeries");
|
|
95
|
+
if (polygonSeries) {
|
|
96
|
+
this._polygonSeriesDP = polygonSeries.events.on("datavalidated", () => {
|
|
97
|
+
this._resolvePendingDataItems();
|
|
98
|
+
});
|
|
99
|
+
// If the polygon series already has data items (e.g. it was
|
|
100
|
+
// validated before our data was set), resolve immediately.
|
|
101
|
+
if (polygonSeries.dataItems.length > 0) {
|
|
102
|
+
this._resolvePendingDataItems();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Walks all data items and resolves any whose source/target endpoints
|
|
108
|
+
* weren't resolved during the initial `processDataItem` call (because
|
|
109
|
+
* the polygon series wasn't ready yet). Marks values dirty so the
|
|
110
|
+
* geometries get regenerated.
|
|
111
|
+
*/
|
|
112
|
+
_resolvePendingDataItems() {
|
|
113
|
+
let anyResolved = false;
|
|
114
|
+
$array.each(this.dataItems, (dataItem) => {
|
|
115
|
+
if (this._resolveEndpoints(dataItem)) {
|
|
116
|
+
anyResolved = true;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
if (anyResolved) {
|
|
120
|
+
// Trigger geometry regeneration on next validation cycle.
|
|
121
|
+
// Mirrors Component.markDirtyValues without the parent's
|
|
122
|
+
// MapPolygon geometry sync (handled later in _generateGeometries).
|
|
123
|
+
this._valuesDirty = true;
|
|
124
|
+
this.markDirty();
|
|
125
|
+
}
|
|
75
126
|
}
|
|
76
127
|
/**
|
|
77
128
|
* @ignore
|
|
@@ -285,6 +336,10 @@ export class MapSankeySeries extends MapPolygonSeries {
|
|
|
285
336
|
*/
|
|
286
337
|
_dispose() {
|
|
287
338
|
super._dispose();
|
|
339
|
+
if (this._polygonSeriesDP) {
|
|
340
|
+
this._polygonSeriesDP.dispose();
|
|
341
|
+
this._polygonSeriesDP = undefined;
|
|
342
|
+
}
|
|
288
343
|
this._bezierSegments.clear();
|
|
289
344
|
this._segmentCumulativeLengths.clear();
|
|
290
345
|
this._geoSourceCoords.clear();
|
|
@@ -311,67 +366,86 @@ export class MapSankeySeries extends MapPolygonSeries {
|
|
|
311
366
|
dataItem.set("geometry", { type: "Polygon", coordinates: [] });
|
|
312
367
|
}
|
|
313
368
|
super.processDataItem(dataItem);
|
|
369
|
+
this._resolveEndpoints(dataItem);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Resolves the source/target endpoints for a single data item:
|
|
373
|
+
* looks up centroids on the polygon series (if `sourceId`/`targetId` is set),
|
|
374
|
+
* then creates or attaches the appropriate sankey nodes.
|
|
375
|
+
*
|
|
376
|
+
* Returns `true` if anything was newly resolved, so callers can decide
|
|
377
|
+
* whether to mark geometries dirty.
|
|
378
|
+
*
|
|
379
|
+
* Safe to call repeatedly: skips endpoints that are already resolved.
|
|
380
|
+
*/
|
|
381
|
+
_resolveEndpoints(dataItem) {
|
|
314
382
|
const polygonSeries = this.get("polygonSeries");
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
|
|
383
|
+
let resolved = false;
|
|
384
|
+
// -- Source --
|
|
385
|
+
if (!dataItem.get("sourceNode")) {
|
|
386
|
+
let sourceLon = dataItem.get("sourceLongitude");
|
|
387
|
+
let sourceLat = dataItem.get("sourceLatitude");
|
|
388
|
+
const sourceId = dataItem.get("sourceId");
|
|
389
|
+
if (sourceId && polygonSeries) {
|
|
390
|
+
const polygonDI = polygonSeries.getDataItemById(sourceId);
|
|
391
|
+
if (polygonDI) {
|
|
392
|
+
const geometry = polygonDI.get("geometry");
|
|
393
|
+
if (geometry) {
|
|
394
|
+
const centroid = getGeoCentroid(geometry);
|
|
395
|
+
sourceLon = centroid.longitude;
|
|
396
|
+
sourceLat = centroid.latitude;
|
|
397
|
+
}
|
|
327
398
|
}
|
|
328
399
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
if (
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
400
|
+
if (sourceLon != null && sourceLat != null) {
|
|
401
|
+
const sourceKey = sourceId !== null && sourceId !== void 0 ? sourceId : (Number(sourceLon) + "," + Number(sourceLat));
|
|
402
|
+
let sourceNode = this.nodes.getDataItemById(sourceKey);
|
|
403
|
+
if (!sourceNode) {
|
|
404
|
+
const ctx = dataItem.dataContext;
|
|
405
|
+
const name = (ctx && ctx.source) || sourceKey;
|
|
406
|
+
this.nodes.data.push({ id: sourceKey, name, longitude: Number(sourceLon), latitude: Number(sourceLat) });
|
|
407
|
+
sourceNode = this.nodes.dataItems[this.nodes.dataItems.length - 1];
|
|
408
|
+
}
|
|
409
|
+
if (sourceNode) {
|
|
410
|
+
dataItem.setRaw("sourceNode", sourceNode);
|
|
411
|
+
this.nodes.addOutgoingLink(sourceNode, dataItem);
|
|
412
|
+
resolved = true;
|
|
342
413
|
}
|
|
343
414
|
}
|
|
344
415
|
}
|
|
345
|
-
//
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
let
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
// Create/find target node
|
|
361
|
-
if (targetLon != null && targetLat != null) {
|
|
362
|
-
const targetKey = targetId !== null && targetId !== void 0 ? targetId : (Number(targetLon) + "," + Number(targetLat));
|
|
363
|
-
let targetNode = this.nodes.getDataItemById(targetKey);
|
|
364
|
-
if (!targetNode) {
|
|
365
|
-
const ctx = dataItem.dataContext;
|
|
366
|
-
const name = (ctx && ctx.target) || targetKey;
|
|
367
|
-
this.nodes.data.push({ id: targetKey, name, longitude: Number(targetLon), latitude: Number(targetLat) });
|
|
368
|
-
targetNode = this.nodes.dataItems[this.nodes.dataItems.length - 1];
|
|
416
|
+
// -- Target --
|
|
417
|
+
if (!dataItem.get("targetNode")) {
|
|
418
|
+
let targetLon = dataItem.get("targetLongitude");
|
|
419
|
+
let targetLat = dataItem.get("targetLatitude");
|
|
420
|
+
const targetId = dataItem.get("targetId");
|
|
421
|
+
if (targetId && polygonSeries) {
|
|
422
|
+
const polygonDI = polygonSeries.getDataItemById(targetId);
|
|
423
|
+
if (polygonDI) {
|
|
424
|
+
const geometry = polygonDI.get("geometry");
|
|
425
|
+
if (geometry) {
|
|
426
|
+
const centroid = getGeoCentroid(geometry);
|
|
427
|
+
targetLon = centroid.longitude;
|
|
428
|
+
targetLat = centroid.latitude;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
369
431
|
}
|
|
370
|
-
if (
|
|
371
|
-
|
|
372
|
-
this.nodes.
|
|
432
|
+
if (targetLon != null && targetLat != null) {
|
|
433
|
+
const targetKey = targetId !== null && targetId !== void 0 ? targetId : (Number(targetLon) + "," + Number(targetLat));
|
|
434
|
+
let targetNode = this.nodes.getDataItemById(targetKey);
|
|
435
|
+
if (!targetNode) {
|
|
436
|
+
const ctx = dataItem.dataContext;
|
|
437
|
+
const name = (ctx && ctx.target) || targetKey;
|
|
438
|
+
this.nodes.data.push({ id: targetKey, name, longitude: Number(targetLon), latitude: Number(targetLat) });
|
|
439
|
+
targetNode = this.nodes.dataItems[this.nodes.dataItems.length - 1];
|
|
440
|
+
}
|
|
441
|
+
if (targetNode) {
|
|
442
|
+
dataItem.setRaw("targetNode", targetNode);
|
|
443
|
+
this.nodes.addIncomingLink(targetNode, dataItem);
|
|
444
|
+
resolved = true;
|
|
445
|
+
}
|
|
373
446
|
}
|
|
374
447
|
}
|
|
448
|
+
return resolved;
|
|
375
449
|
}
|
|
376
450
|
/**
|
|
377
451
|
* @ignore
|