Skip to content

Upgrade d3-shape, d3-path to 3#1960

Merged
hshoff merged 5 commits intomasterfrom
hshoff-shape
Nov 4, 2025
Merged

Upgrade d3-shape, d3-path to 3#1960
hshoff merged 5 commits intomasterfrom
hshoff-shape

Conversation

@hshoff
Copy link
Member

@hshoff hshoff commented Nov 4, 2025

💥 Breaking Changes

  • deps: upgrade d3-shape, d3-path to 3

🚀 Enhancements

  • vendor: add d3-shape, d3-path to dependencies

- Updated package.json files across visx packages to replace direct d3-shape and d3-path dependencies with @visx/vendor
- Adjusted import statements in various components and utilities to source from @visx/vendor/d3-shape and @visx/vendor/d3-path
- Removed unnecessary d3-shape and d3-path dependencies from package.json files
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades d3-shape from v1.x to v3.2.0 by consolidating all d3-shape and d3-path dependencies into the @visx/vendor package. This change enables consistent versioning and simplifies dependency management across the visx monorepo.

Key changes:

  • Added d3-shape (3.2.0) and d3-path (3.1.0) to @visx/vendor package
  • Updated all imports across visx packages to use @visx/vendor/d3-shape and @visx/vendor/d3-path instead of direct dependencies
  • Modified the pie factory function to handle d3-shape v3's new default sorting behavior while maintaining visx's input order preservation

Reviewed Changes

Copilot reviewed 47 out of 48 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Added d3-shape 3.2.0 and d3-path 3.1.0 type definitions and packages, removed old versions and updated package dependency references
packages/visx-vendor/package.json Added d3-shape 3.2.0 and d3-path 3.1.0 along with their type definitions
packages/visx-vendor/.gitignore Added yarn files to ignore list since monorepo uses root lockfile
packages/visx-shape/src/util/D3ShapeFactories.ts Updated pie function to handle d3-shape v3's default sorting behavior
packages/visx-shape/test/Pie.test.tsx Removed test for invalid sort callback behavior
packages/visx-xychart/* Updated d3-shape imports to use @visx/vendor
packages/visx-stats/* Updated d3-shape imports to use @visx/vendor
packages/visx-shape/* Updated d3-shape and d3-path imports to use @visx/vendor
packages/visx-sankey/* Updated d3-shape imports to use @visx/vendor
packages/visx-glyph/* Updated d3-shape imports to use @visx/vendor
packages/visx-curve/* Updated d3-shape imports to use @visx/vendor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Size Changes

Package Diff ESM Prev ESM CJS Prev CJS
visx-curve +4.0% 336 B 323 B 1.44 KB 1.43 KB
visx-glyph +0.7% 11.97 KB 11.88 KB 15.41 KB 15.32 KB
visx-shape +0.8% 80.48 KB 79.86 KB 100.37 KB 99.75 KB
visx-stats +0.1% 12.58 KB 12.57 KB 13.66 KB 13.65 KB
visx-vendor 🔺 +19.3% 2.9 KB 2.43 KB 3.15 KB 2.64 KB
visx-xychart +0.0% 167.56 KB 167.55 KB 211.48 KB 211.47 KB

Compared to master. File sizes are unminified and ungzipped.

View raw build stats

Previous (master)

{
  "visx-annotation": {
    "esm": 28559,
    "lib": 36491
  },
  "visx-axis": {
    "esm": 20709,
    "lib": 25119
  },
  "visx-bounds": {
    "esm": 2662,
    "lib": 3136
  },
  "visx-brush": {
    "esm": 52910,
    "lib": 55596
  },
  "visx-chord": {
    "esm": 2663,
    "lib": 3373
  },
  "visx-clip-path": {
    "esm": 3394,
    "lib": 4415
  },
  "visx-curve": {
    "esm": 323,
    "lib": 1462
  },
  "visx-delaunay": {
    "esm": 2305,
    "lib": 3035
  },
  "visx-demo": {
    "esm": 0,
    "lib": 0
  },
  "visx-drag": {
    "esm": 12368,
    "lib": 13865
  },
  "visx-event": {
    "esm": 3815,
    "lib": 5091
  },
  "visx-geo": {
    "esm": 12450,
    "lib": 15408
  },
  "visx-glyph": {
    "esm": 12165,
    "lib": 15689
  },
  "visx-gradient": {
    "esm": 15496,
    "lib": 19482
  },
  "visx-grid": {
    "esm": 16678,
    "lib": 19853
  },
  "visx-group": {
    "esm": 1251,
    "lib": 1681
  },
  "visx-heatmap": {
    "esm": 6399,
    "lib": 7278
  },
  "visx-hierarchy": {
    "esm": 10161,
    "lib": 14656
  },
  "visx-legend": {
    "esm": 23920,
    "lib": 29153
  },
  "visx-marker": {
    "esm": 7834,
    "lib": 9673
  },
  "visx-mock-data": {
    "esm": 326036,
    "lib": 329336
  },
  "visx-network": {
    "esm": 4124,
    "lib": 5913
  },
  "visx-pattern": {
    "esm": 9161,
    "lib": 11621
  },
  "visx-point": {
    "esm": 1003,
    "lib": 1781
  },
  "visx-react-spring": {
    "esm": 13119,
    "lib": 16134
  },
  "visx-responsive": {
    "esm": 15447,
    "lib": 17439
  },
  "visx-sankey": {
    "esm": 3278,
    "lib": 4160
  },
  "visx-scale": {
    "esm": 19205,
    "lib": 30085
  },
  "visx-shape": {
    "esm": 81775,
    "lib": 102141
  },
  "visx-stats": {
    "esm": 12868,
    "lib": 13977
  },
  "visx-text": {
    "esm": 8309,
    "lib": 9806
  },
  "visx-threshold": {
    "esm": 2386,
    "lib": 2946
  },
  "visx-tooltip": {
    "esm": 13934,
    "lib": 18441
  },
  "visx-vendor": {
    "esm": 2492,
    "lib": 2702
  },
  "visx-visx": {
    "esm": 1524,
    "lib": 3989
  },
  "visx-voronoi": {
    "esm": 2013,
    "lib": 2621
  },
  "visx-wordcloud": {
    "esm": 2423,
    "lib": 3192
  },
  "visx-xychart": {
    "esm": 171572,
    "lib": 216544
  },
  "visx-zoom": {
    "esm": 16001,
    "lib": 18276
  }
}

Current

{
  "visx-annotation": {
    "esm": 28559,
    "lib": 36491
  },
  "visx-axis": {
    "esm": 20709,
    "lib": 25119
  },
  "visx-bounds": {
    "esm": 2662,
    "lib": 3136
  },
  "visx-brush": {
    "esm": 52910,
    "lib": 55596
  },
  "visx-chord": {
    "esm": 2663,
    "lib": 3373
  },
  "visx-clip-path": {
    "esm": 3394,
    "lib": 4415
  },
  "visx-curve": {
    "esm": 336,
    "lib": 1475
  },
  "visx-delaunay": {
    "esm": 2305,
    "lib": 3035
  },
  "visx-demo": {
    "esm": 0,
    "lib": 0
  },
  "visx-drag": {
    "esm": 12368,
    "lib": 13865
  },
  "visx-event": {
    "esm": 3815,
    "lib": 5091
  },
  "visx-geo": {
    "esm": 12450,
    "lib": 15408
  },
  "visx-glyph": {
    "esm": 12256,
    "lib": 15780
  },
  "visx-gradient": {
    "esm": 15496,
    "lib": 19482
  },
  "visx-grid": {
    "esm": 16678,
    "lib": 19853
  },
  "visx-group": {
    "esm": 1251,
    "lib": 1681
  },
  "visx-heatmap": {
    "esm": 6399,
    "lib": 7278
  },
  "visx-hierarchy": {
    "esm": 10161,
    "lib": 14656
  },
  "visx-legend": {
    "esm": 23920,
    "lib": 29153
  },
  "visx-marker": {
    "esm": 7834,
    "lib": 9673
  },
  "visx-mock-data": {
    "esm": 326036,
    "lib": 329336
  },
  "visx-network": {
    "esm": 4124,
    "lib": 5913
  },
  "visx-pattern": {
    "esm": 9161,
    "lib": 11621
  },
  "visx-point": {
    "esm": 1003,
    "lib": 1781
  },
  "visx-react-spring": {
    "esm": 13119,
    "lib": 16134
  },
  "visx-responsive": {
    "esm": 15447,
    "lib": 17439
  },
  "visx-sankey": {
    "esm": 3278,
    "lib": 4160
  },
  "visx-scale": {
    "esm": 19205,
    "lib": 30085
  },
  "visx-shape": {
    "esm": 82414,
    "lib": 102780
  },
  "visx-stats": {
    "esm": 12881,
    "lib": 13990
  },
  "visx-text": {
    "esm": 8309,
    "lib": 9806
  },
  "visx-threshold": {
    "esm": 2386,
    "lib": 2946
  },
  "visx-tooltip": {
    "esm": 13934,
    "lib": 18441
  },
  "visx-vendor": {
    "esm": 2974,
    "lib": 3226
  },
  "visx-visx": {
    "esm": 1524,
    "lib": 3989
  },
  "visx-voronoi": {
    "esm": 2013,
    "lib": 2621
  },
  "visx-wordcloud": {
    "esm": 2423,
    "lib": 3192
  },
  "visx-xychart": {
    "esm": 171585,
    "lib": 216557
  },
  "visx-zoom": {
    "esm": 16001,
    "lib": 18276
  }
}

@hshoff hshoff merged commit 3d408ad into master Nov 4, 2025
1 check passed
@hshoff hshoff deleted the hshoff-shape branch November 4, 2025 22:38
@github-actions
Copy link

🎉 This PR is included in version v4.0.0-alpha.0 of the packages modified 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants