@genesislcap/g2plot-chart 14.424.0 → 14.424.1-alpha-cfc2887.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/dist/custom-elements.json +23 -0
- package/dist/dts/chart-datasource/chart-datasource.d.ts +5 -1
- package/dist/dts/chart-datasource/chart-datasource.d.ts.map +1 -1
- package/dist/dts/chart.d.ts.map +1 -1
- package/dist/esm/chart-datasource/chart-datasource.js +29 -4
- package/dist/esm/chart.js +4 -1
- package/dist/g2plot-chart.d.ts +5 -1
- package/package.json +14 -14
|
@@ -827,6 +827,29 @@
|
|
|
827
827
|
"description": "Attribute to set an unique identifier for the row.",
|
|
828
828
|
"privacy": "public"
|
|
829
829
|
},
|
|
830
|
+
{
|
|
831
|
+
"kind": "field",
|
|
832
|
+
"name": "connectionSub",
|
|
833
|
+
"type": {
|
|
834
|
+
"text": "Subscription | undefined"
|
|
835
|
+
},
|
|
836
|
+
"privacy": "private"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"kind": "method",
|
|
840
|
+
"name": "initAndFetch",
|
|
841
|
+
"privacy": "private"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"kind": "method",
|
|
845
|
+
"name": "subscribeToConnection",
|
|
846
|
+
"privacy": "private"
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"kind": "method",
|
|
850
|
+
"name": "unsubscribeFromConnection",
|
|
851
|
+
"privacy": "private"
|
|
852
|
+
},
|
|
830
853
|
{
|
|
831
854
|
"kind": "method",
|
|
832
855
|
"name": "prepareSeriesField",
|
|
@@ -506,10 +506,14 @@ export declare class ChartDatasource extends ChartDatasource_base {
|
|
|
506
506
|
* @public
|
|
507
507
|
*/
|
|
508
508
|
rowId: string;
|
|
509
|
+
private connectionSub;
|
|
509
510
|
/**
|
|
510
511
|
* @internal
|
|
511
512
|
*/
|
|
512
|
-
connectedCallback():
|
|
513
|
+
connectedCallback(): void;
|
|
514
|
+
private initAndFetch;
|
|
515
|
+
private subscribeToConnection;
|
|
516
|
+
private unsubscribeFromConnection;
|
|
513
517
|
/**
|
|
514
518
|
* @internal
|
|
515
519
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-datasource.d.ts","sourceRoot":"","sources":["../../../src/chart-datasource/chart-datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"chart-datasource.d.ts","sourceRoot":"","sources":["../../../src/chart-datasource/chart-datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAIrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAO5C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAQhD,cAAM,kBAAmB,SAAQ,cAAc;IAC7C,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAC7B,SAAS,CAAC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAC1C,SAAS,CAAC,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAChE,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC;IACnC,SAAS,CAAC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAC1C,SAAS,CAAC,iBAAiB,UAAS;IACpC,SAAS,CAAC,OAAO,UAAQ;IAEzB,IAAI,sBAAsB,IAAI,MAAM,CAEnC;I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;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;sBAMtB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { DatasourceDefaults } from '@genesislcap/foundation-comms';
|
|
|
3
3
|
import { createLogger } from '@genesislcap/foundation-logger';
|
|
4
4
|
import { BaseDatasource } from '@genesislcap/foundation-ui';
|
|
5
5
|
import { LifecycleMixin } from '@genesislcap/foundation-utils';
|
|
6
|
-
import { attr, customElement, observable } from '@microsoft/fast-element';
|
|
6
|
+
import { DOM, attr, customElement, observable } from '@microsoft/fast-element';
|
|
7
7
|
import { chartDatasourceEventNames } from './chart-datasource.config';
|
|
8
8
|
import { extractFields, getFormattedDateGroupBy, getReduced } from './chart-datasource.utils';
|
|
9
9
|
const logger = createLogger('chart-datasource');
|
|
@@ -165,11 +165,16 @@ let ChartDatasource = class ChartDatasource extends LifecycleMixin(ConcreteDatas
|
|
|
165
165
|
* @internal
|
|
166
166
|
*/
|
|
167
167
|
connectedCallback() {
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
super.connectedCallback();
|
|
169
|
+
const shouldRunConnect = this.shouldRunConnect;
|
|
170
|
+
DOM.queueUpdate(() => {
|
|
171
|
+
if (!shouldRunConnect)
|
|
172
|
+
return;
|
|
173
|
+
void this.initAndFetch();
|
|
170
174
|
});
|
|
175
|
+
}
|
|
176
|
+
initAndFetch() {
|
|
171
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
-
_super.connectedCallback.call(this);
|
|
173
178
|
this.chart = this.parentElement;
|
|
174
179
|
this.extractedServerFields = extractFields(this.serverFields);
|
|
175
180
|
this.extractedChartsFields = extractFields(this.chartFields);
|
|
@@ -194,11 +199,30 @@ let ChartDatasource = class ChartDatasource extends LifecycleMixin(ConcreteDatas
|
|
|
194
199
|
});
|
|
195
200
|
return;
|
|
196
201
|
}
|
|
202
|
+
// Subscribe first so we catch the case where isConnected is still false
|
|
203
|
+
// when this runs (e.g. design-system-provider Connect not yet established).
|
|
204
|
+
this.subscribeToConnection();
|
|
197
205
|
if (this.chart && this.resourceName && this.connect.isConnected) {
|
|
198
206
|
this.fetchGenesisData(false);
|
|
199
207
|
}
|
|
200
208
|
});
|
|
201
209
|
}
|
|
210
|
+
subscribeToConnection() {
|
|
211
|
+
var _a, _b;
|
|
212
|
+
if (!((_a = this.connect) === null || _a === void 0 ? void 0 : _a.isConnected$))
|
|
213
|
+
return;
|
|
214
|
+
(_b = this.connectionSub) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
215
|
+
this.connectionSub = this.connect.isConnected$.subscribe((isConnected) => {
|
|
216
|
+
if (isConnected && this.chart && this.resourceName && !this.dataSub) {
|
|
217
|
+
void this.fetchGenesisData(false);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
unsubscribeFromConnection() {
|
|
222
|
+
var _a;
|
|
223
|
+
(_a = this.connectionSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
224
|
+
this.connectionSub = undefined;
|
|
225
|
+
}
|
|
202
226
|
/**
|
|
203
227
|
* @internal
|
|
204
228
|
*/
|
|
@@ -217,6 +241,7 @@ let ChartDatasource = class ChartDatasource extends LifecycleMixin(ConcreteDatas
|
|
|
217
241
|
disconnectedCallback() {
|
|
218
242
|
if (!this.shouldRunDisconnect)
|
|
219
243
|
return;
|
|
244
|
+
this.unsubscribeFromConnection();
|
|
220
245
|
super.disconnectedCallback();
|
|
221
246
|
}
|
|
222
247
|
// ChartDatasource's specifics
|
package/dist/esm/chart.js
CHANGED
|
@@ -172,7 +172,10 @@ export class G2PlotChart extends LifecycleMixin(FoundationElement) {
|
|
|
172
172
|
this.removeEventListener(key, action);
|
|
173
173
|
});
|
|
174
174
|
DOM.queueUpdate(() => {
|
|
175
|
-
if
|
|
175
|
+
// Skip destroy if the element reconnected before this deferred callback ran
|
|
176
|
+
// (e.g. a dockview panel move). The new connectedCallback already created a
|
|
177
|
+
// fresh G2Plot instance; destroying it here would leave the chart dead.
|
|
178
|
+
if (!shouldRunDisconnect || this.isConnected)
|
|
176
179
|
return;
|
|
177
180
|
if (this.chart) {
|
|
178
181
|
this.chart.off('*', this.eventHandler);
|
package/dist/g2plot-chart.d.ts
CHANGED
|
@@ -149,10 +149,14 @@ export declare class ChartDatasource extends ChartDatasource_base {
|
|
|
149
149
|
* @public
|
|
150
150
|
*/
|
|
151
151
|
rowId: string;
|
|
152
|
+
private connectionSub;
|
|
152
153
|
/**
|
|
153
154
|
* @internal
|
|
154
155
|
*/
|
|
155
|
-
connectedCallback():
|
|
156
|
+
connectedCallback(): void;
|
|
157
|
+
private initAndFetch;
|
|
158
|
+
private subscribeToConnection;
|
|
159
|
+
private unsubscribeFromConnection;
|
|
156
160
|
/**
|
|
157
161
|
* @internal
|
|
158
162
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/g2plot-chart",
|
|
3
3
|
"description": "Genesis G2plot Chart",
|
|
4
|
-
"version": "14.424.0",
|
|
4
|
+
"version": "14.424.1-alpha-cfc2887.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -53,21 +53,21 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@genesislcap/foundation-testing": "14.424.0",
|
|
57
|
-
"@genesislcap/genx": "14.424.0",
|
|
58
|
-
"@genesislcap/rollup-builder": "14.424.0",
|
|
59
|
-
"@genesislcap/ts-builder": "14.424.0",
|
|
60
|
-
"@genesislcap/uvu-playwright-builder": "14.424.0",
|
|
61
|
-
"@genesislcap/vite-builder": "14.424.0",
|
|
62
|
-
"@genesislcap/webpack-builder": "14.424.0"
|
|
56
|
+
"@genesislcap/foundation-testing": "14.424.1-alpha-cfc2887.0",
|
|
57
|
+
"@genesislcap/genx": "14.424.1-alpha-cfc2887.0",
|
|
58
|
+
"@genesislcap/rollup-builder": "14.424.1-alpha-cfc2887.0",
|
|
59
|
+
"@genesislcap/ts-builder": "14.424.1-alpha-cfc2887.0",
|
|
60
|
+
"@genesislcap/uvu-playwright-builder": "14.424.1-alpha-cfc2887.0",
|
|
61
|
+
"@genesislcap/vite-builder": "14.424.1-alpha-cfc2887.0",
|
|
62
|
+
"@genesislcap/webpack-builder": "14.424.1-alpha-cfc2887.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@antv/g2plot": "^2.4.32",
|
|
66
|
-
"@genesislcap/foundation-comms": "14.424.0",
|
|
67
|
-
"@genesislcap/foundation-logger": "14.424.0",
|
|
68
|
-
"@genesislcap/foundation-ui": "14.424.0",
|
|
69
|
-
"@genesislcap/foundation-utils": "14.424.0",
|
|
70
|
-
"@genesislcap/foundation-zero": "14.424.0",
|
|
66
|
+
"@genesislcap/foundation-comms": "14.424.1-alpha-cfc2887.0",
|
|
67
|
+
"@genesislcap/foundation-logger": "14.424.1-alpha-cfc2887.0",
|
|
68
|
+
"@genesislcap/foundation-ui": "14.424.1-alpha-cfc2887.0",
|
|
69
|
+
"@genesislcap/foundation-utils": "14.424.1-alpha-cfc2887.0",
|
|
70
|
+
"@genesislcap/foundation-zero": "14.424.1-alpha-cfc2887.0",
|
|
71
71
|
"@microsoft/fast-element": "1.14.0",
|
|
72
72
|
"@microsoft/fast-foundation": "2.50.0"
|
|
73
73
|
},
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@microsoft/fast-react-wrapper": ">=0.3.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "0460a55fc4d9bde4d0e6e11db51125a371bf5b4d"
|
|
98
98
|
}
|