Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

314
Vistas
transision() causes Uncaught TypeError with D3 version 7.2.1

I have selected svg element (circle) and I want to apply a transition on it. When I try to apply transition on the circle I get "Uncaught TypeError: circle.transition is not a function".

I've written this code:

import * as selection from '../node_modules/d3-selection/src/index.js';

const RENDER_AREA_ID = "#renderArea";
let svg = selection.select(RENDER_AREA_ID).append("svg")
    .attr("width", document.querySelector(RENDER_AREA_ID).offsetWidth)
    .attr("height", document.querySelector(RENDER_AREA_ID).offsetHeight);
let circle = svg.append("circle")
    .attr("r", 10)
    .attr("cx", 10)
    .attr("cy", 10)
    .attr("fill", "blue")
    .attr("stroke", "black");
circle.transition().attr("cx", 100); // here I get the TypeError

I've tried D3 version 4.x (avalible on this link: https://d3js.org/d3.v4.min.js) and the transition worked just fine. I face the issue while using version 7.2.1.

My question is: What could be possibly causing the Uncaught TypeError?

UPDATE: I've just find out that the issue is somehow associated with npm. When I access D3 through this link: https://d3js.org/d3.v7.min.js, then the transition works. But when I use d3 package from npm then the issue occurs.

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda