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 8041181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:07:50+00:00 2026-06-05T04:07:50+00:00

If I were animating an individual element with raphael.js to a specific location ,

  • 0

If I were animating an individual element with raphael.js to a specific location, then I could use the following code that sets the elements x attribute:

elem.animate({x: specific_X_Location}, 1000);

but I have found no way to move a set to a specific location.

There are two SO articles:
accessing a set inside a set in raphael js, and
How is set animation done in Raphael?
that discuss how to translate a set a given distance (i.e. move the set right by 100, or up by 100) which use transformation or translation, e.g.

var mySet = paper.set();
mySet.push(...add elements to set);
mySet.animate({transform: "t100,0"}, 1000); // move my set right by 100

but there doesn’t seem to be a way to move the whole set to a specific location.

Looking at things in firebug, I guess a set is just an array in the end, which is why is doesn’t have x or y attributes.

Is it possible to access any information about the elements of the set without addressing them individually?

In order to transform a set to a specific location, do you think I will have to work out the transformation for a specific element and then apply that movement to the whole set? Or is there a better way that I’ve missed?

Thanks a lot

  • 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-05T04:07:51+00:00Added an answer on June 5, 2026 at 4:07 am

    You are right that the set is just an array.
    And sadly there is no easy way to move a whole set – at least from what I have gathered.
    I have been facing this same problem in a project ive been working on, well… all night.
    It would seem that the set is most useful to apply attributes etc to a large group of objects. Say if you want a hundred red circles on the screen set is your guy.
    But if you attempt to apply the transform to the set it will work the same way as apply attributes – its global to the set. This means all your circles will go to the same coordinates and scale etc. rather than just one.
    A work around I have been using is to use exclude and getById – like this :

     yourSet.exclude(paper.getById('2'));
    

    Once you have excluded your object from the set you can then apply the transform to the singular object like this.

     paper.getById('2').transform('t230,265s3');
    

    Then you just repeat for each object you wish to move.

    As you can imagine this is incredibly tedious for large sets and you may as well just use the singular var syntax (unless you’re applying attributes to a group of objects).

    I’m wondering if there is a way to use array syntax and math to do this for you, but then you’ve got to figure out all the relationships between the objects.

    Or perhaps we’ll see if a newer release of Raphael will contain some sort of easy set-transform. That would be genius.

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

Sidebar

Related Questions

I am animating a UIView that contains a graph drawn with CGPath elements myView.frame=CGRectMake(0,0,1024,768);
I m un-animating a list using this code... function unanimate_li() { $li.filter(':last') .animate({ height:
i am animating an UIImageView with an image of a circle that grows and
I have an ImageView that I am animating using a TranslateAnimation. At the end
I have a nested oredered list which i m animating using this code... var
I am animating a UIView along a circle using a CAKeyframeAnimation that follows a
I need a callback to execute once after multiple elements have finished animating. My
I'm trying to slide individual <li> elements within a <ul> up, but the effect
I have a DataTemplate that I use to display details from a class in
I'm looking for a library that will allow me to easily use CSS Transitions

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.