-# Bu.coffee: namespace, constants, utility functions and polyfills
-
-# Save the previous value of `global` variable.
-previousGlobal = global
-
-# Get the root object
+# Namespace, constants, utility functions and polyfills
+
+#----------------------------------------------------------------------
+# Namespace
+#----------------------------------------------------------------------
+
 global = window or @
-
-# Define our namespace `Bu`.
-global.Bu = {}
-
-# Save the root object to our namespace.
-Bu.global = global
-
-# Return back the previous global variable.
-global = previousGlobal
+global.Bu = {global}
 
 
 #----------------------------------------------------------------------
 # Constants
 #----------------------------------------------------------------------
 
-# Version info of this library
+# Version info
 Bu.VERSION = '0.3.5'
 
 # Browser vendor prefixes, used in experimental features

		document.addEventListener 'DOMContentLoaded', -> cb.apply context, args

#----------------------------------------------------------------------
# Polyfill
#----------------------------------------------------------------------

# Shortcut to define a property for a class. This is used to solve the problem

# Math
Bu.HALF_PI = Math.PI / 2
Bu.TWO_PI = Math.PI * 2

# Default font for the text
Bu.DEFAULT_FONT_FAMILY = 'Verdana'
Bu.DEFAULT_FONT_SIZE = 11
Bu.DEFAULT_FONT = '11px Verdana'

# Point is rendered as a small circle on screen. This is the radius of the circle.
Bu.POINT_RENDER_SIZE = 2.25

# Point can have a label attached near it. This is the gap distance between them.
Bu.POINT_LABEL_OFFSET = 5

# Default smooth factor of spline, range in [0, 1] and 1 is the smoothest
Bu.DEFAULT_SPLINE_SMOOTH = 0.25
