Esri / cedar

JavaScript Charts for ArcGIS
https://esri.github.io/cedar
258 stars 238 forks source link

Support AMD #63

Closed abakirov closed 9 years ago

abakirov commented 9 years ago

Currently, Cedar expects global vg variable but in presence of an AMD loader (e.g. Esri JS API), Vega defines itself as AMD module without creating global variables. Cedar fails to work in this scenario.

tomwayson commented 9 years ago

This was resolved by #94 however, I think it's a good idea to modify the JSAPI map examples below to require Cedar via AMD instead of using the global:

http://esri.github.io/cedar/examples/bar-map-integration.html http://esri.github.io/cedar/examples/filter-chart-by-map-extent.html http://esri.github.io/cedar/examples/filter-chart-by-bbox.html http://esri.github.io/cedar/examples/map-to-chart-interaction.html http://esri.github.io/cedar/examples/complex-map-multiple-chart.html

I can create an AMD header template that defines dojo packages for Cedar, Vega, and D3 based on this gist and use that for the above samples instead of the current header template which pulls in Cedar as a global.

ajturner commented 9 years ago

Agreed - the samples using the JSAPI should use the Cedar in AMD.

tomwayson commented 9 years ago

resolved by #94 and #98