The goal of Rigma is to provide a user friendly client to ‘Figma’API. It uses the latesthttr2 for a stable interface withthe ‘Figma’ API. More than 20 methods are provided to interact with‘Figma’ files, and teams. Get design data into R by reading publishedcomponents and styles, converting and downloading images, getting accessto the full ‘Figma’ file as a hierarchical data structure, and muchmore. Enhance your creativity and streamline the application developmentby automating the extraction, transformation, and loading of design datato your applications and documents.
You can install the development version of ‘Rigma’ fromGitHub with:
# install.packages("devtools")devtools::install_github("AleKoure/Rigma")An account can be accessed using an API by the owner of a personalaccess token just as if they were the user who created the token.
Make your own access token.
When you retrieve the personal access token save it as anenvironmental variable (e.g. edit.Renviron by typingusethis::edir_r_environ()).
FIGMA_ACCESS_TOKEN="YOUR_ACCESS_TOKEN_GOES_HERE!!!"After saving your changes restart R session.
Open ‘Figma’ and navigate to your favorite file. In the URL you cansee the key of the file. To retrieve the File as an R objectexecute:
example_file_key <- "sFHgQh9dL6369o5wrZHmdR"get_file(example_file_key)A tree of nodes is used to represent the ‘Figma’ file. Every file hasa DOCUMENT node at the root, and any CANVAS nodes branch out of thatnode.