Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

307
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!