Vigia

Actualizar d3-cloud de 1.x a 2.x

Comparación de la API pública de d3-cloud 1.2.9 y 2.0.0, calculada automáticamente a partir de sus tipos TypeScript. Una firma modificada es un posible cambio incompatible, no una certeza.

Resumen

Rutas de importación eliminadas0
Exports eliminados0
Firmas modificadas0
Miembros de clases o interfaces eliminados0
Miembros de clases o interfaces modificados0
Nuevas deprecaciones0
Cambios de requisitos (engines, dependencias peer)1
Exports nuevos23

Exports eliminados

No se detectaron.

Firmas modificadas

No se detectaron.

Miembros de clases o interfaces eliminados

No se detectaron.

Miembros de clases o interfaces modificados

No se detectaron.

Nuevas deprecaciones

No se detectaron.

Cambios de requisitos (engines, dependencias peer)

AntesDespués
engines.node—>=20
Exports nuevos (23)
importexportkind
d3-cloudBoundstype
d3-clouddefaultclass
d3-cloudImageLiketype
d3-cloudCanvasLikeinterface
d3-cloudTextSourcetype
d3-cloudBoundsPointinterface
d3-cloudCloudLayoutclass
d3-cloudCloudSpriteclass
d3-cloudPlaceOptionsinterface
d3-cloudPlacedSpriteinterface
d3-cloudRandomSourcetype
d3-cloudStrategyNametype
d3-cloudStrategySeedinterface
d3-cloudnoneStrategyfunction
d3-cloudCanvasFactorytype
d3-cloudSpriteOptionsinterface
d3-cloudStrategyContextinterface
d3-cloudStrategyFactorytype
d3-cloudStrategyCandidatetype
d3-cloudStrategyGeneratortype
d3-cloudImageSpriteOptionsinterface
d3-cloudarchimedeanStrategyfunction
d3-cloudrectangularStrategyfunction

Changelog entre estas versiones

Texto publicado por los autores del paquete, mostrado tal cual.

2.0.0
See the [1.x to 2.x migration guide](./MIGRATING.md) before upgrading.
Dependencies constrained to 1.x continue to use the old API.

### Breaking

- Set the minimum Node.js version to 20, matching the CI test matrix.
- Switched the package to ESM-only publishing and removed the old Browserify /
  CommonJS distribution shape.
- Removed the UMD/script-tag build, the `d3.layout.cloud` global, and the
  `d3-dispatch` dependency. Browser scripts must use ESM imports.
- Changed the default rotation from random multiples of 30 degrees to zero,
  and the default font size from `sqrt(value)` to 1. Set styling explicitly.
- Input word objects are no longer mutated. Placement returns separate plain
  words, and callers control the word ordering.
- Custom data is carried in a single `datum` option, stored by reference on
  sprites and placed words. Other option fields are ignored rather than copied
  onto sprites and results, so built-in field names are no longer reserved.
- Replaced the old event-driven factory API (`start()`, `stop()`, `on()`,
  `words()`, `timeInterval()`, accessor-based text/font configuration) with the
  class-based `CloudLayout` / `CloudSprite` API.
- Replaced the old `spiral()` API with `strategy()`.
- Moved source files under `src/` and renamed the browser bundle to
  `build/d3-cloud.js`.
- Changed placement configuration so `size([width, height])` defines the
  centered layout box, while `overflow(true | false)` controls whether
  placement may extend beyond that box.
- Text padding now uses round stroke joins instead of the canvas default miter
  joins, so padding extends exactly `padding` pixels from the glyph outline
  rather than up to ten times that at sharp corners. Padded masks, and layouts
  that depend on them, differ from 1.x.
- The rectangular strategy now visits every point of a 4-pixel grid in rings
  shaped to the aspect ratio, instead of stepping four pixels times the aspect
  ratio along the longer axis. Rectangular layouts differ from 1.x, and pack
  densely at any aspect ratio.
- Both built-in spirals stretch to the aspect ratio only up to 64:1. Beyond
  that they barely moved along the shorter axis, so a search starting in a
  blocked column or row could take minutes and then fail. Layouts with more
  extreme aspect ratios differ from 1.x.
- Invalid arguments throw instead of being silently replaced: non-finite
  coordinates, sizes, rotations, padding, image dimensions and strategy
  candidates; negative padding; `size()` dimensions outside 0–16,777,216;
  `blockSize()` outside 1–4096; a `random()` that is not a function or returns
  anything but a number in `[0, 1)`; fonts the canvas rejects; canvases
  without a 2d context; and canvases whose `getImageData()` returns more than
  one pixel per canvas unit, as some old high-density WebKit canvases did.

### Added

- Added `CloudLayout.getSprite(...)` for explicit sprite preparation and
  `place()` for caller-controlled placement. Sprites are immutable masks with
 

Dale estos datos a tu agente de IA

Vigia es un servidor MCP gratuito: tu agente de programación verifica versiones, cambios incompatibles y vulnerabilidades antes de escribir código. Sin registro ni clave de API.

claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp

Agregar a CursorAgregar a VS Code★ Estrella en GitHub

Cualquier otro cliente MCP
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }

Skill para agentes (SKILL.md): le indica al agente cuándo usar Vigia · GitHub Action para pull requests

Preguntas frecuentes

¿Cuáles son los cambios incompatibles al actualizar d3-cloud de 1 a 2?

Entre d3-cloud 1.2.9 y 2.0.0, Vigia encontró 0 exports eliminados, 0 firmas modificadas y 0 miembros de clases o interfaces eliminados o modificados.

¿Qué quedó deprecado en d3-cloud 2?

0 exports o miembros quedaron marcados como deprecados en d3-cloud 2.0.0.

Para agentes

GET https://vigia.coredls.cloud/v1/packages/npm/d3-cloud/upgrade?from=1.2.9&to=2.0.0