@dynatrace/strato-geo 1.11.1 → 2.0.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.
@@ -12,8 +12,7 @@ const ColorScaleProvider = ({
12
12
  if (isEmpty(legend)) {
13
13
  return /* @__PURE__ */ jsx(Fragment, { children });
14
14
  }
15
- const categoriesArray = "categories" in legend && legend.categories ? legend.categories : categories;
16
- const scale = buildScaleFromLegendConfig(legend, categoriesArray, dataMax);
15
+ const scale = buildScaleFromLegendConfig(legend, categories, dataMax);
17
16
  return /* @__PURE__ */ jsx(ColorScaleContext.Provider, { value: scale, children });
18
17
  };
19
18
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/map/providers/color-scale.provider.tsx"],
4
- "sourcesContent": ["import { isEmpty } from 'lodash-es';\nimport { type PropsWithChildren } from 'react';\n\nimport { ColorScaleContext } from '../contexts/color-scale.context.js';\nimport { useMapConfig } from '../hooks/use-map-config.js';\nimport { buildScaleFromLegendConfig } from '../utils/build-scale-from-legend-config.js';\n\n/**\n * This provider will hold the scale used to map from a value of the domain\n * to a color in the color palette (range) or undefined in case is out of the\n * domain. This is valid if the consumer set a layer to be colored by the\n * legend, else this provider will be undefined.\n * As we use different scales, the consumer (of this provider) will need to\n * set some type guards to ensure ts compliance.\n * Because of that and to ease the consumption of this provider, we created\n * another one that make use of this scale.\n * @see {@link LayerColorStrategyProvider}\n * @example to build a legend the raw scale could be needed\n * @param categories - Available categories to be shown in the legend\n * @param dataMax - Maximum value present in the data\n * @param children -\n */\nexport const ColorScaleProvider = ({\n categories,\n dataMax,\n children,\n}: PropsWithChildren<{\n categories: string[];\n dataMax: number;\n}>) => {\n const { legend } = useMapConfig();\n\n if (isEmpty(legend)) {\n return <>{children}</>;\n }\n\n /**\n * prop categories will be deprecated, details:\n * https://dt-rnd.atlassian.net/browse/APPDEV-11805\n * Remove categoriesArray after this, and use category prop\n */\n const categoriesArray =\n 'categories' in legend && legend.categories\n ? legend.categories\n : categories;\n\n const scale = buildScaleFromLegendConfig(legend, categoriesArray, dataMax);\n\n return (\n <ColorScaleContext.Provider value={scale}>\n {children}\n </ColorScaleContext.Provider>\n );\n};\n"],
5
- "mappings": "AAiCW;AAjCX,SAAS,eAAe;AAGxB,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,kCAAkC;AAiBpC,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF,MAGO;AACL,QAAM,EAAE,OAAO,IAAI,aAAa;AAEhC,MAAI,QAAQ,MAAM,GAAG;AACnB,WAAO,gCAAG,UAAS;AAAA,EACrB;AAOA,QAAM,kBACJ,gBAAgB,UAAU,OAAO,aAC7B,OAAO,aACP;AAEN,QAAM,QAAQ,2BAA2B,QAAQ,iBAAiB,OAAO;AAEzE,SACE,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,OAChC,UACH;AAEJ;",
4
+ "sourcesContent": ["import { isEmpty } from 'lodash-es';\nimport { type PropsWithChildren } from 'react';\n\nimport { ColorScaleContext } from '../contexts/color-scale.context.js';\nimport { useMapConfig } from '../hooks/use-map-config.js';\nimport { buildScaleFromLegendConfig } from '../utils/build-scale-from-legend-config.js';\n\n/**\n * This provider will hold the scale used to map from a value of the domain\n * to a color in the color palette (range) or undefined in case is out of the\n * domain. This is valid if the consumer set a layer to be colored by the\n * legend, else this provider will be undefined.\n * As we use different scales, the consumer (of this provider) will need to\n * set some type guards to ensure ts compliance.\n * Because of that and to ease the consumption of this provider, we created\n * another one that make use of this scale.\n * @see {@link LayerColorStrategyProvider}\n * @example to build a legend the raw scale could be needed\n * @param categories - Available categories to be shown in the legend\n * @param dataMax - Maximum value present in the data\n * @param children -\n */\nexport const ColorScaleProvider = ({\n categories,\n dataMax,\n children,\n}: PropsWithChildren<{\n categories: string[];\n dataMax: number;\n}>) => {\n const { legend } = useMapConfig();\n\n if (isEmpty(legend)) {\n return <>{children}</>;\n }\n\n const scale = buildScaleFromLegendConfig(legend, categories, dataMax);\n\n return (\n <ColorScaleContext.Provider value={scale}>\n {children}\n </ColorScaleContext.Provider>\n );\n};\n"],
5
+ "mappings": "AAiCW;AAjCX,SAAS,eAAe;AAGxB,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,kCAAkC;AAiBpC,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF,MAGO;AACL,QAAM,EAAE,OAAO,IAAI,aAAa;AAEhC,MAAI,QAAQ,MAAM,GAAG;AACnB,WAAO,gCAAG,UAAS;AAAA,EACrB;AAEA,QAAM,QAAQ,2BAA2B,QAAQ,YAAY,OAAO;AAEpE,SACE,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,OAChC,UACH;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -35,7 +35,6 @@ const ColorScaleProvider = ({
35
35
  if ((0, import_lodash_es.isEmpty)(legend)) {
36
36
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
37
37
  }
38
- const categoriesArray = "categories" in legend && legend.categories ? legend.categories : categories;
39
- const scale = (0, import_build_scale_from_legend_config.buildScaleFromLegendConfig)(legend, categoriesArray, dataMax);
38
+ const scale = (0, import_build_scale_from_legend_config.buildScaleFromLegendConfig)(legend, categories, dataMax);
40
39
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_color_scale_context.ColorScaleContext.Provider, { value: scale, children });
41
40
  };
@@ -21,8 +21,6 @@ export interface SequentialLegendProps extends BaseLegendProps {
21
21
  * @public
22
22
  */
23
23
  export interface CategoricalLegendProps extends BaseLegendProps {
24
- /** Available categories to be shown in the legend */
25
- categories?: string[];
26
24
  /** The color palette to apply to the legend */
27
25
  colorPalette: string[] | ColorPalette | {
28
26
  [key: string]: string;
@@ -54,8 +52,6 @@ export interface CategoricalLegendConfig extends BaseLegendConfig {
54
52
  colorPalette: string[] | ColorPalette | {
55
53
  [p: string]: string;
56
54
  };
57
- /** categories prop will be deprecated */
58
- categories?: string[];
59
55
  }
60
56
  export interface ThresholdLegendConfig extends BaseLegendConfig {
61
57
  type: 'threshold';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace/strato-geo",
3
- "version": "1.11.1",
3
+ "version": "2.0.1",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "lang": "lang/uncompiled",
@@ -33,27 +33,37 @@
33
33
  "@turf/rhumb-bearing": "^6.5.0",
34
34
  "@vanilla-extract/css": "^1.17.4",
35
35
  "@vanilla-extract/recipes": "^0.5.7",
36
+ "@vis.gl/react-maplibre": "^8.0.0",
36
37
  "d3-array": "^3.2.4",
37
38
  "d3-interpolate": "^3.0.1",
38
39
  "d3-scale": "^4.0.2",
39
- "maplibre-gl": "^5.0.0",
40
- "@vis.gl/react-maplibre": "^8.0.0"
40
+ "maplibre-gl": "^5.0.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@dynatrace-sdk/client-classic-environment-v2": "^3.6.1",
44
- "@dynatrace-sdk/client-platform-management-service": "^1.6.0",
43
+ "@dynatrace-sdk/client-classic-environment-v2": "^3.7.3",
44
+ "@dynatrace-sdk/client-platform-management-service": "^1.7.0",
45
45
  "@dynatrace-sdk/units": "^1.0.2",
46
46
  "react": "^18.0.0",
47
47
  "react-dom": "^18.0.0",
48
48
  "react-intl": "^6.0.8 || ^7.0.0",
49
49
  "react-is": "^18.0.0",
50
50
  "@dynatrace/strato-components": "^1.8.0",
51
+ "@dynatrace/strato-components-preview": "^2.0.1",
51
52
  "@dynatrace/strato-design-tokens": "^1.1.0",
52
- "@dynatrace/strato-components-preview": "^1.11.1",
53
53
  "@dynatrace/strato-icons": "^1.6.0"
54
54
  },
55
55
  "sideEffects": [
56
56
  "./map/styles/react-mapgl-styles.css",
57
57
  "./esm/map/styles/react-mapgl-styles.css"
58
- ]
58
+ ],
59
+ "dt": {
60
+ "breakingChanges": [
61
+ {
62
+ "title": "2.0.0 Breaking Changes",
63
+ "version": "2.0.0",
64
+ "description": "**General**\n- Removed deprecated testing subpackage. Please use the `@dynatrace/strato-geo-testing` package now. (APPDEV-11839)\n\n**MapView**\n- Removed deprecated `categories` from `CategoricalLegendProps`. (APPDEV-11805)",
65
+ "linkToGuide": "https://developer.dynatrace.com/release-notes/design-system/components-preview-changelog/#200"
66
+ }
67
+ ]
68
+ }
59
69
  }