@xh/hoist 78.0.0-SNAPSHOT.1761848630542 → 78.0.0-SNAPSHOT.1762201137843
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/build/types/core/persist/PersistOptions.d.ts +2 -2
- package/cmp/chart/impl/copyToClipboard.ts +6 -13
- package/cmp/treemap/TreeMap.ts +10 -2
- package/cmp/treemap/TreeMapModel.ts +2 -2
- package/core/persist/PersistOptions.ts +2 -2
- package/kit/highcharts/index.ts +2 -2
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -35,12 +35,12 @@ export interface PersistOptions {
|
|
|
35
35
|
viewManagerModel?: ViewManagerModel;
|
|
36
36
|
/**
|
|
37
37
|
* Function returning blob of data to be used for reading state.
|
|
38
|
-
* Ignored if `prefKey`, `localStorageKey
|
|
38
|
+
* Ignored if `prefKey`, `localStorageKey`, `dashViewModel` or 'viewManagerModel' are provided.
|
|
39
39
|
*/
|
|
40
40
|
getData?: () => any;
|
|
41
41
|
/**
|
|
42
42
|
* Function to be used to write blob of data representing state.
|
|
43
|
-
* Ignored if `prefKey`, `localStorageKey
|
|
43
|
+
* Ignored if `prefKey`, `localStorageKey`, `dashViewModel` or 'viewManagerModel' are provided.
|
|
44
44
|
*/
|
|
45
45
|
setData?: (data: object) => void;
|
|
46
46
|
}
|
|
@@ -24,14 +24,14 @@ export function installCopyToClipboard(Highcharts) {
|
|
|
24
24
|
try {
|
|
25
25
|
const blobPromise = convertChartToPngAsync(this),
|
|
26
26
|
clipboardItemInput = new window.ClipboardItem({
|
|
27
|
-
// Safari requires an unresolved promise.
|
|
27
|
+
// Safari requires an unresolved promise. See https://bugs.webkit.org/show_bug.cgi?id=222262 for discussion
|
|
28
28
|
'image/png': Highcharts.isSafari ? blobPromise : await blobPromise
|
|
29
29
|
});
|
|
30
30
|
await window.navigator.clipboard.write([clipboardItemInput]);
|
|
31
31
|
XH.successToast('Chart copied to clipboard');
|
|
32
32
|
} catch (e) {
|
|
33
33
|
XH.handleException(e, {showAlert: false, logOnServer: true});
|
|
34
|
-
XH.dangerToast('Error: Chart could not be copied.
|
|
34
|
+
XH.dangerToast('Error: Chart could not be copied. This error has been logged.');
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -41,14 +41,7 @@ export function installCopyToClipboard(Highcharts) {
|
|
|
41
41
|
// Implementation
|
|
42
42
|
//------------------
|
|
43
43
|
async function convertChartToPngAsync(chart) {
|
|
44
|
-
const svg =
|
|
45
|
-
chart.getSVGForLocalExport(
|
|
46
|
-
chart.options.exporting,
|
|
47
|
-
{},
|
|
48
|
-
() => reject('Cannot fallback to export server'),
|
|
49
|
-
svg => resolve(svg)
|
|
50
|
-
)
|
|
51
|
-
),
|
|
44
|
+
const svg = chart.getSVG(),
|
|
52
45
|
svgUrl = svgToDataUrl(svg),
|
|
53
46
|
pngDataUrl = await svgUrlToPngDataUrlAsync(svgUrl),
|
|
54
47
|
ret = await loadBlob(pngDataUrl);
|
|
@@ -65,7 +58,7 @@ function memoryCleanup(svgUrl) {
|
|
|
65
58
|
}
|
|
66
59
|
|
|
67
60
|
/**
|
|
68
|
-
* Convert dataUri
|
|
61
|
+
* Convert dataUri to blob
|
|
69
62
|
*/
|
|
70
63
|
async function loadBlob(dataUrl) {
|
|
71
64
|
const fetched = await fetch(dataUrl);
|
|
@@ -84,7 +77,7 @@ function svgToDataUrl(svg) {
|
|
|
84
77
|
try {
|
|
85
78
|
// Safari requires data URI since it doesn't allow navigation to blob
|
|
86
79
|
// URLs.
|
|
87
|
-
// foreignObjects
|
|
80
|
+
// foreignObjects don't work well in Blobs in Chrome (#14780).
|
|
88
81
|
if (!isWebKitButNotChrome && svg.indexOf('<foreignObject') === -1) {
|
|
89
82
|
return domurl.createObjectURL(
|
|
90
83
|
new window.Blob([svg], {
|
|
@@ -94,7 +87,7 @@ function svgToDataUrl(svg) {
|
|
|
94
87
|
}
|
|
95
88
|
} catch (e) {}
|
|
96
89
|
|
|
97
|
-
//
|
|
90
|
+
// Safari, Firefox, or SVGs with foreignObect returns this
|
|
98
91
|
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg);
|
|
99
92
|
}
|
|
100
93
|
|
package/cmp/treemap/TreeMap.ts
CHANGED
|
@@ -172,7 +172,6 @@ class TreeMapLocalModel extends HoistModel {
|
|
|
172
172
|
this.prevConfig = cloneDeep(chartCfg);
|
|
173
173
|
this.createChart(config);
|
|
174
174
|
}
|
|
175
|
-
|
|
176
175
|
this.updateLabelVisibility();
|
|
177
176
|
}
|
|
178
177
|
|
|
@@ -199,9 +198,18 @@ class TreeMapLocalModel extends HoistModel {
|
|
|
199
198
|
});
|
|
200
199
|
}
|
|
201
200
|
|
|
201
|
+
// Reload series data by fully removing and re-adding the series.
|
|
202
|
+
// When treemap clustering is enabled, `setData()` & `series.update()` does not properly clear old cluster nodes,
|
|
203
|
+
// causing overlap or stale rendering. Removing and re-adding the series forces a full rebuild
|
|
204
|
+
// of the layout and clustering state, ensuring the chart is correctly redrawn.
|
|
202
205
|
@logWithDebug
|
|
203
206
|
reloadSeriesData(newData) {
|
|
204
|
-
|
|
207
|
+
const {chart} = this;
|
|
208
|
+
if (!chart) return;
|
|
209
|
+
const oldSeries = chart.series[0],
|
|
210
|
+
series = Highcharts.merge(oldSeries.userOptions, {data: newData});
|
|
211
|
+
oldSeries.remove(false);
|
|
212
|
+
chart.addSeries(series, true);
|
|
205
213
|
}
|
|
206
214
|
|
|
207
215
|
startResize = ({width, height}) => {
|
|
@@ -465,7 +465,7 @@ export class TreeMapModel extends HoistModel {
|
|
|
465
465
|
//----------------------
|
|
466
466
|
defaultOnClick = (record, e) => {
|
|
467
467
|
const {gridModel} = this;
|
|
468
|
-
if (!gridModel) return;
|
|
468
|
+
if (!gridModel || !record) return;
|
|
469
469
|
|
|
470
470
|
// Select nodes in grid
|
|
471
471
|
const {selModel} = gridModel;
|
|
@@ -477,7 +477,7 @@ export class TreeMapModel extends HoistModel {
|
|
|
477
477
|
};
|
|
478
478
|
|
|
479
479
|
defaultOnDoubleClick = record => {
|
|
480
|
-
if (!this.gridModel?.treeMode || isEmpty(record
|
|
480
|
+
if (!this.gridModel?.treeMode || isEmpty(record?.children)) return;
|
|
481
481
|
this.toggleNodeExpanded(record.treePath);
|
|
482
482
|
};
|
|
483
483
|
}
|
|
@@ -59,13 +59,13 @@ export interface PersistOptions {
|
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Function returning blob of data to be used for reading state.
|
|
62
|
-
* Ignored if `prefKey`, `localStorageKey
|
|
62
|
+
* Ignored if `prefKey`, `localStorageKey`, `dashViewModel` or 'viewManagerModel' are provided.
|
|
63
63
|
*/
|
|
64
64
|
getData?: () => any;
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Function to be used to write blob of data representing state.
|
|
68
|
-
* Ignored if `prefKey`, `localStorageKey
|
|
68
|
+
* Ignored if `prefKey`, `localStorageKey`, `dashViewModel` or 'viewManagerModel' are provided.
|
|
69
69
|
*/
|
|
70
70
|
setData?: (data: object) => void;
|
|
71
71
|
}
|
package/kit/highcharts/index.ts
CHANGED
|
@@ -9,8 +9,8 @@ import {checkVersion, logError} from '@xh/hoist/utils/js';
|
|
|
9
9
|
|
|
10
10
|
export let Highcharts = null;
|
|
11
11
|
|
|
12
|
-
const MIN_VERSION = '
|
|
13
|
-
const MAX_VERSION = '
|
|
12
|
+
const MIN_VERSION = '12.4.0';
|
|
13
|
+
const MAX_VERSION = '12.*.*';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Expose application versions of Highcharts to Hoist.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "78.0.0-SNAPSHOT.
|
|
3
|
+
"version": "78.0.0-SNAPSHOT.1762201137843",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|