@trackunit/react-map 0.2.211 → 0.2.213-alpha-3bf54986a78.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/index.cjs.js
CHANGED
|
@@ -5888,11 +5888,12 @@ const useFitToContent = (api, handles, options) => {
|
|
|
5888
5888
|
};
|
|
5889
5889
|
|
|
5890
5890
|
/**
|
|
5891
|
-
* Single dev-warning channel for
|
|
5891
|
+
* Single dev-warning channel for react-map hooks (invalid data, invalid style, unhandled render errors).
|
|
5892
|
+
* Messages are prefixed with the emitting hook, e.g. `[useHeatmap]`.
|
|
5892
5893
|
*/
|
|
5893
|
-
const
|
|
5894
|
-
// eslint-disable-next-line no-console -- Intentional: the one
|
|
5895
|
-
console.warn(`[
|
|
5894
|
+
const consoleWarnMap = (source, message, ...details) => {
|
|
5895
|
+
// eslint-disable-next-line no-console -- Intentional: the one react-map warning channel; invalid input is dropped or defaulted and render errors without onError must stay visible
|
|
5896
|
+
console.warn(`[${source}] ${message}`, ...details);
|
|
5896
5897
|
};
|
|
5897
5898
|
|
|
5898
5899
|
/**
|
|
@@ -5930,7 +5931,7 @@ const normalizeHeatmapData = ({ data, getPosition, getWeight, }) => {
|
|
|
5930
5931
|
});
|
|
5931
5932
|
}
|
|
5932
5933
|
if (invalidPositionCount > 0 || invalidWeightCount > 0) {
|
|
5933
|
-
|
|
5934
|
+
consoleWarnMap("useHeatmap", `Filtered ${invalidPositionCount} item(s) with invalid position and ${invalidWeightCount} item(s) with invalid weight. Expected [longitude, latitude] with longitude between -180 and 180, latitude between -90 and 90, and a finite weight >= 0.`);
|
|
5934
5935
|
}
|
|
5935
5936
|
return {
|
|
5936
5937
|
features: { type: "FeatureCollection", features },
|
|
@@ -5993,7 +5994,7 @@ const resolveColorRange = (colorRange) => {
|
|
|
5993
5994
|
const valid = parsed.filter(sharedUtils.nonNullable);
|
|
5994
5995
|
if (colorRange.length >= 2 && valid.length === parsed.length)
|
|
5995
5996
|
return valid;
|
|
5996
|
-
|
|
5997
|
+
consoleWarnMap("useHeatmap", "colorRange needs at least two supported colours (#rgb, #rrggbb, #rrggbbaa, rgb(), rgba()); using the default.", colorRange);
|
|
5997
5998
|
return DEFAULT_PARSED_COLOR_RANGE;
|
|
5998
5999
|
};
|
|
5999
6000
|
const HEATMAP_STYLE_RULES = {
|
|
@@ -6026,7 +6027,7 @@ const resolveHeatmapStyle = (style) => {
|
|
|
6026
6027
|
colorRange: resolveColorRange(style?.colorRange),
|
|
6027
6028
|
};
|
|
6028
6029
|
if (nonFiniteKeys.length > 0) {
|
|
6029
|
-
|
|
6030
|
+
consoleWarnMap("useHeatmap", `Non-finite style value(s) for ${nonFiniteKeys.join(", ")} replaced with defaults.`);
|
|
6030
6031
|
}
|
|
6031
6032
|
return resolved;
|
|
6032
6033
|
};
|
|
@@ -6068,12 +6069,12 @@ const useHeatmap = (options) => {
|
|
|
6068
6069
|
handler(error);
|
|
6069
6070
|
}
|
|
6070
6071
|
catch (handlerError) {
|
|
6071
|
-
|
|
6072
|
+
consoleWarnMap("useHeatmap", `onError for heatmap "${error.layerId}" threw.`, handlerError, error.cause);
|
|
6072
6073
|
captureOnce(`${error.layerId}:on-error-threw`, `Heatmap onError threw: ${payload}`, handlerError, "on-error-threw");
|
|
6073
6074
|
}
|
|
6074
6075
|
return;
|
|
6075
6076
|
}
|
|
6076
|
-
|
|
6077
|
+
consoleWarnMap("useHeatmap", `Heatmap "${error.layerId}" failed to render (${error.code}).`, error.cause);
|
|
6077
6078
|
}, [captureOnce]);
|
|
6078
6079
|
// Keyed on `data` (adjust-state-during-render + isEqual) so inline accessors
|
|
6079
6080
|
// don't re-normalize the whole dataset on every render. Accessor changes
|
package/index.esm.js
CHANGED
|
@@ -5887,11 +5887,12 @@ const useFitToContent = (api, handles, options) => {
|
|
|
5887
5887
|
};
|
|
5888
5888
|
|
|
5889
5889
|
/**
|
|
5890
|
-
* Single dev-warning channel for
|
|
5890
|
+
* Single dev-warning channel for react-map hooks (invalid data, invalid style, unhandled render errors).
|
|
5891
|
+
* Messages are prefixed with the emitting hook, e.g. `[useHeatmap]`.
|
|
5891
5892
|
*/
|
|
5892
|
-
const
|
|
5893
|
-
// eslint-disable-next-line no-console -- Intentional: the one
|
|
5894
|
-
console.warn(`[
|
|
5893
|
+
const consoleWarnMap = (source, message, ...details) => {
|
|
5894
|
+
// eslint-disable-next-line no-console -- Intentional: the one react-map warning channel; invalid input is dropped or defaulted and render errors without onError must stay visible
|
|
5895
|
+
console.warn(`[${source}] ${message}`, ...details);
|
|
5895
5896
|
};
|
|
5896
5897
|
|
|
5897
5898
|
/**
|
|
@@ -5929,7 +5930,7 @@ const normalizeHeatmapData = ({ data, getPosition, getWeight, }) => {
|
|
|
5929
5930
|
});
|
|
5930
5931
|
}
|
|
5931
5932
|
if (invalidPositionCount > 0 || invalidWeightCount > 0) {
|
|
5932
|
-
|
|
5933
|
+
consoleWarnMap("useHeatmap", `Filtered ${invalidPositionCount} item(s) with invalid position and ${invalidWeightCount} item(s) with invalid weight. Expected [longitude, latitude] with longitude between -180 and 180, latitude between -90 and 90, and a finite weight >= 0.`);
|
|
5933
5934
|
}
|
|
5934
5935
|
return {
|
|
5935
5936
|
features: { type: "FeatureCollection", features },
|
|
@@ -5992,7 +5993,7 @@ const resolveColorRange = (colorRange) => {
|
|
|
5992
5993
|
const valid = parsed.filter(nonNullable);
|
|
5993
5994
|
if (colorRange.length >= 2 && valid.length === parsed.length)
|
|
5994
5995
|
return valid;
|
|
5995
|
-
|
|
5996
|
+
consoleWarnMap("useHeatmap", "colorRange needs at least two supported colours (#rgb, #rrggbb, #rrggbbaa, rgb(), rgba()); using the default.", colorRange);
|
|
5996
5997
|
return DEFAULT_PARSED_COLOR_RANGE;
|
|
5997
5998
|
};
|
|
5998
5999
|
const HEATMAP_STYLE_RULES = {
|
|
@@ -6025,7 +6026,7 @@ const resolveHeatmapStyle = (style) => {
|
|
|
6025
6026
|
colorRange: resolveColorRange(style?.colorRange),
|
|
6026
6027
|
};
|
|
6027
6028
|
if (nonFiniteKeys.length > 0) {
|
|
6028
|
-
|
|
6029
|
+
consoleWarnMap("useHeatmap", `Non-finite style value(s) for ${nonFiniteKeys.join(", ")} replaced with defaults.`);
|
|
6029
6030
|
}
|
|
6030
6031
|
return resolved;
|
|
6031
6032
|
};
|
|
@@ -6067,12 +6068,12 @@ const useHeatmap = (options) => {
|
|
|
6067
6068
|
handler(error);
|
|
6068
6069
|
}
|
|
6069
6070
|
catch (handlerError) {
|
|
6070
|
-
|
|
6071
|
+
consoleWarnMap("useHeatmap", `onError for heatmap "${error.layerId}" threw.`, handlerError, error.cause);
|
|
6071
6072
|
captureOnce(`${error.layerId}:on-error-threw`, `Heatmap onError threw: ${payload}`, handlerError, "on-error-threw");
|
|
6072
6073
|
}
|
|
6073
6074
|
return;
|
|
6074
6075
|
}
|
|
6075
|
-
|
|
6076
|
+
consoleWarnMap("useHeatmap", `Heatmap "${error.layerId}" failed to render (${error.code}).`, error.cause);
|
|
6076
6077
|
}, [captureOnce]);
|
|
6077
6078
|
// Keyed on `data` (adjust-state-during-render + isEqual) so inline accessors
|
|
6078
6079
|
// don't re-normalize the whole dataset on every render. Accessor changes
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-map",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.213-alpha-3bf54986a78.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/react-components": "3.8.
|
|
11
|
-
"@trackunit/css-class-variance-utilities": "2.3.
|
|
12
|
-
"@trackunit/react-form-components": "2.10.
|
|
13
|
-
"@trackunit/react-core-hooks": "1.25.
|
|
14
|
-
"@trackunit/geo-json-utils": "1.18.
|
|
15
|
-
"@trackunit/i18n-library-translation": "2.8.
|
|
10
|
+
"@trackunit/react-components": "3.8.6-alpha-3bf54986a78.0",
|
|
11
|
+
"@trackunit/css-class-variance-utilities": "2.3.7-alpha-3bf54986a78.0",
|
|
12
|
+
"@trackunit/react-form-components": "2.10.13-alpha-3bf54986a78.0",
|
|
13
|
+
"@trackunit/react-core-hooks": "1.25.8-alpha-3bf54986a78.0",
|
|
14
|
+
"@trackunit/geo-json-utils": "1.18.7-alpha-3bf54986a78.0",
|
|
15
|
+
"@trackunit/i18n-library-translation": "2.8.8-alpha-3bf54986a78.0",
|
|
16
16
|
"react-minimal-pie-chart": "^8.4.0",
|
|
17
|
-
"@trackunit/react-map-adapter-shared": "0.0.
|
|
18
|
-
"@trackunit/react-map-color-utils": "0.0.
|
|
19
|
-
"@trackunit/shared-utils": "1.19.
|
|
20
|
-
"@trackunit/ui-design-tokens": "1.18.
|
|
17
|
+
"@trackunit/react-map-adapter-shared": "0.0.159-alpha-3bf54986a78.0",
|
|
18
|
+
"@trackunit/react-map-color-utils": "0.0.133-alpha-3bf54986a78.0",
|
|
19
|
+
"@trackunit/shared-utils": "1.19.7-alpha-3bf54986a78.0",
|
|
20
|
+
"@trackunit/ui-design-tokens": "1.18.7-alpha-3bf54986a78.0",
|
|
21
21
|
"@floating-ui/react": "^0.26.25",
|
|
22
22
|
"es-toolkit": "^1.52.0",
|
|
23
23
|
"tailwind-merge": "^2.0.0",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single dev-warning channel for react-map hooks (invalid data, invalid style, unhandled render errors).
|
|
3
|
+
* Messages are prefixed with the emitting hook, e.g. `[useHeatmap]`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const consoleWarnMap: (source: string, message: string, ...details: ReadonlyArray<unknown>) => void;
|