@datatechsolutions/ui 2.9.6 → 2.9.7

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.
@@ -12149,6 +12149,8 @@ var MAP_DEFAULT_STATE_COLOR = "rgba(100, 116, 139, 0.35)";
12149
12149
  var MAP_DEFAULT_MARKER_COLOR = "#6366f1";
12150
12150
  var VIEWBOX_WIDTH = 1e3;
12151
12151
  var VIEWBOX_HEIGHT = 500;
12152
+ var ALBERS_WIDTH = 960;
12153
+ var ALBERS_HEIGHT = 600;
12152
12154
  function GeoMapCanvasInner({
12153
12155
  regionGroups,
12154
12156
  regionColorMap,
@@ -12251,8 +12253,7 @@ function GeoMapCanvasInner({
12251
12253
  const projection = React12.useMemo(() => {
12252
12254
  if (!featureCollection) return null;
12253
12255
  if (projectionType === "albersUsa") {
12254
- const scaleFactor = VIEWBOX_WIDTH / 960;
12255
- return d3Geo.geoAlbersUsa().scale(1070 * scaleFactor * 0.9).translate([VIEWBOX_WIDTH / 2, VIEWBOX_HEIGHT / 2]);
12256
+ return d3Geo.geoAlbersUsa();
12256
12257
  }
12257
12258
  return d3Geo.geoMercator().fitSize([VIEWBOX_WIDTH, VIEWBOX_HEIGHT], featureCollection);
12258
12259
  }, [featureCollection, projectionType]);
@@ -12266,13 +12267,15 @@ function GeoMapCanvasInner({
12266
12267
  const hasAnyActiveFilter = React12.useMemo(() => {
12267
12268
  return regionGroups.some((regionData) => isRegionActive?.(regionData.code));
12268
12269
  }, [regionGroups, isRegionActive]);
12270
+ const effectiveWidth = projectionType === "albersUsa" ? ALBERS_WIDTH : VIEWBOX_WIDTH;
12271
+ const effectiveHeight = projectionType === "albersUsa" ? ALBERS_HEIGHT : VIEWBOX_HEIGHT;
12269
12272
  const viewBoxParts = React12.useMemo(() => {
12270
- const width = VIEWBOX_WIDTH / zoom;
12271
- const height = VIEWBOX_HEIGHT / zoom;
12272
- const x2 = (VIEWBOX_WIDTH - width) / 2 - panOffset[0];
12273
- const y2 = (VIEWBOX_HEIGHT - height) / 2 - panOffset[1];
12273
+ const width = effectiveWidth / zoom;
12274
+ const height = effectiveHeight / zoom;
12275
+ const x2 = (effectiveWidth - width) / 2 - panOffset[0];
12276
+ const y2 = (effectiveHeight - height) / 2 - panOffset[1];
12274
12277
  return { x: x2, y: y2, width, height };
12275
- }, [zoom, panOffset]);
12278
+ }, [zoom, panOffset, effectiveWidth, effectiveHeight]);
12276
12279
  const viewBox = `${viewBoxParts.x} ${viewBoxParts.y} ${viewBoxParts.width} ${viewBoxParts.height}`;
12277
12280
  return /* @__PURE__ */ jsxRuntime.jsx(
12278
12281
  "div",
@@ -23885,5 +23888,5 @@ exports.useGeoMapState = useGeoMapState;
23885
23888
  exports.useNotifications = useNotifications;
23886
23889
  exports.usePlatformShellStore = usePlatformShellStore;
23887
23890
  exports.usePullToRefresh = usePullToRefresh;
23888
- //# sourceMappingURL=chunk-ZPG2UAZR.js.map
23889
- //# sourceMappingURL=chunk-ZPG2UAZR.js.map
23891
+ //# sourceMappingURL=chunk-ZSITK566.js.map
23892
+ //# sourceMappingURL=chunk-ZSITK566.js.map