**Last time, we looked at the “transform” attribute, particularly with regard to its frequent appearances in Inkscape files. In this instalment, and the next, we’re going to combine this information with some of the JavaScript we’ve covered in previous months to show how you might animate the moving, turning, skewing and scaling of an SVG element. Once again we’ll start off with a very simple SVG file (top right).** La dernière fois, nous avons regardé l'attribut « transform », en particulier par rapport à ses fréquentes apparitions dans les fichiers d'Inkscape. Dans cet article, et dans le prochain, nous allons combiner cette information avec un peu de JavaScript, dont nous avons parlé dans les mois précédents, pour vous montrer comment vous pourriez animer le déplacement, la rotation, la déformation et le changement d'échelle d'un élément SVG. Une fois encore, nous commencerons avec un fichier SVG très simple (en haut à droite). **As usual, we’ve got a viewbox of 100×100 units, but, this time, I’ve added a background to make it clearer where the extents of the canvas are when the file is loaded into a web browser. The element we’re going to animate is the red rectangle, which is inside a group (). The group has a transform attribute on it, containing a series of functions that will be applied to its content. In this case, they each have no effect – a rotation of 0 doesn’t turn the shape at all, whilst a scale factor of 1 leaves it at its original size. Strictly speaking, they’re not necessary at all at this point, but they are present to show you the format of the string we’ll be creating with our animation code.** Comme d'habitude, nous trouvons une viewbox de 100x100 unités, mais, cette fois, j'ai ajouté un en arrière-plan pour clarifier la position des limites du canevas quand le fichier est chargé dans un navigateur Web. L'élément que nous allons animer est un rectangle rouge, qui est à l'intérieur d'un groupe (). Le groupe possède un attribut transform, contenant une série de fonctions qui seront appliquées à son contenu. Dans notre cas, elles n'ont pas d'effet - une rotation de 0 ne fait pas du tout tourner la forme, de même qu'un facteur d'échelle de 1 la laisse à sa taille d'origine. Strictement parlant, elles ne sont pas du tout nécessaires à ce stade, mais elles sont là pour vous montrer le format de la chaîne que nous créerons avec notre code d'animation. **The rectangle itself bears a little explanation. In an SVG document, the y-axis runs down the page, and the x-axis runs from left to right. So the origin – the 0,0 point in the image – is at the top-left of the page. The position of a is also based on its top-left corner. Therefore, setting the “x” and “y” attributes to 0 would position the rectangle at the top left of the screen. But, for this code, I want to pretend that the “x” and “y” coordinates correspond to the center of the rectangle. This means offsetting its position by half the width to the left, and half the height upwards. Since it’s 20 units on each side, the transform attribute with a translate(-10, -10) does the job nicely. Basically, we’ve moved the rectangle’s reference point from the top-left corner to the center. With that manipulation in place, using 50 for the “x” and “y” coordinates puts it right in the middle of the image.** Le rectangle lui-même nécessite un peu d'explication. Dans un document SVG, l'axe y descend le long de la page et l'axe x va de la gauche vers la droite. Ainsi, l'origine - le point 0,0 de l’image - est en haut à gauche de la page. La position d'un est aussi basée sur ce coin en haut à gauche. Par conséquent, paramétrer les attributs « x » et « y » à 0 positionnerait le rectangle en haut et à gauche de l'écran. Mais, pour ce code, je veux faire comme si les coordonnées « x » et « y » correspondent au centre du rectangle. Ça signifie qu'il faut décaler sa position de la moitié de la largeur de l'écran vers la gauche, et de la moitié de la hauteur vers le haut. Comme il y a 20 unités de chaque côté, l'attribut transform avec un translate (-10, -10) fait bien l'affaire. En gros, nous avons déplacé le point de référence du rectangle du coin en haut à gauche au milieu. Cette manipulation étant réalisée, en utilisant 50 pour les coordonnées de « x » et « y », il se trouve pile au milieu de l'image. **There’s one other line in the file – a