@automattic/charts 4.5.0 → 4.6.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/CHANGELOG.md CHANGED
@@ -5,16 +5,21 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.6.0] - 2026-09-29
9
+ ### Added
10
+ - Geo Chart: Add a displayMode prop to draw rows as markers. [#52859]
11
+
8
12
  ## [4.5.0] - 2026-09-28
9
13
  ### Added
10
14
  - GeoChart: Add a `domain` prop that draws disputed borders from a given country's viewpoint. [#52805]
11
15
 
12
16
  ### Deprecated
13
- - Deprecate getColorDistance, which is not perceptual and is no longer used to generate palette colors. [#52680]
17
+ - Deprecate `getColorDistance`, which is no longer used to generate palette colors. [#52680]
14
18
 
15
19
  ### Fixed
16
20
  - Bar chart: End a keyboard selection when the pointer moves over the chart, instead of flickering between the hovered and selected bars. [#52821]
17
- - Keep generated series colors distinguishable from each other, including for color-blind viewers, and legible on the chart background; pick pie label text that contrasts with each slice. [#52680]
21
+ - Keep generated series colors distinguishable from each other, including for color-blind viewers, and legible on the chart background. [#52680]
22
+ - Pick pie label text that contrasts with each slice. [#52680]
18
23
 
19
24
  ## [4.4.0] - 2026-09-23
20
25
  ### Added
@@ -1126,6 +1131,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1126
1131
  - Fixed lints following ESLint rule changes for TS [#40584]
1127
1132
  - Fixing a bug in Chart storybook data. [#40640]
1128
1133
 
1134
+ [4.6.0]: https://github.com/Automattic/charts/compare/v4.5.0...v4.6.0
1129
1135
  [4.5.0]: https://github.com/Automattic/charts/compare/v4.4.0...v4.5.0
1130
1136
  [4.4.0]: https://github.com/Automattic/charts/compare/v4.3.0...v4.4.0
1131
1137
  [4.3.0]: https://github.com/Automattic/charts/compare/v4.2.0...v4.3.0
package/dist/index.cjs CHANGED
@@ -7345,13 +7345,14 @@ function normalizeGeoChartError(eventArgs) {
7345
7345
  * @param props.height - Height of the chart in pixels
7346
7346
  * @param props.region - Region to display ('world', 'US', or ISO 3166-1 alpha-2 code)
7347
7347
  * @param props.resolution - Resolution level ('countries', 'provinces', or 'metros')
7348
+ * @param props.displayMode - Plot rows as shaded areas ('regions') or markers ('markers')
7348
7349
  * @param props.domain - Country code whose viewpoint sets the disputed borders
7349
7350
  * @param props.onError - Optional callback for Google Charts errors
7350
7351
  * @param props.className - Additional CSS class name for the chart container
7351
7352
  * @param props.renderPlaceholder - Optional render function for the loading placeholder
7352
7353
  * @return A React component displaying an interactive map with data visualization
7353
7354
  */
7354
- const GeoChartInternal = ({ className, data, width, height, region = "world", resolution = "countries", domain, onError, renderPlaceholder }) => {
7355
+ const GeoChartInternal = ({ className, data, width, height, region = "world", resolution = "countries", displayMode = "regions", domain, onError, renderPlaceholder }) => {
7355
7356
  const { getElementStyles } = useGlobalChartsContext();
7356
7357
  const scopeElement = useChartScopeElement();
7357
7358
  const containerRef = (0, react.useRef)(null);
@@ -7415,6 +7416,7 @@ const GeoChartInternal = ({ className, data, width, height, region = "world", re
7415
7416
  const options = (0, react.useMemo)(() => ({
7416
7417
  ...region !== "world" && { region },
7417
7418
  ...resolution !== "countries" && { resolution },
7419
+ ...displayMode !== "regions" && { displayMode },
7418
7420
  ...domain && { domain },
7419
7421
  colorAxis: { colors: [lightColorHex, fullColorHex] },
7420
7422
  backgroundColor: backgroundColorHex,
@@ -7429,6 +7431,7 @@ const GeoChartInternal = ({ className, data, width, height, region = "world", re
7429
7431
  }), [
7430
7432
  region,
7431
7433
  resolution,
7434
+ displayMode,
7432
7435
  domain,
7433
7436
  lightColorHex,
7434
7437
  fullColorHex,