Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:29:56+00:00 2026-06-15T11:29:56+00:00

I have a path in SVG defining a clipPath. Lines (tick marks) are drawn

  • 0

I have a path in SVG defining a clipPath. Lines (tick marks) are drawn and clipped to the path.

When I perform an animation of the lines, they retain the original clipping. I would like them to be ‘re-clipped’ at each stage of the animation.

Question: Is there an easy way to have the clipping performed during the transition?

Sample problem code:
http://jsfiddle.net/Q29TA/

When you click on the svg, it demonstrates the animation.

Relevant snippets:

d3.select( "#g-container" )
  .selectAll( "line" )
  .data( y.ticks( 10 ) )
  .enter()
    .append( "line" )
    .attr( "x1", 0 ).attr( "x2", width )
    .attr( "y1", y ).attr( "y2", y )
    .attr( "class", "tick-marks" )
    .attr( "clip-path", "url(#myclip)" );​

d3.select( "svg" )          
    .on("click", function() {
       d3.selectAll(".tick-marks")
          .transition().duration( 2500 )
          .attr( "transform", "translate(0,30)" )
    } )

I am open to new ways of doing this, but I can’t hardcode an animation that recomputes the line’s x1 and x2, since the clipPath could be anything.

Sample picture showing the aftermath of animation (I want the horizontal lines to meet the blue, diagonal line of the container):
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:29:58+00:00Added an answer on June 15, 2026 at 11:29 am

    It’s better to use a single clip-path, just move the clip-path up to the container g element instead:

    http://jsfiddle.net/dxZyq/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a series of backwards-'L' shapes drawn in Raphael in SVG path notation
I have a path I've created in Illustrator and saved as an SVG. Now
I have an SVG file that contains several elements (like path, circles, rectangles, etc.).
I have used http://readysetraphael.com/ to convert a svg to a path in raphaeljs. I
I have a problem with Raphael.path2curve() . The function modifies SVG path string so
I have the following code: $image = new Imagick(); $image->setBackgroundColor(new ImagickPixel('green')); $image->setSize(20,20); $image->readImageBlob(file_get_contents('./some/path/image.svg')); It
Secondly, I have an SVG form transform in different path using raphaeljs lib. I
I have a SVG path element in my application, like: <path d=M100,100 Q200,400,300,100/> In
I have a SVG path, created in Inkscape, that is a single Move (M
i am trying to rotate circle on a elliptrical path using svg animation, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.