Showing posts with label development. Show all posts
Showing posts with label development. Show all posts
May 28, 2013
SVG/VML views in your Backbone app with Raphael
By Unknown
13:06
backbone,
development,
javascript,
raphael,
raphaeljs,
software,
tutorial
Leave a Comment
May 13, 2013
Use RaphaëlJS with AMD (recent official feature)
Hi all, I'm the collaborator of RaphaëlJS github repo. (Don't know SVG or Raphaël?? Check it out!, really cool things can be done with it).
Thanks to our contributors now it's easy to add the library using AMD, something difficult to do before.
Here is how and an example!
We have in the body the div that will work as the container of Raphael, notice that there are other ways of creating the svg/vml root element.
Then the main.js file:
Here you set the path to Raphael and you are ready to go!
Or set this configuration in your configuration:
And you can require the module like this:
This is the simplest of the examples, in my repo I have some variants:
Enjoy!!
Read More...
Thanks to our contributors now it's easy to add the library using AMD, something difficult to do before.
Here is how and an example!
tl;dr? Check my raphael-boilerplate repo.
The example
First the html, we will use require.js so you need to add it in you project structure. The same with your main javascript file, where require will start to download the js.<html>
<head>
<title>Raphael Dev testing html</title>
<script data-main="main" src="require.js"></script>
</head>
<body>
<!-- Here is the container for Raphael -->
<div id="container"></div>
</body>
</html>
We have in the body the div that will work as the container of Raphael, notice that there are other ways of creating the svg/vml root element.
Then the main.js file:
require([ "path/to/raphael" ], function (Raphael) {
console.log(Raphael);
});
Here you set the path to Raphael and you are ready to go!
Or set this configuration in your configuration:
require.config({
paths: {
raphael: "libs/raphael"
}
});
And you can require the module like this:
require([ "raphael" ], function (Raphael) {
console.log(Raphael);
});
This is the simplest of the examples, in my repo I have some variants:
- Global use (window.Raphael)
- This example of AMD
- HTML5 Boilerplate with Raphael
Enjoy!!
March 8, 2013
February 18, 2013
February 16, 2013
Testing in Agile Teams
Moved to http://tomasalabes.me/blog/_site/web-development/2012/02/16/Testing-in-Agile-Teams.html