Highcharts as a CommonJS Asynchronous Module
Hello,
Please add the following code in Highcharts:
// Expose Highcharts as a CommonJS Asynchronous Module
if ( typeof require !== "undefined" && require.def ) {
require.def( [], function () { return Highcharts; } );
}
This code would register Highcharts as an CommonJS asynchronous module.
It would make Highcharts easier to use when working with RequireJS (and other loaders).
I pasted more links for modules and loaders are discussed.
http://dev.jquery.com/ticket/7102 (<--- this will expose jQuery as a module)
http://github.com/jrburke/jquery/commit/93dc7a7e3c383ff8a6507342af7e14821bef8d9b
http://groups.google.com/group/requirejs/browse_thread/thread/65eddc9f35c9e4cf
http://tagneto.blogspot.com/2010/09/anonymous-module-support-in-requirejs.html
Thank you.
Les
![](https://secure.gravatar.com/avatar/5d92488d6c2ec1ef870ac0d1efbc74d4?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
Noah commented
+1 for AMD support.
-
Wachunga Asdf commented
It would also be desirable for Highcharts to register itself as an AMD module. See here for a workaround: http://stackoverflow.com/questions/8186027/loading-highcharts-with-require-js
-
Les commented
This feature was added in jQuery 1.7 and it would be very simple to add it to HC.
http://code.jquery.com/jquery-1.7.js
Search for "Expose jQuery as an AMD module"